app/views/decidim/accountability/admin/results/index.html.erb in decidim-accountability-0.23.6 vs app/views/decidim/accountability/admin/results/index.html.erb in decidim-accountability-0.24.0.rc1
- old
+ new
@@ -10,27 +10,69 @@
<%= link_to t("actions.import_csv", scope: "decidim.accountability"), import_results_path, class: "button tiny button--simple" if allowed_to? :create, :result %>
</div>
</h2>
</div>
+ <%= admin_filter_selector(:results) %>
<div class="card-section">
<div class="table-scroll">
<table class="table-list">
<thead>
<tr>
- <th><%= t("models.result.fields.title", scope: "decidim.accountability") %></th>
- <%= th_resource_scope_label %>
+ <th>
+ <%= sort_link(query, :id, t("models.result.fields.id", scope: "decidim.accountability"), default_order: :desc ) %>
+ </th>
+ <th>
+ <%= sort_link(query, :title, t("models.result.fields.title", scope: "decidim.accountability")) %>
+ </th>
+ <th>
+ <%= sort_link(query, :category_name, t("models.result.fields.category", scope: "decidim.accountability") ) %>
+ </th>
+ <% if resource_with_scopes_enabled? %>
+ <th>
+ <%= sort_link(query, :scope_name, t("models.result.fields.scope", scope: "decidim.accountability") ) %>
+ </th>
+ <% end %>
+ <th>
+ <%= sort_link(query, :status_name, t("models.result.fields.status", scope: "decidim.accountability") ) %>
+ </th>
+ <th>
+ <%= sort_link(query, :progress, t("models.result.fields.progress", scope: "decidim.accountability") ) %>
+ </th>
+ <th>
+ <%= sort_link(query, :created_at, t("models.result.fields.created_at", scope: "decidim.accountability") ) %>
+ </th>
<th class="actions"><%= t("actions.title", scope: "decidim.accountability") %></th>
</tr>
</thead>
<tbody>
<% results.each do |result| %>
<tr data-id="<%= result.id %>">
<td>
+ <%= result.id %><br>
+ </td>
+ <td>
<%= link_to translated_attribute(result.title), results_path(parent_id: result.id) %><br>
</td>
+ <td>
+ <% if result.category %>
+ <%= translated_attribute result.category.name %>
+ <% end %>
+ </td>
<%= td_resource_scope_for(result.scope) %>
+ <td>
+ <% if result.status %>
+ <%= translated_attribute result.status.name %>
+ <% end %>
+ </td>
+ <td>
+ <%= result.progress&.to_i %>
+ </td>
+ <td>
+ <%= l result.created_at, format: :decidim_short %>
+ </td>
+
<td class="table-list__actions">
<%= icon_link_to "eye", resource_locator(result).path, t("actions.preview", scope: "decidim.accountability"), class: "action-icon--preview", target: :blank %>
<% if allowed_to? :update, :result, result: result %>
<%= icon_link_to "plus", results_path(parent_id: result.id), t("actions.new", scope: "decidim.accountability", name: t("models.result.name", scope: "decidim.accountability.admin")), class: "action-icon--plus" %>
@@ -40,9 +82,17 @@
<%= icon_link_to "clock", result_timeline_entries_path(result), t("actions.timeline_entries", scope: "decidim.accountability"), class: "action-icon--clock" %>
<% end %>
<% if allowed_to? :update, :result, result: result %>
<%= icon_link_to "pencil", edit_result_path(result), t("actions.edit", scope: "decidim.accountability"), class: "action-icon--edit" %>
+ <% end %>
+
+ <% if allowed_to? :update, :result, result: result %>
+ <%= icon_link_to "folder", result_attachment_collections_path(result), t("actions.attachment_collections", scope: "decidim.accountability"), class: "action-icon--attachment_collections" %>
+ <% end %>
+
+ <% if allowed_to? :update, :result, result: result %>
+ <%= icon_link_to "paperclip", result_attachments_path(result), t("actions.attachments", scope: "decidim.accountability"), class: "action-icon--attachments" %>
<% end %>
<% if allowed_to? :destroy, :result, result: result %>
<%= icon_link_to "circle-x", result_path(result), t("actions.destroy", scope: "decidim.accountability"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.accountability", name: t("models.result.name", scope: "decidim.accountability.admin")) } %>
<% end %>