Add topic-creator class to post info on the left of a post if the poster started the topic

This commit is contained in:
Neil Lalonde 2013-04-17 11:41:22 -04:00
parent dd456df0cc
commit f6db90dae7
3 changed files with 6 additions and 1 deletions

View File

@ -343,6 +343,7 @@ Discourse.Composer = Discourse.Model.extend({
reply_count: 0,
display_username: currentUser.get('name'),
username: currentUser.get('username'),
user_id: currentUser.get('id'),
metaData: this.get('metaData'),
archetype: this.get('archetypeId'),
post_type: Discourse.get('site.post_types.regular'),

View File

@ -34,6 +34,10 @@ Discourse.Post = Discourse.Model.extend({
return this.get('post_number') === 1;
}).property('post_number'),
byTopicCreator: function() {
return this.get('topic.created_by.id') === this.get('user_id');
}.property('topic.created_by.id', 'user_id'),
hasHistory: (function() {
return this.get('version') > 1;
}).property('version'),

View File

@ -27,7 +27,7 @@
{{/if}}
<div class='topic-meta-data span2'>
<div class='contents'>
<div {{bindAttr class=":contents byTopicCreator:topic-creator"}}>
<a href='{{unbound usernameUrl}}'>{{avatar this imageSize="large"}}</a>
<h3 {{bindAttr class="moderator new_user"}}><a href='{{unbound usernameUrl}}'>{{breakUp username}}</a></h3>