%= decidim_form_for @form,
method: :patch,
url: consultation_path(current_consultation),
html: { class: "form edit_consultation" } do |f| %>
<%= render partial: "form", object: f %>
<%= f.submit t("consultations.edit.update", scope: "decidim.admin"), class: "button" %>
<% if allowed_to? :publish, :consultation, consultation: current_consultation %>
<% if current_consultation.published? %>
<%= link_to t("actions.unpublish", scope: "decidim.admin"),
consultation_publish_path(current_consultation),
method: :delete,
class: "button muted" %>
<% else %>
<%= link_to t("actions.publish", scope: "decidim.admin"),
consultation_publish_path(current_consultation),
method: :post,
class: "button hollow" %>
<% end %>
<% end %>
<% if allowed_to? :publish_results, :consultation, consultation: current_consultation %>
<%= link_to t("actions.publish_results", scope: "decidim.admin"),
consultation_publish_results_path(current_consultation),
method: :post,
class: "button hollow" %>
<% end %>
<% if allowed_to? :unpublish_results, :consultation, consultation: current_consultation %>
<%= link_to t("actions.unpublish_results", scope: "decidim.admin"),
consultation_publish_results_path(current_consultation),
method: :delete,
class: "button muted" %>
<% end %>
<% if allowed_to? :destroy, :consultation, consultation: current_consultation %>
<%= link_to t("decidim.admin.actions.destroy"),
current_consultation,
method: :delete,
class: "alert button",
data: { confirm: t("decidim.admin.actions.confirm_destroy") } %>
<% end %>
<% end %>