Adds fields to admin/spendingproposals/edit view & controller
This commit is contained in:
@@ -2,43 +2,71 @@
|
||||
<span class="icon-angle-left"></span> <%= t("admin.spending_proposals.show.back") %>
|
||||
<% end %>
|
||||
|
||||
<%= render 'written_by_author' %>
|
||||
|
||||
<h2 id="form"><%= t("admin.spending_proposals.edit.classification") %></h2>
|
||||
|
||||
<%= form_for @spending_proposal,
|
||||
url: admin_spending_proposal_path(@spending_proposal) do |f| %>
|
||||
|
||||
<% SpendingProposal.filter_params(params).each do |filter_name, filter_value| %>
|
||||
<%= hidden_field_tag filter_name, filter_value %>
|
||||
<%= hidden_field_tag filter_name, filter_value %>
|
||||
<% end %>
|
||||
|
||||
<%= f.select(:administrator_id,
|
||||
@admins.collect{ |a| [a.name_and_email, a.id ] },
|
||||
{ include_blank: t("admin.spending_proposals.edit.undefined") },
|
||||
class: "small-12 medium-6") %>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= f.text_field :title, maxlength: SpendingProposal.title_max_length %>
|
||||
</div>
|
||||
|
||||
<%= f.label :tag_list, t("admin.spending_proposals.edit.tags") %>
|
||||
<div class="tags">
|
||||
<% @tags.each do |tag| %>
|
||||
<a class="js-add-tag-link"><%= tag.name %></a>
|
||||
<% end %>
|
||||
<div class="ckeditor small-12 column">
|
||||
<%= f.cktext_area :description, maxlength: SpendingProposal.description_max_length, ckeditor: { language: I18n.locale } %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.text_field :external_url %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.select :geozone_id, geozone_select_options, include_blank: t("geozones.none") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.text_field :association_name, placeholder: t("spending_proposals.form.association_name") %>
|
||||
</div>
|
||||
</div>
|
||||
<%= f.text_field :tag_list, value: @spending_proposal.tag_list.to_s,
|
||||
label: false,
|
||||
placeholder: t("admin.spending_proposals.edit.tags_placeholder"),
|
||||
class: 'js-tag-list' %>
|
||||
|
||||
<%= f.label :valuator_ids, t("admin.spending_proposals.edit.assigned_valuators") %>
|
||||
<h2 id="classification"><%= t("admin.spending_proposals.edit.classification") %></h2>
|
||||
|
||||
<%= f.collection_check_boxes :valuator_ids, @valuators, :id, :email do |b| %>
|
||||
<%= b.label(title: valuator_label(b.object)) { b.check_box + truncate(b.object.description_or_email, length: 60) } %>
|
||||
<% end %>
|
||||
<div class="row">
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.select(:administrator_id,
|
||||
@admins.collect{ |a| [a.name_and_email, a.id ] },
|
||||
{ include_blank: t("admin.spending_proposals.edit.undefined") }) %>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :tag_list, t("admin.spending_proposals.edit.tags") %>
|
||||
<div class="tags">
|
||||
<% @tags.each do |tag| %>
|
||||
<a class="js-add-tag-link"><%= tag.name %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= f.text_field :tag_list, value: @spending_proposal.tag_list.to_s,
|
||||
label: false,
|
||||
placeholder: t("admin.spending_proposals.edit.tags_placeholder"),
|
||||
class: 'js-tag-list' %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :valuator_ids, t("admin.spending_proposals.edit.assigned_valuators") %>
|
||||
|
||||
<%= f.collection_check_boxes :valuator_ids, @valuators, :id, :email do |b| %>
|
||||
<%= b.label(title: valuator_label(b.object)) { b.check_box + truncate(b.object.description_or_email, length: 60) } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="clear">
|
||||
<%= f.submit(class: "button", value: t("admin.spending_proposals.edit.submit_button")) %>
|
||||
</p>
|
||||
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
|
||||
Reference in New Issue
Block a user