views: extract partial for the 'Avis' tab

This commit is contained in:
Pierre de La Morinerie 2021-06-29 11:37:48 +02:00
parent aecb591e7c
commit 4422d989a6
2 changed files with 7 additions and 10 deletions

View file

@ -25,11 +25,7 @@
%li
= active_link_to "Démarches", instructeur_procedures_path, active: ['dossiers','procedures'].include?(controller_name), class: 'tab-link'
- if current_instructeur.user.expert && current_expert.avis_summary[:total] > 0
%li
= active_link_to expert_all_avis_path, active: controller_name == 'avis', class: 'tab-link' do
Avis
- if current_expert.avis_summary[:unanswered] > 0
%span.badge.warning= current_expert.avis_summary[:unanswered]
= render partial: 'layouts/header/avis_tab', locals: { current_expert: current_expert }
- if nav_bar_profile == :expert && expert_signed_in?
%ul.header-tabs
@ -38,11 +34,7 @@
= active_link_to "Démarches", instructeur_procedures_path, active: ['dossiers','procedures'].include?(controller_name), class: 'tab-link'
- if current_expert.avis_summary[:total] > 0
%li
= active_link_to expert_all_avis_path, active: controller_name == 'avis', class: 'tab-link' do
Avis
- if current_expert.avis_summary[:unanswered] > 0
%span.badge.warning= current_expert.avis_summary[:unanswered]
= render partial: 'layouts/header/avis_tab', locals: { current_expert: current_expert }
- if nav_bar_profile == :user
%ul.header-tabs

View file

@ -0,0 +1,5 @@
%li
= active_link_to expert_all_avis_path, active: controller_name == 'avis', class: 'tab-link' do
Avis
- if current_expert.avis_summary[:unanswered] > 0
%span.badge.warning= current_expert.avis_summary[:unanswered]