Fix #4002: Always include "updated by" line when creator != updater
This commit is contained in:
7
app/views/application/_update_notice.html.erb
Normal file
7
app/views/application/_update_notice.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<%# record, interval %>
|
||||
|
||||
<% if record.respond_to?(:updater) && record.updater != record.creator %>
|
||||
<p class="info">Updated by <%= link_to_user record.updater %> <%= time_ago_in_words_tagged(record.updated_at) %></p>
|
||||
<% elsif record.updated_at - record.created_at > (local_assigns[:interval] || 5.minutes) %>
|
||||
<p class="info">Updated <%= time_ago_in_words_tagged(record.updated_at) %></p>
|
||||
<% end %>
|
||||
@@ -16,9 +16,7 @@
|
||||
<div class="body prose">
|
||||
<%= format_text(comment.body) %>
|
||||
|
||||
<% if comment.updated_at - comment.created_at > 5.minutes %>
|
||||
<p class="info">Updated by <%= link_to_user comment.updater %> <%= time_ago_in_words_tagged(comment.updated_at) %></p>
|
||||
<% end %>
|
||||
<%= render "update_notice", record: comment %>
|
||||
</div>
|
||||
|
||||
<% if CurrentUser.is_member? %>
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
<div class="prose">
|
||||
<%= format_text(forum_post.body) %>
|
||||
</div>
|
||||
<% if forum_post.updated_at - forum_post.created_at > 5.minutes %>
|
||||
<p class="info">Updated by <%= link_to_user forum_post.updater %> <%= time_ago_in_words_tagged(forum_post.updated_at) %></p>
|
||||
<% end %>
|
||||
<%= render "update_notice", record: forum_post %>
|
||||
<menu>
|
||||
<li>ID: <%= forum_post.id %></li>
|
||||
<% if CurrentUser.is_member? && @forum_topic %>
|
||||
|
||||
@@ -20,9 +20,7 @@
|
||||
<td><%= compact_time(feedback.created_at) %></td>
|
||||
<td>
|
||||
<%= format_text(feedback.body) %>
|
||||
<% if feedback.updated_at > feedback.created_at %>
|
||||
<p class="info">Updated <%= time_ago_in_words_tagged(feedback.updated_at) %></p>
|
||||
<% end %>
|
||||
<%= render "update_notice", record: feedback, interval: 0.minutes %>
|
||||
</td>
|
||||
<td>
|
||||
<% if feedback.editable_by?(CurrentUser.user) %>
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
<th>Date</th>
|
||||
<td>
|
||||
<%= compact_time @change_request.created_at %>
|
||||
<% if @change_request.updated_at - @change_request.created_at > 5.minutes %>
|
||||
(updated <%= time_ago_in_words_tagged @change_request.updated_at %>)
|
||||
<% end %>
|
||||
<%= render "update_notice", record: @change_request %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user