Combine last_updated_by and last_updated_at columns on issues index

Also change to use time as a distance, and link to the user.
This commit is contained in:
Andy Allan 2018-03-14 12:50:25 +08:00
parent e44f856b53
commit aaaeb211de
2 changed files with 14 additions and 6 deletions

View file

@ -25,8 +25,7 @@
<td><b><%= t ".reports" %></b></td>
<td><b><%= t ".reported_item" %></b></td>
<td><b><%= t ".reported_user" %></b></td>
<td><b><%= t ".last_updated_by" %></b></td>
<td><b><%= t ".last_updated_at" %></b></td>
<td><b><%= t ".last_updated" %></b></td>
</tr>
</thead>
<tbody>
@ -36,8 +35,16 @@
<td><%= link_to t(".reports_count", :count => issue.reports_count), issue %></td>
<td><%= link_to reportable_title(issue.reportable), reportable_url(issue.reportable) %></td>
<td><%= link_to issue.reported_user.display_name, :controller => :user, :action => :view, :display_name => issue.reported_user.display_name if issue.reported_user %></td>
<td><% if issue.user_updated %> <%= issue.user_updated.display_name %> <% else %> - <% end %></td>
<td><%= l(issue.updated_at.to_datetime, :format => :friendly) %></td>
<td>
<% if issue.user_updated %>
<%= t ".last_updated_time_user_html", :user => link_to(issue.user_updated.display_name, :controller => :user, :action => :view, :display_name => issue.user_updated.display_name),
:time => distance_of_time_in_words_to_now(issue.updated_at),
:title => l(issue.updated_at) %>
<% else %>
<%= t ".last_updated_time_html", :time => distance_of_time_in_words_to_now(issue.updated_at),
:title => l(issue.updated_at) %>
<% end %>
</td>
</tr>
<% end %>
</tbody>

View file

@ -980,8 +980,9 @@ en:
issues_not_found: No such issues found
status: Status
reports: Reports
last_updated_at: Last Updated At
last_updated_by: Last Updated By
last_updated: Last Updated
last_updated_time_html: "<abbr title='%{title}'>%{time} ago</abbr>"
last_updated_time_user_html: "<abbr title='%{title}'>%{time} ago</abbr> by %{user}"
link_to_reports: View Reports
reported_user: Reported User
reports_count: