-
Notifications
You must be signed in to change notification settings - Fork 37
/
clear.html.erb
37 lines (32 loc) · 1.16 KB
/
clear.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<h3>Clear Feedback</h3>
<table class="table posts-table-single">
<thead>
<tr>
<th>Post</th>
</tr>
</thead>
<tbody>
<%= render "posts/post", post: @post %>
</tbody>
</table>
<br />
<table class="table">
<thead>
<tr>
<th>Feedback</th>
<th>User</th>
<th>Timestamp</th>
<th></th>
</tr>
</thead>
<tbody>
<% @feedbacks.each do |feedback| %>
<tr class="<%= feedback.is_invalidated? ? "danger" : "" %>">
<td class="<%= element_class_for_feedback feedback %>"><%= feedback.feedback_type %></td>
<td><%= feedback.user_name || ("#{feedback.user.try(:username)} (From #{feedback.api_key.try(:app_name) || ("Chat" if feedback.chat_user_id.present?) || "Review"})" if feedback.user.present?) %></td>
<td><span title="<%= feedback.created_at %>"><%= feedback.created_at.present? ? time_ago_in_words(feedback.created_at) + " ago" : "no data" %></span></td>
<td><%= link_to("delete", delete_feedback_path(feedback), method: :delete) if (!feedback.is_invalidated? && (current_user.has_role?(:admin) || feedback.user_id == current_user.id)) %></td>
</tr>
<% end %>
</tbody>
</table>