Simplify link_to user calls on issue pages

This commit is contained in:
Anton Khorev 2024-03-20 04:38:34 +03:00
parent 188a6e175e
commit 6cf9f5dc9c
4 changed files with 7 additions and 7 deletions

View file

@ -2,11 +2,11 @@
<% comments.each do |comment| %>
<div class="row">
<div class="col-auto">
<%= link_to user_thumbnail(comment.user), user_path(comment.user) %>
<%= link_to user_thumbnail(comment.user), comment.user %>
</div>
<div class="col">
<p class="text-muted">
<%= t ".comment_from_html", :user_link => link_to(comment.user.display_name, user_path(comment.user)),
<%= t ".comment_from_html", :user_link => link_to(comment.user.display_name, comment.user),
:comment_created_at => tag.time(l(comment.created_at.to_datetime, :format => :friendly),
:datetime => comment.created_at.xmlschema) %>
</p>

View file

@ -1,12 +1,12 @@
<% reports.each do |report| %>
<div class="row">
<div class="col-auto">
<%= link_to user_thumbnail(report.user), user_path(report.user) %>
<%= link_to user_thumbnail(report.user), report.user %>
</div>
<div class="col">
<p class="text-muted">
<%= t ".reported_by_html", :category => report.category,
:user => link_to(report.user.display_name, user_path(report.user)),
:user => link_to(report.user.display_name, report.user),
:updated_at => tag.time(l(report.updated_at.to_datetime, :format => :friendly),
:datetime => report.updated_at.xmlschema) %>
</p>

View file

@ -59,10 +59,10 @@
<td><%= t ".states.#{issue.status}" %></td>
<td class="text-nowrap"><%= 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, user_path(issue.reported_user) if issue.reported_user %></td>
<td><%= link_to issue.reported_user.display_name, issue.reported_user if issue.reported_user %></td>
<td>
<% if issue.user_updated %>
<%= t ".last_updated_time_ago_user_html", :user => link_to(issue.user_updated.display_name, user_path(issue.user_updated)),
<%= t ".last_updated_time_ago_user_html", :user => link_to(issue.user_updated.display_name, issue.user_updated),
:time_ago => friendly_date_ago(issue.updated_at) %>
<% else %>
<%= friendly_date_ago(issue.updated_at) %>

View file

@ -21,7 +21,7 @@
| <%= t ".last_updated_at_html",
:datetime => tag.time(l(@issue.updated_at.to_datetime, :format => :friendly),
:datetime => @issue.updated_at.xmlschema),
:displayname => link_to(@issue.user_updated.display_name, user_path(@issue.user_updated)) %>
:displayname => link_to(@issue.user_updated.display_name, @issue.user_updated) %>
<% end %>
</small>
</p>