<table class="table table-hover text-center admin-upgrade-notices-list-table">
  <thead class="thead-light">
  <tr>
    <th width="6%">序号</th>
    <th width="10%" class="text-left">标题</th>
    <th width="30%" class="text-left">详情</th>
    <th width="10%" class="text-left">开始时间</th>
    <th width="10%" class="text-left">结束时间</th>
    <th width="10%" class="text-left"><%= sort_tag('创建时间', name: 'created_at', path: admins_upgrade_notices_path) %></th>
    <th width="10%" class="text-left">更新时间</th>
    <th width="16%">操作</th>
  </tr>
  </thead>
  <tbody>
  <% if @upgrade_notices.present? %>
    <% @upgrade_notices.each_with_index do |notice, index| %>
      <tr class="upgrade-notice-item-<%= notice.id %>">
        <td><%= index + 1 %></td>
        <td class="text-left">
          <%= notice.title %>
        </td>
        <td class="text-left">
          <%= notice.content %>
        </td>
        <td class="text-left">
          <%= notice.start_at.to_s %>
        </td>
        <td class="text-left">
          <%= notice.end_at.to_s %>
        </td>
        <td class="text-left">
          <%= notice.created_at.to_s %>
        </td>
        <td class="text-left">
          <%= notice.updated_at.to_s %>
        </td>
        <td>
          <%= link_to '编辑', edit_admins_upgrade_notice_path(notice), remote: true, class: 'edit-action' %>
          <%= delete_link '删除', admins_upgrade_notice_path(notice, element: ".upgrade-notice-item-#{notice.id}"), class: 'delete-upgrade-notice-action' %>
        </td>
      </tr>
    <% end %>
  <% else %>
    <%= render 'admins/shared/no_data_for_table' %>
  <% end %>
  </tbody>
</table>

<%= render partial: 'admins/shared/paginate', locals: { objects: @upgrade_notices } %>