diff --git a/js/githubresume.js b/js/githubresume.js index d5dec89..52689a9 100644 --- a/js/githubresume.js +++ b/js/githubresume.js @@ -110,13 +110,21 @@ var run = function() { name = data.name; } + var avatar = ''; + if (data.type == 'Organization'){ + avatar = data.avatar_url.match(/https:\/\/secure.gravatar.com\/avatar\/[0-9a-z]+/)[0]; + avatar += '?s=140&d=https://github.com/images/gravatars/gravatar-140.png'; + } + var view = { name: name, + type: data.type, email: data.email, created_at: data.created_at, earlyAdopter: 0, location: data.location, gravatar_id: data.gravatar_id, + avatar_url: avatar, repos: data.public_repos, reposLabel: data.public_repos > 1 ? 'repositories' : 'repository', followers: data.followers, @@ -184,8 +192,9 @@ var run = function() { view.blog = addHttp + data.blog; } + var resume = (data.type == 'User' ? 'views/resume.html' : 'views/resumeOrgs.html'); $.ajax({ - url: 'views/resume.html', + url: resume, dataType: 'html', success: function(data) { var template = data, diff --git a/views/resume.html b/views/resume.html index 2161ef9..e86b187 100644 --- a/views/resume.html +++ b/views/resume.html @@ -41,7 +41,7 @@ {{#location}} based in {{location}} {{/location}} - {{#repos}}with {{repos}} public {{reposLabel}}{{/repos}}{{^repos}}without any public repository for now{{/repos}}{{#followers}} and {{followers}} {{followersLabel}}{{/followers}}. + {{#repos}}with {{repos}} public {{reposLabel}}{{/repos}}{{^repos}}without any public repository for now{{/repos}}{{#followers}} and {{followers}} {{followersLabel}} {{/followers}}. I've been using github.com since {{since}}{{#earlyAdopter}}, therefore I'm an early adopter,{{/earlyAdopter}} {{#blog}} and sometimes I blog at {{blog}}.{{/blog}}
diff --git a/views/resumeOrgs.html b/views/resumeOrgs.html index 039d805..26ecfe4 100644 --- a/views/resumeOrgs.html +++ b/views/resumeOrgs.html @@ -13,7 +13,7 @@- We are XX developers gathered in a group + We are a developers gathered in a group {{#location}} based in {{location}} {{/location}} - with {{repos}} public {{reposLabel}}. + {{#repos}} + with {{repos}} public {{reposLabel}} + {{/repos}} + {{#followers}} and {{followers}} {{followersLabel}}{{/followers}}. We've created this Github group in {{since}}{{#earlyAdopter}}, therefore I'm an early adopter,{{/earlyAdopter}}{{#blog}} and you can find more informations about us at {{blog}}{{/blog}}.