A cookie file keep the last navigation tab for user and gestionnaire

This commit is contained in:
Xavier J 2016-09-09 16:20:07 +02:00
parent c5035ca81e
commit 30acd9bb3e
3 changed files with 6 additions and 3 deletions

View file

@ -5,7 +5,8 @@ class Backoffice::Dossiers::ProcedureController < ApplicationController
before_action :authenticate_gestionnaire!
def show
smartlisting_dossier (params[:liste] || 'a_traiter')
cookies[:liste] = params[:liste] || cookies[:liste] || 'a_traiter'
smartlisting_dossier cookies[:liste]
render 'backoffice/dossiers/index'
rescue ActiveRecord::RecordNotFound

View file

@ -5,7 +5,8 @@ class Backoffice::DossiersController < ApplicationController
before_action :authenticate_gestionnaire!
def index
smartlisting_dossier (params[:liste] || 'a_traiter')
cookies[:liste] = params[:liste] || cookies[:liste] || 'a_traiter'
smartlisting_dossier (cookies[:liste])
end
def show

View file

@ -10,7 +10,8 @@ class Users::DossiersController < UsersController
end
def index
@dossiers_list_facade = DossiersListFacades.new current_user, (params[:liste] || 'a_traiter')
cookies[:liste] = params[:liste] || cookies[:liste] || 'a_traiter'
@dossiers_list_facade = DossiersListFacades.new current_user, cookies[:liste]
@dossiers = smart_listing_create :dossiers,
@dossiers_list_facade.dossiers_to_display,