Sha256: f3f93ff1e750df02c900e4a5442d880cd2cc3b160fe9c25352de302da2075d9f

Contents?: true

Size: 1.95 KB

Versions: 3

Compression:

Stored size: 1.95 KB

Contents

<% add_decidim_page_title(t("areas", scope: "decidim.admin.titles")) %>
<div class="card" id="areas">
  <div class="item_show__header">
    <h2 class="item_show__header-title">
      <%= t "decidim.admin.titles.areas" %>
      <% if allowed_to? :create, :area %>
        <%= link_to t("actions.add", scope: "decidim.admin"), new_area_path, class: "button button__sm button__secondary new" %>
      <% end %>
    </h2>
  </div>
  <% if @areas.any? %>
    <div class="table-scroll">
      <table class="table-list">
      <thead>
        <tr>
          <th><%= t("models.area.fields.name", scope: "decidim.admin") %></th>
          <th><%= t("models.area.fields.area_type", scope: "decidim.admin") %></th>
          <th></th>
        </tr>
      </thead>
      <tbody>
        <% @areas.each do |area| %>
          <tr>
            <td>
              <% if allowed_to? :update, :area, area: area %>
                <%= link_to translated_attribute(area.name), [:edit, area] %>
              <% else %>
                <%= translated_attribute(area.name) %>
              <% end %>
            </td>
            <td>
              <%= area.area_type ? translated_attribute(area.area_type.name) : "-" %>
            </td>
            <td class="table-list__actions">
              <% if allowed_to? :update, :area, area: area %>
                <%= icon_link_to "pencil-line", [:edit, area], t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit", method: :get, data: {} %>
              <% end %>

              <% if allowed_to? :destroy, :area, area: area %>
                <%= icon_link_to "delete-bin-line", area, 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>
  <% else %>
    <p><%= t("decidim.admin.areas.no_areas") %></p>
  <% end %>
</div>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
decidim-admin-0.28.0 app/views/decidim/admin/areas/index.html.erb
decidim-admin-0.28.0.rc5 app/views/decidim/admin/areas/index.html.erb
decidim-admin-0.28.0.rc4 app/views/decidim/admin/areas/index.html.erb