%= link_to admin_budget_budget_investment_path(@budget, @investment, Budget::Investment.filter_params(params).to_h), class: "back" do %>
<%= t("shared.back") %>
<% end %>
<%= form_for @investment,
url: admin_budget_budget_investment_path(@budget, @investment) do |f| %>
<% Budget::Investment.filter_params(params).to_h.each do |filter_name, filter_value| %>
<%= hidden_field_tag filter_name, filter_value %>
<% end %>
<%= f.text_field :title,
maxlength: Budget::Investment.title_max_length %>
<%= f.cktext_area :description,
maxlength: Budget::Investment.description_max_length,
ckeditor: { language: I18n.locale } %>
<%= f.label :tag_list, t("admin.budget_investments.edit.user_tags") %>
<%= f.text_field :tag_list,
value: @investment.tag_list.sort.join(","),
label: false %>
<%= f.text_field :external_url %>
<%= f.select :heading_id, budget_heading_select_options(@budget), include_blank: t("admin.budget_investments.edit.select_heading") %>
<%= t("admin.budget_investments.edit.classification") %>
<%= f.select(:administrator_id,
@admins.collect{ |a| [a.description_or_name_and_email, a.id ] },
{ include_blank: t("admin.budget_investments.edit.undefined") }) %>
<%= f.label :valuation_tag_list, t("admin.budget_investments.edit.tags") %>
<%= f.text_field :valuation_tag_list,
value: @investment.valuation_tag_list.sort.join(","),
label: false,
placeholder: t("admin.budget_investments.edit.tags_placeholder"),
class: "js-tag-list" %>
<%= f.label :valuator_ids, t("admin.budget_investments.edit.user_groups") %>
<%= f.collection_check_boxes :valuator_group_ids, @valuator_groups, :id, :name do |group| %>
- <%= group.label(title: group.object.name) { group.check_box + truncate(group.object.name, length: 60) } %>
<% end %>
<%= f.label :valuator_ids, t("admin.budget_investments.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 %>
<%= f.label :tracker_ids, t("admin.budget_investments.edit.assigned_trackers") %>
<%= f.collection_check_boxes :tracker_ids, @trackers, :id, :email do |b| %>
- <%= b.label(title: tracker_label(b.object)) { b.check_box + truncate(b.object.description_or_email, length: 60) } %>
<% end %>
<% if @investment.incompatible? || @investment.winner? %>
<%= t("admin.budget_investments.edit.compatibility") %>
<%= f.label :incompatible do %>
<%= f.check_box :incompatible, title: t("admin.budget_investments.edit.compatibility"), label: false %>
<%= t("admin.budget_investments.edit.mark_as_incompatible") %>
<% end %>
<% end %>
<%= t("admin.budget_investments.edit.selection") %>
<%= f.label :selected do %>
<%= f.check_box :selected, title: t("admin.budget_investments.edit.selection"), label: false %>
<%= t("admin.budget_investments.edit.mark_as_selected") %>
<% end %>
<%= f.text_field :milestone_tag_list,
value: @investment.milestone_tag_list.sort.join(", "),
label: t("admin.budget_investments.edit.milestone_tags") %>
<%= f.submit(class: "button", value: t("admin.budget_investments.edit.submit_button")) %>
<% end %>