Files
nairobi/app/components/admin/poll/questions/form_component.html.erb
Julian Herrero 8a26954bc5 Don't allow to modify questions for started polls
Adding, modifiying, and/or deleting questions for an already started
poll is far away from being democratic and can lead to unwanted side
effects like missing votes in the results or stats.

So, from now on, only modifiying questions will be possible only if
the poll has not started yet.
2022-09-20 17:50:35 +02:00

39 lines
1.1 KiB
Plaintext

<%= render "shared/globalize_locales", resource: question %>
<%= translatable_form_for(question, url: url) do |f| %>
<%= render "shared/errors", resource: question %>
<%= f.hidden_field :proposal_id %>
<div class="row">
<div class="small-12">
<% if question.poll.present? %>
<%= f.hidden_field :poll_id, value: question.poll.id %>
<% else %>
<div class="small-12 medium-6 large-4 column">
<%= f.select :poll_id,
options_for_select(select_options),
prompt: t("admin.questions.index.select_poll"),
hint: t("admin.questions.form.poll_help") %>
</div>
<% end %>
</div>
</div>
<div class="row">
<%= f.translatable_fields do |translations_form| %>
<div class="column">
<%= translations_form.text_field :title %>
</div>
<% end %>
</div>
<div class="row">
<div class="small-12 medium-4 large-2 margin-top column">
<%= f.submit(class: "button success expanded", value: t("shared.save")) %>
</div>
</div>
<% end %>