Added a testing organization page and added links back tot he resume templates. Also added a loading for information.

This commit is contained in:
David Coallier 2011-02-06 18:25:17 +00:00
parent 88fc2c4294
commit d8c933dabb
9 changed files with 153 additions and 41 deletions

View File

@ -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;
}

BIN
images/loader.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -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);

View File

@ -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('<p class="enlarge">I do not have any public repository. Sorry.</p>');
}
}
});
});
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();
}
}
});
});
};

View File

@ -8,5 +8,5 @@
</div>
</div>
<div id="ft" role="contentinfo"><p>Brought to your by the brilliant mind of <a href="http://twitter.com/davidcoallier">@davidcoallier</a> &lt;/modesty&gt;</p></div>
<div id="ft" role="contentinfo"><p>Brought to you by the brilliant mind of <a href="http://twitter.com/davidcoallier">@davidcoallier</a> &lt;/modesty&gt; &mdash; Resume Template from <a href="http://thingsthatarebrown.com/blog/2009/05/sample-resume-template/">Things That Are Brown</a></p></div>
</div>

View File

@ -2,25 +2,26 @@
<div id="hd" role="banner"><h1>My Github Resume</h1></div>
<div id="bd" role="main">
<div class="yui-g">
<h2>Welcome!</h2>
<p>
<p class="enlarge-medium">
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&eacute;s and they include their github account so we can see tangible work they have done.
</p>
<p><br /></p>
<p>
<p class="enlarge-medium">
After a <a href="https://twitter.com/#!/jeresig/status/33968704983138304">tweet by John Resig</a>
I imagined that it may be nice for people to be able to generate their <a href="https://github.com" title="Github">Github</a> resumes.
I imagined that it may be nice for people to be able to generate their <a href="https://github.com" title="Github">Github</a> resum&eacute;s.
</p>
<p><br /></p>
<p><br /><br /></p>
<p>
<input id="username" type="text" value="Enter your github username and click on generate" />
<button type="button" id="gen">Generate</button>
</p>
</div>
</div>
<div class="yui-g">
<p><br /><br /></p>
<h2>See some popular users</h2>
<div class="yui-gb">
<ul>
@ -48,14 +49,14 @@
<div class="yui-main">
<br /><br />
<h2>Notes, Information and Future features</h2>
<p>
<p class="enlarge-medium"><br />
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 <a href="https://github.com/resume/resume.github.com">fork the page</a>,
make changes and send them back :-)
</p>
<p>
<p class="enlarge-medium">
<br />
Another popular feature people are asking a lot is listing of the organizations. <strong>This is the next feature to be added</strong>.
<br /><br />
@ -64,7 +65,7 @@
</div>
<div id="ft" role="contentinfo"><p>Brought to you by the brilliant mind of <a href="http://twitter.com/davidcoallier">@davidcoallier</a> &lt;/modesty&gt;</p></div>
<div id="ft" role="contentinfo"><p>Brought to you by the brilliant mind of <a href="http://twitter.com/davidcoallier">@davidcoallier</a> &lt;/modesty&gt; &mdash; Resume Template from <a href="http://thingsthatarebrown.com/blog/2009/05/sample-resume-template/">Things That Are Brown</a></p></div>
</div>
<script type="text/javascript">
@ -73,7 +74,7 @@ $(document).ready(function() {
$(this).val('');
});
$(document).keyup(function(e) {
$(window).keyup(function(e) {
if (e.keyCode == 13) {
var genUser = $('#username').val();
document.location.href = "/?" + genUser;

View File

@ -1,4 +1,4 @@
<div class="job">
<div class="job {{last}}">
<h2>{{name}}</h2>
<h3>Creator & Owner</h3>
<h4>{{since}} - {{now}}</h4>

9
views/org.html Normal file
View File

@ -0,0 +1,9 @@
<div class="org {{last}}">
<h2>{{name}}</h2>
<h3>Member</h3>
<h4>{{now}}</h4>
<p>If you would like more information about this organization, please visit <a href="https://github.com/{{login}}">the organization page</a> on Github.</p>
</div>

View File

@ -33,7 +33,7 @@
with {{repos}} public {{plural}}. I've been using github.com since {{since}}
{{#blog}}
and sometimes I blog at <a href="http://{{blog}}" title="my blog">{{blog}}</a>
{{/blog}}.
{{/blog}}
</p>
</div>
</div><!--// .yui-gf -->
@ -45,9 +45,20 @@
</div><!--// .yui-u -->
<div class="yui-u" id="jobs">
<span>Loading information...</span><img src="images/loader.gif" />
</div><!--// .yui-u -->
</div><!--// .yui-gf -->
<div class="yui-gf" id="organizations">
<div class="yui-u first">
<h2>My Organizations</h2>
</div><!--// .yui-u -->
<div class="yui-u" id="orgs">
<span>Loading information...</span><img src="images/loader.gif" />
</div><!--// .yui-u -->
</div><!--// .yui-gf -->
<div class="yui-gf last">
<div class="yui-u first">
<h2>About This Resume</h2>