Adds view mode on proposals

This commit is contained in:
decabeza
2018-03-23 20:02:50 +01:00
parent 2f5561bf03
commit bdedb023d1
5 changed files with 94 additions and 0 deletions

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