Skip to content

Commit

Permalink
Add routes for issues and pr views. Closes #6
Browse files Browse the repository at this point in the history
  • Loading branch information
Marios Antonoudiou committed Mar 12, 2016
1 parent 2257395 commit 4c018cc
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 0 deletions.
9 changes: 9 additions & 0 deletions client/components/issuesIndex/issuesIndex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template name="issuesIndex">
<h1>Issues index page</h1>

<ul>
<li>User: {{user}}</li>
<li>Project: {{project}}</li>
<li>Url: <a href="{{example}}" target="_blank">{{example}}</a></li>
</ul>
</template>
5 changes: 5 additions & 0 deletions client/components/issuesIndex/issuesIndex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Template.issuesIndex.helpers({
example: function() {
return 'https://github.com/' + this.user + '/' + this.project + '/issues';
}
});
9 changes: 9 additions & 0 deletions client/components/pullsIndex/pullsIndex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template name="pullsIndex">
<h1>Pull Requests index page</h1>

<ul>
<li>User: {{user}}</li>
<li>Project: {{project}}</li>
<li>Url: <a href="{{example}}" target="_blank">{{example}}</a></li>
</ul>
</template>
5 changes: 5 additions & 0 deletions client/components/pullsIndex/pullsIndex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Template.pullsIndex.helpers({
example: function() {
return 'https://github.com/' + this.user + '/' + this.project + '/issues';
}
});
22 changes: 22 additions & 0 deletions routes/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,25 @@ Router.configure({
Router.route('/', function() {
this.render('home');
});

Router.route('/:user/:project/issues', function() {
this.render('issuesIndex', {
data: function() {
return {
user: this.params.user,
project: this.params.project
}
}
});
});

Router.route('/:user/:project/pulls', function() {
this.render('pullsIndex', {
data: function() {
return {
user: this.params.user,
project: this.params.project
}
}
});
});

0 comments on commit 4c018cc

Please sign in to comment.