diff --git a/css/resume.css b/css/resume.css
index 15edd55..2a372dd 100644
--- a/css/resume.css
+++ b/css/resume.css
@@ -52,9 +52,9 @@ p.enlarge span { color: #000 }
a#pdf { display: block; float: left; background: #666; color: white; padding: 6px 50px 6px 12px; margin-bottom: 6px; text-decoration: none; }
a#pdf:hover { background: #222; }
-.job { position: relative; margin-bottom: 1em; padding-bottom: 1em; border-bottom: 1px solid #ccc; }
-.job h4 { position: absolute; top: 0.35em; right: 0 }
-.job p { margin: 0.75em 0 3em 0; }
+.org, .job { position: relative; margin-bottom: 1em; padding-bottom: 1em; border-bottom: 1px solid #ccc; }
+.org h4, .job h4 { position: absolute; top: 0.35em; right: 0 }
+.org p, .job p { margin: 0.75em 0 3em 0; }
.last { border: none; }
.skills-list { }
@@ -125,3 +125,7 @@ button#gen:hover {
margin-bottom: 10px;
padding-bottom: 10px;
}
+
+.enlarge-medium {
+ font-size: 15px;
+}
diff --git a/images/loader.gif b/images/loader.gif
new file mode 100644
index 0000000..4c32ccf
Binary files /dev/null and b/images/loader.gif differ
diff --git a/js/github.js b/js/github.js
index 6f077d5..e56837f 100644
--- a/js/github.js
+++ b/js/github.js
@@ -225,6 +225,11 @@
return this;
};
+ gh.user.prototype.orgs = function (callback, context) {
+ gh.org.forUser(this.username, callback, context);
+ return this;
+ };
+
// Make this user fork the repo that lives at
// http://github.com/user/repo. You must be authenticated as this user for
// this to succeed.
@@ -271,6 +276,15 @@
this.user = user;
};
+ gh.org = function(user, org) {
+ if (!(this instanceof gh.org)) {
+ return new gh.org(user, org);
+ }
+
+ this.org = org;
+ this.user = user;
+ };
+
// Get basic information on this repo.
//
// gh.repo("schacon", "grit").show(function (data) {
@@ -403,6 +417,11 @@
return this;
};
+ gh.org.forUser = function (user, callback, context) {
+ jsonp("user/show/" + user + "/organizations", callback, context);
+ return this;
+ };
+
// Create a repository. Must be authenticated.
gh.repo.create = function (name, opts) {
authRequired(authUsername);
diff --git a/js/githubresume.js b/js/githubresume.js
index 3d78fcf..2a2ae49 100644
--- a/js/githubresume.js
+++ b/js/githubresume.js
@@ -60,13 +60,17 @@ var run = function() {
var since = new Date(data.user.created_at);
since = since.getFullYear();
+ var addHttp = '';
+ if (data.user.blog !== undefined && data.user.blog !== null) {
+ if (data.user.blog.indexOf('http') < 0) {
+ addHttp = 'http://';
+ }
+ }
- var addHttp = data.user.blog.indexOf('http') < 0 ? 'http://' : '';
var view = {
name: data.user.name,
email: data.user.email,
created_at: data.user.created_at,
- blog: addHttp + data.user.blog,
location: data.user.location,
repos: data.user.public_repo_count,
plural: data.user.public_repo_count > 1 ? 'repositories' : 'repository',
@@ -74,6 +78,10 @@ var run = function() {
since: since
};
+ if (data.user.blog !== undefined) {
+ view.blog = addHttp + data.user.blog;
+ }
+
$.ajax({
url: 'views/resume.html',
dataType: 'html',
@@ -112,32 +120,92 @@ var run = function() {
success: function(response) {
var now = new Date().getFullYear();
- sorted.forEach(function(elm, index, arr) {
- if (itemCount >= maxItems) {
- return;
- }
+ if (sorted.length > 0) {
+ $('#jobs').html('');
+ itemCount = 0;
+ sorted.forEach(function(elm, index, arr) {
+ if (itemCount >= maxItems) {
+ return;
+ }
- var since = new Date(arr[index].info.created_at);
- since = since.getFullYear();
- var view = {
- name: arr[index].info.name,
- since: since,
- now: now,
- description: arr[index].info.description,
- username: username,
- watchers: arr[index].info.watchers,
- forks: arr[index].info.forks
- };
+ var since = new Date(arr[index].info.created_at);
+ since = since.getFullYear();
+
+ var view = {
+ name: arr[index].info.name,
+ since: since,
+ now: now,
+ description: arr[index].info.description,
+ username: username,
+ watchers: arr[index].info.watchers,
+ forks: arr[index].info.forks
+ };
+
+ if (itemCount == sorted.length - 1 || itemCount == maxItems-1) {
+ view.last = 'last';
+ }
+
+ var template = response;
+ var html = Mustache.to_html(template, view);
- var template = response;
- var html = Mustache.to_html(template, view);
-
- $('#jobs').append($(html));
- ++itemCount;
- });
+
+ $('#jobs').append($(html));
+ ++itemCount;
+ });
+ } else {
+ $('#jobs').append('
I do not have any public repository. Sorry.
');
+ }
}
});
});
+
+ gh_user.orgs(function(data) {
+ var orgs = data.organizations;
+
+ var sorted = [];
+
+ orgs.forEach(function(elm, i, arr) {
+ if (arr[i].name === undefined) {
+ return;
+ }
+ sorted.push({position: i, info: arr[i]});
+ });
+
+ $.ajax({
+ url: 'views/org.html',
+ dataType: 'html',
+ success: function(response) {
+ var now = new Date().getFullYear();
+
+ if (sorted.length > 0) {
+ $('#orgs').html('');
+ sorted.forEach(function(elm, index, arr) {
+ if (itemCount >= maxItems) {
+ return;
+ }
+ var view = {
+ name: arr[index].info.name,
+ login: arr[index].info.login,
+ now: now
+ };
+
+ if (itemCount == sorted.length - 1 || itemCount == maxItems) {
+ view.last = 'last';
+ }
+ var template = response;
+ var html = Mustache.to_html(template, view);
+
+ $('#orgs').append($(html));
+ ++itemCount;
+ });
+ } else {
+ console.log(sorted);
+ $('#organizations').remove();
+ }
+ }
+ });
+ });
+
};
diff --git a/views/error.html b/views/error.html
index 189dbb5..1636e54 100644
--- a/views/error.html
+++ b/views/error.html
@@ -8,5 +8,5 @@
-
+
diff --git a/views/index.html b/views/index.html
index 6959583..2e834f2 100644
--- a/views/index.html
+++ b/views/index.html
@@ -2,25 +2,26 @@
My Github Resume
-
Welcome!
-
+
As a software startup owner I really enjoy when people send us their
- resumes and they include their github account so we can see tangible work they have done.
+ resumés and they include their github account so we can see tangible work they have done.
-
+
After a tweet by John Resig
- I imagined that it may be nice for people to be able to generate their Github resumes.
+ I imagined that it may be nice for people to be able to generate their Github resumés.
-
+
+
Generate
-
+
+
See some popular users
@@ -48,14 +49,14 @@
Notes, Information and Future features
-
+
This is the first version, please keep in mind that it only fetches your first 30 repositories for now. I am planning on adding
things as such as your most committed forks, most committed repositories and make the "My Popular Repositories" be built from
your complete list of repositories. The issue right now is say you have 37 repositories, this will only retrieve the first
30 repositories that were created. I'll put a note here when this is fixed or feel free to fork the page ,
make changes and send them back :-)
-
+
Another popular feature people are asking a lot is listing of the organizations. This is the next feature to be added .
@@ -64,7 +65,7 @@
-
+