Merge pull request #2567 from consul/mode-view

Mode view
This commit is contained in:
Alberto García
2018-04-27 19:28:54 +02:00
committed by GitHub
29 changed files with 486 additions and 21 deletions

View File

@@ -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

View File

@@ -12,4 +12,20 @@ module DebatesHelper
end
end
def debates_minimal_view_path
debates_path(view: debates_secondary_view)
end
def debates_default_view?
@view == "default"
end
def debates_current_view
@view
end
def debates_secondary_view
debates_current_view == "default" ? "minimal" : "default"
end
end

View File

@@ -48,4 +48,20 @@ module ProposalsHelper
current_user && proposal.editable_by?(current_user)
end
def proposals_minimal_view_path
proposals_path(view: proposals_secondary_view)
end
def proposals_default_view?
@view == "default"
end
def proposals_current_view
@view
end
def proposals_secondary_view
proposals_current_view == "default" ? "minimal" : "default"
end
end