Files
nairobi/app/views/admin/dashboard/actions/_form.html.erb
Javi Martín 6fa67b5e53 Use active record translations for labels
This way we can simplify the way we generate form fields. In some cases,
we also use the human attribute in table headers, which IMHO makes
sense.

I haven't moved all of them: for example, sometimes a label is
different depending on whether it's shown to administrators, valuators,
or users. And I haven't touched the ones related to devise, since I
wasn't sure about possible side effects.

Note I've also removed placeholders when they had the same text as their
labels, since they weren't helpful. On the contrary, the added redundant
text to the form, potentially distracting users.
2019-10-07 01:56:23 +02:00

82 lines
2.3 KiB
Plaintext

<%= render "shared/errors" %>
<div class="row expanded">
<div class="small-12 medium-4 column">
<%= f.label :action_type %>
<% ::Dashboard::Action.action_types.keys.each do |action_type_value| %>
<span class="margin-right">
<%= f.radio_button :action_type, action_type_value,
data: { toggle: "request_to_administrators short_description" } %>
</span>
<% end %>
</div>
<div class="small-12 column margin-top">
<%= f.check_box :active %>
</div>
<div id="request_to_administrators"
class="small-12 column margin-bottom <%= css_for_resource(@dashboard_action.action_type) %>"
data-toggler=".hide">
<%= f.check_box :request_to_administrators %>
</div>
</div>
<div class="row expanded">
<div class="small-12 column">
<%= f.text_field :title %>
<div id="short_description" class="hide">
<%= f.text_field :short_description %>
</div>
<div class="ckeditor">
<%= f.cktext_area :description, ckeditor: { language: I18n.locale } %>
</div>
</div>
</div>
<div class="row expanded margin-top">
<div class="small-12 column">
<%= f.check_box :published_proposal %>
<p class="help-text"><%= t("admin.dashboard.actions.form.published_proposal_help_text") %></p>
</div>
</div>
<div class="row expanded margin-top">
<div class="small-12 medium-4 column">
<%= f.number_field :day_offset, step: 1, min: 0,
hint: t("admin.dashboard.actions.form.help_text") %>
</div>
<div class="small-12 medium-4 column">
<%= f.number_field :required_supports, step: 1, min: 0,
hint: t("admin.dashboard.actions.form.help_text") %>
</div>
<div class="small-12 medium-4 column">
<%= f.number_field :order, step: 1, min: 0,
hint: t("admin.dashboard.actions.form.help_text") %>
</div>
</div>
<% if feature?(:allow_attached_documents) %>
<div class="documents small-12 column">
<hr>
<%= render "documents/nested_documents", documentable: dashboard_action, f: f %>
<hr>
</div>
<% end %>
<div class="links small-12 column">
<%= render "links/nested_links", linkable: dashboard_action, f: f %>
<hr>
</div>
<div class="row expanded">
<div class="small-12 medium-6 large-4 column">
<%= f.submit(class: "button expanded", value: t("admin.dashboard.actions.form.submit_button")) %>
</div>
</div>