Use handlebars helpers wherever possible

This commit is contained in:
Steffen van Bergerem 2015-03-10 16:31:36 +01:00
parent 0715107735
commit af9d6ddab3
7 changed files with 18 additions and 20 deletions

View file

@ -53,12 +53,12 @@
width: 50px; width: 50px;
} }
} }
.author { .author-name {
font-weight: bold; font-weight: bold;
margin-bottom: 4px; margin-bottom: 4px;
unicode-bidi: bidi-override; unicode-bidi: bidi-override;
} }
a.author { color: $blue; } a.author-name { color: $blue; }
.feedback { .feedback {
margin-top: 5px; margin-top: 5px;
font-size: 11px; font-size: 11px;

View file

@ -20,16 +20,14 @@
{{/if}} {{/if}}
</div> </div>
{{#with author}} {{#linkToAuthor author}}
<a href="/people/{{guid}}" class="author author-name {{hovercardable this}}"> {{name}}
{{name}} {{/linkToAuthor}}
</a>
{{/with}}
<div class="collapsible comment-content"> <div class="collapsible comment-content">
{{{text}}} {{{text}}}
</div> </div>
<div class="info"> <div class="info">
<a href="/posts/{{parent.id}}#{{guid}}" class="permalink_comment"> <a href="/posts/{{parent.id}}#{{guid}}" class="permalink_comment">
<time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}"/> <time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}"/>

View file

@ -72,7 +72,7 @@
<div class="user-menu-more-indicator"> <div class="user-menu-more-indicator">
</div> </div>
<img alt="{{current_user.name}}" class="avatar user-menu-avatar" src="{{current_user.avatar.small}}" title="{{current_user.name}}" /> {{{personImage current_user 'small' 'avatar user-menu-avatar'}}}
<a class="user-name" href="#">{{current_user.name}}</a> <a class="user-name" href="#">{{current_user.name}}</a>
</li> </li>
<li class="user-menu-item"><a href="/people/{{current_user.guid}}">{{t "header.profile"}}</a></li> <li class="user-menu-item"><a href="/people/{{current_user.guid}}">{{t "header.profile"}}</a></li>

View file

@ -12,11 +12,9 @@
{{else}} {{else}}
{{#each likes}} {{#each likes}}
{{#with author}} {{#linkToAuthor author}}
<a href="/people/{{guid}}" class="{{hovercardable this}}"> {{{personImage this 'small' 'micro'}}}
<img src="{{avatar.small}}" class="avatar micro" title="{{name}}"/> {{/linkToAuthor}}
</a>
{{/with}}
{{/each}} {{/each}}
{{/unless}} {{/unless}}
</div> </div>

View file

@ -6,14 +6,16 @@
{{#with root}} {{#with root}}
<a href="/people/{{author.guid}}" class="img {{{hovercardable this}}}"> <a href="/people/{{author.guid}}" class="img {{{hovercardable this}}}">
<img src="{{author.avatar.small}}" class="avatar" /> {{{personImage author 'small'}}}
</a> </a>
{{/with}} {{/with}}
{{#with root}} {{#with root}}
<div class="bd"> <div class="bd">
<div> <div>
<a href="/people/{{author.guid}}" class="author {{{hovercardable author}}}">{{author.name}}</a> {{#linkToAuthor author}}
{{name}}
{{/linkToAuthor}}
<span class="details grey"> <span class="details grey">
- -

View file

@ -37,9 +37,9 @@
{{/if}} {{/if}}
<div> <div>
{{#with author}} {{#linkToAuthor author}}
<a href="/people/{{guid}}" class="author {{{hovercardable this}}}">{{name}}</a> {{name}}
{{/with}} {{/linkToAuthor}}
<span class="details grey"> <span class="details grey">
- -

View file

@ -16,6 +16,6 @@ end
When (/^I hover "([^"]*)" within "([^"]*)"$/) do |name, selector| When (/^I hover "([^"]*)" within "([^"]*)"$/) do |name, selector|
with_scope(selector) do with_scope(selector) do
find(".author", text: name).hover find(".author-name", text: name).hover
end end
end end