adds index of investments with filters to admin
This commit is contained in:
76
app/views/admin/budget_investments/index.html.erb
Normal file
76
app/views/admin/budget_investments/index.html.erb
Normal file
@@ -0,0 +1,76 @@
|
||||
<h2 class="inline-block"><%= @budget.name %> - <%= t("admin.budget_investments.index.title") %></h2>
|
||||
|
||||
<div class="row margin">
|
||||
<%= form_tag admin_budget_budget_investments_path(budget: @budget), method: :get, enforce_utf8: false do %>
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= select_tag :administrator_id,
|
||||
options_for_select(admin_select_options, params[:administrator_id]),
|
||||
{ prompt: t("admin.budget_investments.index.administrator_filter_all"),
|
||||
label: false,
|
||||
class: "js-submit-on-change" } %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= select_tag :valuator_id,
|
||||
options_for_select(valuator_select_options, params[:valuator_id]),
|
||||
{ prompt: t("admin.budget_investments.index.valuator_filter_all"),
|
||||
label: false,
|
||||
class: "js-submit-on-change" } %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= select_tag :group_id,
|
||||
options_for_select(budget_group_select_options(@budget.groups), params[:group_id]),
|
||||
{ prompt: t("admin.budget_investments.index.group_filter_all"),
|
||||
label: false,
|
||||
class: "js-submit-on-change" } %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= select_tag :tag_name,
|
||||
options_for_select(spending_proposal_tags_select_options, params[:tag_name]),
|
||||
{ prompt: t("admin.budget_investments.index.tags_filter_all"),
|
||||
label: false,
|
||||
class: "js-submit-on-change" } %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= render 'shared/filter_subnav', i18n_namespace: "admin.budget_investments.index" %>
|
||||
|
||||
<h3><%= page_entries_info @investments %></h3>
|
||||
|
||||
<table>
|
||||
<% @investments.each do |investment| %>
|
||||
<tr id="<%= dom_id(investment) %>" class="budget_investment">
|
||||
<td>
|
||||
<strong><%= investment.id %></strong>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to investment.title, admin_budget_budget_investment_path(budget_id: @budget.id, id: investment.id), Budget::Investment.filter_params(params) %>
|
||||
</td>
|
||||
<td class="small">
|
||||
<% if investment.administrator.present? %>
|
||||
<span title="<%= t('admin.budget_investments.index.assigned_admin') %>"><%= investment.administrator.name %></span>
|
||||
<% else %>
|
||||
<%= t("admin.budget_investments.index.no_admin_assigned") %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="small">
|
||||
<% if investment.valuators.size == 0 %>
|
||||
<%= t("admin.budget_investments.index.no_valuators_assigned") %>
|
||||
<% else %>
|
||||
<%= investment.valuators.collect(&:description_or_name).join(', ') %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="small">
|
||||
<%= investment.group.name %>
|
||||
</td>
|
||||
<td class="small">
|
||||
<%= t("admin.budget_investments.index.feasibility.#{investment.feasibility}", price: investment.price) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<%= paginate @investments %>
|
||||
1
app/views/admin/budget_investments/show.html.erb
Normal file
1
app/views/admin/budget_investments/show.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= @investment.title %>
|
||||
@@ -13,11 +13,14 @@
|
||||
<% @budgets.each do |budget| %>
|
||||
<tr id="<%= dom_id(budget) %>" class="budget">
|
||||
<td>
|
||||
<%= link_to budget.name, admin_budget_path(budget) %>
|
||||
<%= link_to budget.name, admin_budget_budget_investments_path(budget_id: budget.id) %>
|
||||
</td>
|
||||
<td class="small">
|
||||
<%= t("budget.phase.#{budget.phase}") %>
|
||||
</td>
|
||||
<td class="small">
|
||||
<%= link_to t("admin.budgets.index.info_link"), admin_budget_path(budget) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user