Order a Gestionnaire’s procedures

First display the procédures publiées, sorted
by publication date, and then the procédures
archivées, sorted by archiving date
This commit is contained in:
gregoirenovel 2017-07-18 15:18:10 +02:00 committed by Mathieu Magnin
parent 7ff7710803
commit 091fa1d099

View file

@ -5,7 +5,7 @@ module NewGestionnaire
before_action :ensure_ownership!, except: [:index] before_action :ensure_ownership!, except: [:index]
def index def index
@procedures = current_gestionnaire.procedures @procedures = current_gestionnaire.procedures.order(archived_at: :desc, published_at: :desc)
dossiers = current_gestionnaire.dossiers.state_not_brouillon dossiers = current_gestionnaire.dossiers.state_not_brouillon
@dossiers_count_per_procedure = dossiers.all_state.group(:procedure_id).reorder(nil).count @dossiers_count_per_procedure = dossiers.all_state.group(:procedure_id).reorder(nil).count