mirror of
https://github.com/projekteuler/projekteuler.git
synced 2026-01-27 10:38:50 +01:00
Show author names in problem and translation views
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= Translation.human_attribute_name(:created_at) %></th>
|
||||
<th><%= Translation.human_attribute_name(:author) %></th>
|
||||
<th><%= Translation.human_attribute_name(:problem_id) %></th>
|
||||
<th><%= Translation.human_attribute_name(:title) %></th>
|
||||
</tr>
|
||||
@@ -16,6 +17,13 @@
|
||||
<% @translations.each do |translation| %>
|
||||
<tr>
|
||||
<td><div data-toggle="tooltip" data-placement="left" title="<%= l translation.created_at %>"><%= time_ago_in_words(translation.created_at) %></div></td>
|
||||
<td>
|
||||
<% if translation.has_author? %>
|
||||
<%= translation.author.name %>
|
||||
<% else %>
|
||||
<i><%= t('.anonymous') %></i>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= translation.problem_id %></td>
|
||||
<td><%= link_to translation.title, [:admin, translation] %></td>
|
||||
</tr>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<% provide(:title, t('problems.show.problem_subtitle', id: @translation.problem_id)) %>
|
||||
|
||||
<div class="page-header">
|
||||
<p class="text-muted">
|
||||
<%= render 'shared/authors', authors: Array(@translation.author) %>
|
||||
</p>
|
||||
<h1><%= @translation.title %> <small><%= t 'problems.show.problem_subtitle', id: @translation.problem_id %></small></h1>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user