added csv download link to budget_investments (issue 1625)

This commit is contained in:
Raúl Fuentes
2017-11-21 13:21:56 +01:00
parent 27ce8c9b1b
commit 95c1aa43e8
3 changed files with 69 additions and 19 deletions

View File

@@ -1,4 +1,7 @@
<h3><%= page_entries_info @investments %></h3>
<div class='relative'>
<%= link_to 'download current selecction',admin_budget_budget_investments_path(csv_params), class: 'advanced-search small' %>
<h3><%= page_entries_info @investments %></h3>
</div>
<table>
<thead>
@@ -55,24 +58,9 @@
<%= investment.valuation_finished? ? t('shared.yes'): t('shared.no') %>
</td>
<td class="small">
<% if investment.selected? %>
<%= link_to_unless investment.budget.finished?, t("admin.budget_investments.index.selected"),
toggle_selection_admin_budget_budget_investment_path(@budget,
investment,
filter: params[:filter],
page: params[:page]),
method: :patch,
remote: true,
class: "button small expanded" %>
<% elsif investment.feasible? && investment.valuation_finished? %>
<%= link_to_unless investment.budget.finished?, t("admin.budget_investments.index.select"),
toggle_selection_admin_budget_budget_investment_path(@budget,
investment,
filter: params[:filter],
page: params[:page]),
method: :patch,
remote: true,
class: "button small hollow expanded" %>
<%= options = investment_selected_link_options(investment) %>
<%= link_to toggle_selection_admin_budget_budget_investment_path(@budget, investment, filter: params[:filter], page: params[:page]), method: :patch, remote: true, class: options[:link_class] do %>
<%= options[:text] %>
<% end %>
</td>
<% if params[:filter] == 'selected' %>