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

@@ -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
@@ -147,6 +148,10 @@ module Budgets
TagCloud.new(Budget::Investment, params[:search])
end
def set_view
@view = (params[:view] == "minimal") ? "minimal" : "default"
end
def investments
if @current_order == 'random'
@investments.apply_filters_and_search(@budget, params, @current_filter)

View File

@@ -5,6 +5,7 @@ class DebatesController < ApplicationController
before_action :parse_tag_filter, only: :index
before_action :authenticate_user!, except: [:index, :show, :map]
before_action :set_view, only: :index
feature_flag :debates
@@ -52,4 +53,8 @@ class DebatesController < ApplicationController
Debate
end
def set_view
@view = (params[:view] == "minimal") ? "minimal" : "default"
end
end

View File

@@ -8,6 +8,7 @@ class ProposalsController < ApplicationController
before_action :load_geozones, only: [:edit, :map, :summary]
before_action :authenticate_user!, except: [:index, :show, :map, :summary]
before_action :destroy_map_location_association, only: :update
before_action :set_view, only: :index
feature_flag :proposals
@@ -127,6 +128,10 @@ class ProposalsController < ApplicationController
end
end
def set_view
@view = (params[:view] == "minimal") ? "minimal" : "default"
end
def load_successful_proposals
@proposal_successful_exists = Proposal.successful.exists?
end