Adding a way to opt out, and opting myself out.

This commit is contained in:
August Lilleaas
2013-11-18 17:45:56 +01:00
parent 42fd57a908
commit 5f23ac2c0d
4 changed files with 27 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>GitHub R&eacute;sum&eacute;</title>
@@ -10,6 +10,7 @@
<link rel="stylesheet" type="text/css" href="css/print.css" media="print" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="js/mustache.js"></script>
<script type="text/javascript" src="js/opt_out_users.js"></script>
<script type="text/javascript" src="js/githubresume.js"></script>
</head>
<body id="resume">

View File

@@ -84,6 +84,18 @@ var run = function() {
maxItems = 5,
maxLanguages = 9;
if (githubresume_opt_out_users.indexOf(username) >= 0) {
$.ajax({
url: 'views/opt_out.html',
dataType: 'html',
success: function(data) {
var template = data;
$('#resume').html(data);
}
});
return;
}
var res = github_user(username, function(data) {
data = data.data;
var sinceDate = new Date(data.created_at);

3
js/opt_out_users.js Normal file
View File

@@ -0,0 +1,3 @@
var githubresume_opt_out_users = [
"augustl"
];

10
views/opt_out.html Normal file
View File

@@ -0,0 +1,10 @@
<div id="doc" class="yui-t7">
<div id="hd" role="banner"><h1>This user has opted out</h1></div>
<div id="bd" role="main">
<div class="yui-g">
<p>This user has opted out of this unofficial Github resume service.</p>
</div>
</div>
<div id="ft" role="contentinfo"></div>
</div>