Show "You" to same-user on activity stream items

This commit is contained in:
tms 2013-02-09 23:44:03 -05:00
parent f6b4d0d57a
commit 9e653ad370
3 changed files with 8 additions and 2 deletions

View File

@ -125,4 +125,9 @@ Handlebars.registerHelper 'date', (property, options) ->
new Handlebars.SafeString("<span class='date' title='#{fullReadable}'>#{displayDate}</span>")
Handlebars.registerHelper 'personalizedName', (property, options) ->
name = Ember.Handlebars.get(this, property, options);
username = Ember.Handlebars.get(this, options.hash.usernamePath, options) if options.hash.usernamePath
return name unless username == Discourse.get('currentUser.username')
return Em.String.i18n('you')

View File

@ -5,7 +5,7 @@
<a href="/users/{{unbound username}}" class='avatar-link'><div class='avatar-wrapper'>{{avatar this imageSize="large" extraClasses="actor" avatarTemplatePath="avatar_template"}}</div></a>
<span class='time'>{{date path="created_at" leaveAgo="true"}}</span>
<a class="title" href="{{unbound postUrl}}">{{unbound title}}</a><br>
<a class='name' href="/users/{{unbound username}}">{{unbound name}}</a>
<a class='name' href="/users/{{unbound username}}">{{personalizedName name usernamePath="username"}}</a>
<span class='type'>{{unbound description}}</span>
<a class="post-number" href="{{unbound postUrl}}">#{{unbound post_number}}</a>
</div>

View File

@ -435,6 +435,7 @@ en:
show_more: "show more"
links: Links
faq: "FAQ"
you: "You"
suggested_topics:
title: "Suggested Topics"