mirror of
https://github.com/resume/resume.github.com.git
synced 2024-09-11 12:25:56 +03:00
Dynamic user status based on repos number
This commit is contained in:
parent
8595bf0295
commit
2e3612efca
@ -87,9 +87,32 @@ var run = function() {
|
||||
repos: data.user.public_repo_count,
|
||||
plural: data.user.public_repo_count > 1 ? 'repositories' : 'repository',
|
||||
username: username,
|
||||
userStatus: 'Github user',
|
||||
since: since
|
||||
};
|
||||
|
||||
|
||||
view.userStatus = getUserStatus();
|
||||
function getUserStatus() {
|
||||
if (view.repos == 0) {
|
||||
return 'Inactive Github user';
|
||||
}
|
||||
else if (view.repos > 0 && view.repos <= 1) {
|
||||
return 'Newbie Github user';
|
||||
}
|
||||
else if (view.repos > 1 && view.repos <= 5) {
|
||||
return 'Regular Github user';
|
||||
}
|
||||
else if (view.repos > 5 && view.repos <= 10) {
|
||||
return 'Advanced Github user';
|
||||
}
|
||||
else if (view.repos > 10 && view.repos <= 30) {
|
||||
return 'Enthusiastic Github user';
|
||||
}
|
||||
else if (view.repos > 30) {
|
||||
return 'Passionate Github user';
|
||||
}
|
||||
};
|
||||
|
||||
if (data.user.blog !== undefined && data.user.blog !== null && data.user.blog !== '') {
|
||||
view.blog = addHttp + data.user.blog;
|
||||
}
|
||||
@ -274,7 +297,7 @@ var run = function() {
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
if (trackerId) {
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', trackerId]);
|
||||
@ -286,5 +309,5 @@ if (trackerId) {
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
}
|
||||
|
||||
*/
|
||||
$(window).bind('error', error);
|
||||
|
@ -6,7 +6,7 @@
|
||||
<div class="yui-u first">
|
||||
<hgroup>
|
||||
<h1>{{name}}</h1>
|
||||
<h2>Passionate github user</h2>
|
||||
<h2>{{userStatus}}</h2>
|
||||
</hgroup>
|
||||
</div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user