Files
grecia/app/views/admin/legislation/proposals/_form.html.erb
Javi Martín 4a19bb6b77 Simplify generating fields with hints
We were already using this code in translatable forms. Using it on every
form means we can reduce the code we need to generate a field with a
hint.
2019-10-06 18:03:38 +02:00

31 lines
1.2 KiB
Plaintext

<%= form_for [:admin, @process], html: { data: { watch_changes: true } } do |f| %>
<% if @process.errors.any? %>
<div id="error_explanation" data-alert class="callout alert" data-closable>
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
<span aria-hidden="true">&times;</span>
</button>
<strong>
<%= @process.errors.count %>
<%= t("admin.legislation.processes.errors.form.error", count: @process.errors.count) %>
</strong>
</div>
<% end %>
<div class="small-12 medium-8 column">
<%= f.text_field :custom_list, value: @process.tag_list_on(:customs).to_s,
label: t("admin.legislation.proposals.form.custom_categories"),
hint: t("admin.legislation.proposals.form.custom_categories_description"),
placeholder: t("admin.legislation.proposals.form.custom_categories_placeholder"),
class: "js-tag-list",
aria: { describedby: "tag-list-help-text" } %>
</div>
<div class="small-12 medium-3 column clear end">
<%= f.submit(class: "button expanded", value: t("admin.legislation.processes.#{admin_submit_action(@process)}.submit_button")) %>
</div>
<% end %>