Files
grecia/app/views/legislation/proposals/_form.html.erb
Javi Martín 8d9cb4d8e3 Simplify generating checkboxes in forms
Using the block syntax to generate the label with a <span> tag inside
isn't necessary after upgrading foundation_rails_helpers. Before the
upgrade, we couldn't do so because the <span> tag was escaped.
2019-10-06 19:32:04 +02:00

86 lines
3.1 KiB
Plaintext

<%= form_for(@proposal, url: form_url) do |f| %>
<%= render "shared/errors", resource: @proposal %>
<%= f.hidden_field(:legislation_process_id, :value => params[:process_id]) %>
<div class="row">
<div class="small-12 column">
<%= f.text_field :title,
maxlength: Legislation::Proposal.title_max_length,
placeholder: t("proposals.form.proposal_title"),
label: t("proposals.form.proposal_title") %>
</div>
<%= f.invisible_captcha :subtitle %>
<div class="small-12 column">
<%= f.text_area :summary, rows: 4, maxlength: 200,
label: t("proposals.form.proposal_summary"),
placeholder: t("proposals.form.proposal_summary"),
hint: t("proposals.form.proposal_summary_note") %>
</div>
<div class="ckeditor small-12 column">
<%= f.cktext_area :description,
maxlength: Legislation::Proposal.description_max_length,
ckeditor: { language: I18n.locale },
label: t("proposals.form.proposal_text") %>
</div>
<div class="small-12 column">
<%= f.text_field :video_url,
placeholder: t("proposals.form.proposal_video_url"),
label: t("proposals.form.proposal_video_url"),
hint: t("proposals.form.proposal_video_url_note") %>
</div>
<% if feature?(:allow_images) %>
<div class="images small-12 column">
<%= render "images/nested_image", imageable: @proposal, f: f %>
</div>
<% end %>
<div class="documents small-12 column" data-max-documents="<%= Legislation::Proposal.max_documents_allowed %>">
<%= render "documents/nested_documents", documentable: @proposal, f: f %>
</div>
<div class="small-12 medium-6 column">
<%= f.select :geozone_id, geozone_select_options,
include_blank: t("geozones.none"), label: t("proposals.form.geozone") %>
</div>
<div class="small-12 column">
<%= f.label :tag_list, t("legislation.proposals.form.tags_label") %>
<p class="help-text" id="tag-list-help-text"><%= t("proposals.form.tags_instructions") %></p>
<div id="category_tags" class="tags">
<% @process.tag_list_on(:customs).each do |tag| %>
<a class="js-add-tag-link"><%= tag %></a>
<% end %>
</div>
<br>
<%= f.text_field :tag_list, value: @proposal.tag_list.to_s,
label: false,
placeholder: t("proposals.form.tags_placeholder"),
class: "js-tag-list",
aria: { describedby: "tag-list-help-text" } %>
</div>
<div class="small-12 column">
<% if @proposal.new_record? %>
<%= f.check_box :terms_of_service,
title: t("form.accept_terms_title"),
label: t("form.accept_terms",
policy: link_to(t("form.policy"), "/privacy", target: "blank"),
conditions: link_to(t("form.conditions"), "/conditions", target: "blank")
).html_safe %>
<% end %>
</div>
<div class="actions small-12 column">
<%= f.submit(class: "button", value: t("proposals.#{action_name}.form.submit_button")) %>
</div>
</div>
<% end %>