From 59e809f02965651130aa6584e9b7eb230d2e1319 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Thu, 6 Sep 2018 14:02:02 +0200 Subject: [PATCH] =?UTF-8?q?active=5Ftab=5Fitem=20=E2=86=92=20dynamic=5Ftab?= =?UTF-8?q?=5Fitem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/tabs_helper.rb | 2 +- app/views/new_gestionnaire/avis/_header.html.haml | 6 +++--- app/views/new_gestionnaire/dossiers/_header.html.haml | 10 +++++----- app/views/new_user/dossiers/show/_header.html.haml | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/helpers/tabs_helper.rb b/app/helpers/tabs_helper.rb index d85a5e197..de31d48c9 100644 --- a/app/helpers/tabs_helper.rb +++ b/app/helpers/tabs_helper.rb @@ -9,7 +9,7 @@ module TabsHelper } end - def active_tab_item(label, url, badge: nil, notification: false) + def dynamic_tab_item(label, url, badge: nil, notification: false) tab_item(label, url, active: current_page?(url), badge: badge, notification: notification) end end diff --git a/app/views/new_gestionnaire/avis/_header.html.haml b/app/views/new_gestionnaire/avis/_header.html.haml index fb0ed039b..a44f30158 100644 --- a/app/views/new_gestionnaire/avis/_header.html.haml +++ b/app/views/new_gestionnaire/avis/_header.html.haml @@ -5,6 +5,6 @@ %li= "#{dossier.procedure.libelle}, dossier nº #{dossier.id}" %ul.tabs - = active_tab_item('Demande', gestionnaire_avis_path(avis)) - = active_tab_item('Avis', instruction_gestionnaire_avis_path(avis), notification: avis.answer.blank?) - = active_tab_item('Messagerie', messagerie_gestionnaire_avis_path(avis)) + = dynamic_tab_item('Demande', gestionnaire_avis_path(avis)) + = dynamic_tab_item('Avis', instruction_gestionnaire_avis_path(avis), notification: avis.answer.blank?) + = dynamic_tab_item('Messagerie', messagerie_gestionnaire_avis_path(avis)) diff --git a/app/views/new_gestionnaire/dossiers/_header.html.haml b/app/views/new_gestionnaire/dossiers/_header.html.haml index 2b568b77c..8526eda4d 100644 --- a/app/views/new_gestionnaire/dossiers/_header.html.haml +++ b/app/views/new_gestionnaire/dossiers/_header.html.haml @@ -21,23 +21,23 @@ %ul.tabs - notifications_summary = current_gestionnaire.notifications_for_dossier(dossier) - = active_tab_item('Demande', + = dynamic_tab_item('Demande', gestionnaire_dossier_path(dossier.procedure, dossier), notification: notifications_summary[:demande]) - = active_tab_item('Annotations privées', + = dynamic_tab_item('Annotations privées', annotations_privees_gestionnaire_dossier_path(dossier.procedure, dossier), notification: notifications_summary[:annotations_privees]) - = active_tab_item('Avis externes', + = dynamic_tab_item('Avis externes', avis_gestionnaire_dossier_path(dossier.procedure, dossier), notification: notifications_summary[:avis]) - = active_tab_item('Messagerie', + = dynamic_tab_item('Messagerie', messagerie_gestionnaire_dossier_path(dossier.procedure, dossier), notification: notifications_summary[:messagerie]) - = active_tab_item('Personnes impliquées', + = dynamic_tab_item('Personnes impliquées', personnes_impliquees_gestionnaire_dossier_path(dossier.procedure, dossier)) .container diff --git a/app/views/new_user/dossiers/show/_header.html.haml b/app/views/new_user/dossiers/show/_header.html.haml index c5144e0be..c71437eac 100644 --- a/app/views/new_user/dossiers/show/_header.html.haml +++ b/app/views/new_user/dossiers/show/_header.html.haml @@ -8,6 +8,6 @@ %h2 Dossier nº #{dossier.id} %ul.tabs - = active_tab_item('Résumé', dossier_path(dossier)) - = active_tab_item('Demande', demande_dossier_path(dossier)) - = active_tab_item('Messagerie', messagerie_dossier_path(dossier)) + = dynamic_tab_item('Résumé', dossier_path(dossier)) + = dynamic_tab_item('Demande', demande_dossier_path(dossier)) + = dynamic_tab_item('Messagerie', messagerie_dossier_path(dossier))