Skip to content

Commit 3de5945

Browse files
committed
added proper page title for user abilities
1 parent 757d009 commit 3de5945

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

app/views/abilities/index.html.erb

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
<% if @user.present? && @user.id == current_user&.id %>
2-
<h1>Your Abilities</h1>
3-
<% elsif @user.present? %>
4-
<h1>Abilities of <%= @user.username %></h1>
5-
<% else %>
6-
<h1>Abilities</h1>
7-
<% end %>
1+
<%
2+
title = if @user&.same_as?(current_user)
3+
'Your Abilities'
4+
elsif @user.present?
5+
sanitize("Abilities for #{user_link(@user)}")
6+
else
7+
'Abilities'
8+
end
9+
%>
10+
11+
<% content_for :title, strip_tags(title) %>
12+
13+
<h1><%= title %></h1>
814

915
<p class="is-lead">Abilities show what the community trusts you to do. You earn them by writing good posts, suggesting
1016
good edits or raising good flags.</p>
@@ -39,4 +45,4 @@
3945
</td>
4046
</tr>
4147
<% end %>
42-
</table>
48+
</table>

0 commit comments

Comments
 (0)