Skip to content

Commit

Permalink
Add RepositoryView, corresponding template and RepositoryController
Browse files Browse the repository at this point in the history
  • Loading branch information
pangratz committed Jul 23, 2012
1 parent d867397 commit b003222
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
2 changes: 2 additions & 0 deletions app/lib/controller.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ require('dashboard/core');


Dashboard.ApplicationController = Ember.Controller.extend(); Dashboard.ApplicationController = Ember.Controller.extend();


Dashboard.RepositoryController = Ember.ObjectController.extend();

Dashboard.RepositoriesController = Ember.ArrayController.extend({ Dashboard.RepositoriesController = Ember.ArrayController.extend({
sortProperties: 'full_name'.w(), sortProperties: 'full_name'.w(),
loadWatchedRepositories: function(username) { loadWatchedRepositories: function(username) {
Expand Down
4 changes: 4 additions & 0 deletions app/lib/view.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Dashboard.ApplicationView = Ember.View.extend({
templateName: 'application' templateName: 'application'
}); });


Dashboard.RepositoryView = Ember.View.extend({
templateName: 'repository'
});

Dashboard.RepositoriesView = Ember.View.extend({ Dashboard.RepositoriesView = Ember.View.extend({
templateName: 'repositories' templateName: 'repositories'
}); });
9 changes: 3 additions & 6 deletions app/templates/repositories.handlebars
Original file line number Original file line Diff line number Diff line change
@@ -1,11 +1,8 @@
<div class="row">Watched repositories:</div> <div class="row">Watched repositories:</div>
<div class="row" > <div class="row" >
<ul>
{{#each repository in controller}} {{#each repository in controller}}
<li> <a {{action showUser context="repository.owner.login"}} >{{repository.owner.login}}</a> / <a {{action showRepository context="repository.full_name"}} >{{repository.name}}</a>
<a {{bindAttr href="repository.html_url"}} >{{repository.full_name}}</a> {{repository.description}}
{{repository.description}} <dl class="dl-horizontal">
</li>
{{/each}} {{/each}}
</ul>
</div> </div>
9 changes: 9 additions & 0 deletions app/templates/repository.handlebars
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="well" >
<a {{action showUser }} >{{owner.login}}</a> / {{name}} – <a {{bindAttr href="html_url"}}>show@GitHub</a>
<dl class="dl-horizontal">
{{description}}
<dl class="dl-horizontal">
<span class="badge" title="watchers" ><i class="icon-eye-open" ></i> {{watchers}}</span>
<span class="badge" title="forks" ><i class="icon-heart" ></i> {{forks}}</span>
<span class="badge" ><i class="icon-tag" ></i> {{language}}</span>
</div>
6 changes: 6 additions & 0 deletions app/tests/unit/view_test.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ test("it exists", function() {
ok(Dashboard.ApplicationView, "it exists"); ok(Dashboard.ApplicationView, "it exists");
}); });


module("Dashboard.RepositoryView");

test("it exists", function() {
ok(Dashboard.RepositoryView, "it exists");
});

module("Dashboard.RepositoriesView"); module("Dashboard.RepositoriesView");


test("it exists", function() { test("it exists", function() {
Expand Down

0 comments on commit b003222

Please sign in to comment.