From 3012f7aa1a8eabf2156395c7f00a14fe6b1a516c Mon Sep 17 00:00:00 2001 From: Ado Matejov Date: Thu, 27 Sep 2012 19:19:15 +0200 Subject: [PATCH] organizations --- js/githubresume.js | 11 ++++++++++- views/resumeOrgs.html | 9 ++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) 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/resumeOrgs.html b/views/resumeOrgs.html index 039d805..26ecfe4 100644 --- a/views/resumeOrgs.html +++ b/views/resumeOrgs.html @@ -13,7 +13,7 @@
{{#gravatar_id}} - + {{/gravatar_id}} {{#email}}

{{email}}

{{/email}}
@@ -31,11 +31,14 @@

- 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}}.