app/views/decidim/admin/attachments/index.html.erb in decidim-admin-0.0.6 vs app/views/decidim/admin/attachments/index.html.erb in decidim-admin-0.0.7
- old
+ new
@@ -1,37 +1,47 @@
-<section id="attachments">
- <h4><%= t(".attachments_title", scope: "decidim.admin") %></h4>
+<div class='card' id="attachments">
+ <div class="card-divider">
+ <h2 class="card-title">
+ <%= t(".attachments_title", scope: "decidim.admin") %>
+ <% if can? :create, authorization_object %>
+ <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.attachment.name", scope: "decidim.admin")), url_for(action: :new), class: 'button tiny button--title new' %>
+ <% end %>
+ </h2>
+ </div>
- <% if can? :create, authorization_object %>
- <div class="actions title">
- <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.attachment.name", scope: "decidim.admin")), url_for(action: :new), class: 'new' %>
- </div>
- <% end %>
+ <div class="card-section">
+ <% if attached_to.attachments.any? %>
+ <div class="table-scroll">
+ <table class="table-list">
+ <thead>
+ <tr>
+ <th><%= t("models.attachment.fields.title", scope: "decidim.admin") %></th>
+ <th><%= t("models.attachment.fields.content_type", scope: "decidim.admin") %></th>
+ <th class="actions"></th>
+ </tr>
+ </thead>
+ <tbody>
+ <% attached_to.attachments.each do |attachment| %>
+ <tr data-id="<%= attachment.id %>">
+ <td>
+ <%= link_to translated_attribute(attachment.title), edit_polymorphic_path([attached_to, attachment]) %><br />
+ </td>
+ <td>
+ <%= attachment.file_type %>
+ </td>
+ <td class="table-list__actions">
+ <% if can? :update, authorization_object %>
+ <%= icon_link_to "pencil", edit_polymorphic_path([attached_to, attachment]), t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit" %>
+ <% end %>
- <% if attached_to.attachments.any? %>
- <table class="stack">
- <thead>
- <tr>
- <th><%= t("models.attachment.fields.title", scope: "decidim.admin") %></th>
- <th><%= t("models.attachment.fields.content_type", scope: "decidim.admin") %></th>
- <th class="actions"><%= t("actions.title", scope: "decidim.admin") %></th>
- </tr>
- </thead>
- <tbody>
- <% attached_to.attachments.each do |attachment| %>
- <tr data-id="<%= attachment.id %>">
- <td>
- <%= link_to translated_attribute(attachment.title), polymorphic_path([attached_to, attachment]) %><br />
- </td>
- <td>
- <%= attachment.file_type %>
- </td>
- <td class="actions">
- <%= link_to t("actions.edit", scope: "decidim.admin"), edit_polymorphic_path([attached_to, attachment]) if can? :update, authorization_object %>
- <%= link_to t("actions.destroy", scope: "decidim.admin"), polymorphic_path([attached_to, attachment]), method: :delete, class: "small alert button", data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } if can? :destroy, authorization_object %>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- <% end %>
-</section>
+ <% if can? :destroy, authorization_object %>
+ <%= icon_link_to "circle-x", polymorphic_path([attached_to, attachment]), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ <% end %>
+ </div>
+</div>