<% if allowed_to? :create, :static_page %>

<% if topic %> <%= translated_attribute(topic.title) %> <%= link_to t(".destroy"), [topic], class: "button tiny button--title destroy", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %> <%= link_to t(".edit"), [:edit, topic], class: "button tiny button--title new" %> <% else %> <%= t(".without_topic") %> <% end %>

<% end %>
<% if pages.any? %> <% pages.each do |page| %> <% end %>
<%= t("models.static_page.fields.title", scope: "decidim.admin") %> <%= t("models.static_page.fields.created_at", scope: "decidim.admin") %> <%= t("last_notable_change", scope: "decidim.admin.static_pages.index") %>
<%= link_to translated_attribute(page.title), [:edit, page] %>
<%= l page.created_at, format: :short %> <% if allowed_to? :update_notable_changes, :static_page, static_page: page %> <%= @tos_version_formatted %> <% end %> <% if allowed_to? :update, :static_page, static_page: page %> <%= icon_link_to "pencil", [:edit, page], t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit" %> <% end %> <%= icon_link_to "eye", decidim.page_path(page), t("actions.view", scope: "decidim.admin.static_pages"), class: "action-icon--preview" %> <% if allowed_to? :destroy, :static_page, static_page: page %> <%= icon_link_to "circle-x", page, t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %> <% end %>
<% else %>

<%= t(".empty") %>

<% end %>