Adds missing content to budget investments mode view
This feature was already on Madrid fork and missing on backport
This commit is contained in:
@@ -16,6 +16,7 @@ module Budgets
|
||||
before_action :set_random_seed, only: :index
|
||||
before_action :load_categories, only: [:index, :new, :create]
|
||||
before_action :set_default_budget_filter, only: :index
|
||||
before_action :set_view, only: :index
|
||||
|
||||
skip_authorization_check only: :json_data
|
||||
|
||||
|
||||
@@ -8,4 +8,23 @@ module BudgetInvestmentsHelper
|
||||
def budget_investments_advanced_filters(params)
|
||||
params.map { |af| t("admin.budget_investments.index.filters.#{af}") }.join(', ')
|
||||
end
|
||||
|
||||
def investments_minimal_view_path
|
||||
budget_investments_path(id: @heading.group.to_param,
|
||||
heading_id: @heading.to_param,
|
||||
filter: @current_filter,
|
||||
view: investments_secondary_view)
|
||||
end
|
||||
|
||||
def investments_default_view?
|
||||
@view == "default"
|
||||
end
|
||||
|
||||
def investments_current_view
|
||||
@view
|
||||
end
|
||||
|
||||
def investments_secondary_view
|
||||
investments_current_view == "default" ? "minimal" : "default"
|
||||
end
|
||||
end
|
||||
|
||||
13
app/views/budgets/investments/_investment_minimal.html.erb
Normal file
13
app/views/budgets/investments/_investment_minimal.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<div id="<%= dom_id(investment) %>" class="budget-investment minimal clear">
|
||||
<div class="panel">
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<div class="budget-investment-content">
|
||||
<% cache [locale_and_user_status(investment), 'index_minimal', investment, investment.author] do %>
|
||||
<h3><%= link_to investment.title, namespaced_budget_investment_path(investment) %></h3>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -70,20 +70,12 @@
|
||||
ballot: @ballot
|
||||
} %>
|
||||
<% end %>
|
||||
|
||||
<%= render "banners" if @budget.selecting? || @budget.balloting? %>
|
||||
<%= paginate @investments %>
|
||||
|
||||
<% else %>
|
||||
|
||||
<% @investments.each do |investment| %>
|
||||
<%= render partial: '/budgets/investments/investment_minimal',
|
||||
locals: { investment: investment } %>
|
||||
<% end %>
|
||||
|
||||
<%= render "banners" if @budget.selecting? || @budget.balloting? %>
|
||||
<%= paginate @investments %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<%= paginate @investments %>
|
||||
|
||||
Reference in New Issue
Block a user