forgeplus/app/views/admins/feedbacks/_list.html.erb

46 lines
1.7 KiB
Plaintext

<table class="table table-hover text-center subject-list-table">
<thead class="thead-light">
<tr>
<th width="5%">序号</th>
<th width="10%">用户名</th>
<th width="20%">用户邮箱</th>
<th width="20%"><%= sort_tag('创建时间', name: 'created_at', path: admins_feedbacks_path) %></th>
<th width="25%">反馈意见</th>
<th width="15%">操作</th>
</tr>
</thead>
<tbody>
<% if feedbacks.present? %>
<% feedbacks.each_with_index do |feedback, index| %>
<tr class="feedback-item-<%= feedback.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td><%= feedback&.user&.login%></td>
<td><%= feedback&.user&.mail%></td>
<td><%= feedback.created_at&.strftime('%Y-%m-%d %H:%M') %></td>
<td>
<span class="d-inline-block" tabindex="0" data-toggle="tooltip" data-placement="left" title="<%= feedback.content%>">
<a href="javascript:">
<%= feedback.content.truncate(20) %>
</a>
</span>
</td>
<td class="action-container">
<%= link_to "发送邮件", new_history_admins_feedback_path(feedback), remote: true, class: "action" %>
<%#= link_to "删除", admins_feedback_path(feedback), method: :delete, data:{confirm: "确认删除的吗?"}, class: "action" %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: feedbacks } %>
<style>
.tooltip-inner {
max-width: 800px;
/* width: inherit; will take up least amount of space */
}
</style>