Skip to content
This repository has been archived by the owner on Nov 11, 2018. It is now read-only.

Commit

Permalink
Merge pull request #52 from christianbundy/make-user-profiles
Browse files Browse the repository at this point in the history
Make user profiles
  • Loading branch information
christianbundy committed Mar 19, 2014
2 parents de17eaa + 05eb60d commit 990e376
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 9 deletions.
8 changes: 5 additions & 3 deletions client/views/post/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
{{> stars}}
{{/if}}
</span>
<span class="hidden-xs">Posted by</span>
<span class="hidden-xs">Posted by</span>
<a class="author" href="/user/{{username}}">{{username}}</a>
<span class="hidden-xs">with</span>
<a class="comments" href="{{commentLink}}">{{commentCopy}}</a>
<div class="hidden">
<span class="hidden-xs">with</span>
<a class="comments" href="{{commentLink}}">{{commentCopy}}</a>
</div>
</div>
</div>
</template>
1 change: 0 additions & 1 deletion client/views/post/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var cleanText = function (str) {
return str.replace(/[^\w\s]/gi, '').replace(/\W/g, "-").toLowerCase();
};


Template.post.helpers({
commentCopy: function() {
"use strict";
Expand Down
7 changes: 5 additions & 2 deletions client/views/user/user.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template name="user">
<div class="entry col-md-6 col-md-offset-3">
Oops – user profiles haven't been finished yet!
<div class="user-profile-name">
{{username}}
</div>
{{#each posts}}
{{> post}}
{{/each}}
</template>
1 change: 1 addition & 0 deletions client/views/user/user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Meteor.subscribe('posts');
6 changes: 6 additions & 0 deletions client/views/user/user.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.user-profile-name {
text-align: center;
font-size: 1.5rem;
padding: 1.5rem;
border-bottom: 2px solid #F9FAFB;
}
11 changes: 9 additions & 2 deletions shared/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@ Router.map(function () {
template: 'feed'
});
this.route('user', {
path: 'user/:id',
template: 'user'
path: 'user/:username',
template: 'user',
data: function () {
var templateData = {
username: this.params.username,
posts: Posts.find({username : this.params.username})
};
return templateData;
}
});
this.route('comments', {
path: 'comments/:id/*',
Expand Down
2 changes: 1 addition & 1 deletion shared/version.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Meteor.Fraction = {
version: '0.5.0'
version: '0.6.0'
};

0 comments on commit 990e376

Please sign in to comment.