<%= decidim_form_for @form,
method: :patch,
url: voting_path(@current_voting),
html: { class: "form form-defaults edit_voting" } do |f| %>
<%= render partial: "form", object: f %>
<%= f.submit t("votings.edit.update", scope: "decidim.votings.admin"), class: "button button__sm button__secondary", disabled: !allowed_to?(:update, :voting, voting: current_voting) %>
<% if allowed_to? :publish, :voting, voting: @current_voting %>
<% if @current_voting.published? %>
<%= link_to t("actions.unpublish", scope: "decidim.admin"), voting_publish_path(@current_voting), method: :delete, class: "button button__sm button__secondary" %>
<% else %>
<%= link_to t("actions.publish", scope: "decidim.admin"), voting_publish_path(@current_voting), method: :post, class: "button button__sm button__secondary hollow" %>
<% end %>
<% end %>
<% if allowed_to? :destroy, :voting, voting: @current_voting %>
<%= link_to t("votings.actions.destroy", scope: "decidim.votings.admin"),
@current_voting,
method: :delete,
class: "button button__sm button__secondary",
data: { confirm: t("votings.actions.confirm_destroy", scope: "decidim.votings.admin") } %>
<% end %>