Merge pull request #101 from tms/profile-stream-cleanup

Tweaked profile stream activity entries
This commit is contained in:
Sam 2013-02-09 21:46:39 -08:00
commit 4b0eec334f
4 changed files with 14 additions and 10 deletions

View File

@ -60,12 +60,13 @@ Handlebars.registerHelper 'avatar', (user, options) ->
user = Ember.Handlebars.get(this, user, options) if typeof user is 'string' user = Ember.Handlebars.get(this, user, options) if typeof user is 'string'
username = Em.get(user, 'username') username = Em.get(user, 'username')
username ||= Em.get(user, options.hash.usernamePath) username ||= Em.get(user, options.hash.usernamePath)
title = Em.get(user, 'title') || Em.get(user, 'description') unless options.hash.ignoreTitle
new Handlebars.SafeString Discourse.Utilities.avatarImg( new Handlebars.SafeString Discourse.Utilities.avatarImg(
size: options.hash.imageSize size: options.hash.imageSize
extraClasses: Em.get(user, 'extras') || options.hash.extraClasses extraClasses: Em.get(user, 'extras') || options.hash.extraClasses
username: username username: username
title: Em.get(user, 'title') || Em.get(user, 'description') || username title: title || username
avatarTemplate: Ember.get(user, 'avatar_template') || options.hash.avatarTemplate avatarTemplate: Ember.get(user, 'avatar_template') || options.hash.avatarTemplate
) )
@ -125,4 +126,9 @@ Handlebars.registerHelper 'date', (property, options) ->
new Handlebars.SafeString("<span class='date' title='#{fullReadable}'>#{displayDate}</span>") 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

@ -2,11 +2,12 @@
{{#collection contentBinding="stream" itemClass="item"}} {{#collection contentBinding="stream" itemClass="item"}}
{{#with view.content}} {{#with view.content}}
<div class='clearfix info'> <div class='clearfix info'>
<a href="/users/{{unbound username}}" class='avatar-link'><div class='avatar-wrapper'>{{avatar this imageSize="large" extraClasses="actor" avatarTemplatePath="avatar_template"}}</div></a> <a href="/users/{{unbound username}}" class='avatar-link'><div class='avatar-wrapper'>{{avatar this imageSize="large" extraClasses="actor" avatarTemplatePath="avatar_template" ignoreTitle="true"}}</div></a>
<span class='time'>{{date path="created_at" leaveAgo="true"}}</span> <span class='time'>{{date path="created_at" leaveAgo="true"}}</span>
<a class='name' href="{{unbound postUrl}}">{{unbound name}}</a><br> <a class="title" href="{{unbound postUrl}}">{{unbound title}}</a><br>
<a class='name' href="/users/{{unbound username}}">{{personalizedName name usernamePath="username"}}</a>
<span class='type'>{{unbound description}}</span> <span class='type'>{{unbound description}}</span>
<span class='title'><span class="post-number">#{{unbound post_number}}</span> <a href="{{unbound postUrl}}">{{unbound title}}</a></span> <a class="post-number" href="{{unbound postUrl}}">#{{unbound post_number}}</a>
</div> </div>
<p class='excerpt'> <p class='excerpt'>
{{{unbound excerpt}}} {{{unbound excerpt}}}

View File

@ -241,10 +241,6 @@
color: lighten($black, 30%); color: lighten($black, 30%);
} }
.item { .item {
.post-number {
color: lighten($black, 40%);
margin-right: 4px;
}
padding: 10px 8px; padding: 10px 8px;
background-color: white; background-color: white;
border: 1px solid #b9b9b9; border: 1px solid #b9b9b9;
@ -266,7 +262,7 @@
float: left; float: left;
margin-right: 10px; margin-right: 10px;
} }
.name { .title {
display: inline-block; display: inline-block;
margin-bottom: 4px; margin-bottom: 4px;
font-size: 14px; font-size: 14px;

View File

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