Set navbar options from before_action

This commit is contained in:
JC 2016-11-21 17:30:28 +01:00
parent e9eeb0b4ba
commit 3627a18420
3 changed files with 8 additions and 4 deletions

View file

@ -1,9 +1,9 @@
class Backoffice::DossiersController < Backoffice::DossiersListController class Backoffice::DossiersController < Backoffice::DossiersListController
before_action :set_layout_options
respond_to :html, :xlsx, :ods, :csv respond_to :html, :xlsx, :ods, :csv
def index def index
super super
@options = ["dossiers/download_dossiers"]
dossiers_list_facade.service.filter_procedure_reset! dossiers_list_facade.service.filter_procedure_reset!
end end
@ -131,6 +131,10 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
private private
def set_layout_options
@navbar_options = ["dossiers/download_dossiers"]
end
def create_dossier_facade dossier_id def create_dossier_facade dossier_id
@facade = DossierFacades.new dossier_id, current_gestionnaire.email @facade = DossierFacades.new dossier_id, current_gestionnaire.email

View file

@ -19,8 +19,8 @@
Start UP region ile de france (8 dossiers en cours) Start UP region ile de france (8 dossiers en cours)
%div.col-lg-3.col-md-3.options %div.col-lg-3.col-md-3.options
%div.row %div.row
- if @options - if @navbar_options
- @options.each do |option| - @navbar_options.each do |option|
%div.col-lg-12.col-md-12 %div.col-lg-12.col-md-12
= render partial: option = render partial: option
%div.col-lg-1.col-md-1.log-options %div.col-lg-1.col-md-1.log-options