feat(profile): keep procedure id context between admin & instructeur profile
This commit is contained in:
parent
e459f68ddb
commit
c541ed7c93
3 changed files with 38 additions and 2 deletions
|
@ -21,4 +21,22 @@ class AccountDropdownComponent < ViewComponent::Base
|
|||
def show_profile_badge?
|
||||
nav_bar_profile != :guest
|
||||
end
|
||||
|
||||
def instructeur_path
|
||||
if controller_name == "procedures" && params[:id].present?
|
||||
instructeur_procedure_path(params[:id])
|
||||
elsif params[:procedure_id].present?
|
||||
instructeur_procedure_path(params[:procedure_id])
|
||||
else
|
||||
instructeur_procedures_path
|
||||
end
|
||||
end
|
||||
|
||||
def admin_path
|
||||
if params[:procedure_id].present?
|
||||
admin_procedure_path(params[:procedure_id])
|
||||
else
|
||||
admin_procedures_path
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
= t('.go_user')
|
||||
- if instructeur_signed_in? && nav_bar_profile != :instructeur
|
||||
%li
|
||||
= link_to instructeur_procedures_path, class: "fr-nav__link" do
|
||||
= link_to instructeur_path, class: "fr-nav__link" do
|
||||
%span.fr-icon-refresh-line.fr-icon--sm
|
||||
= t('.go_instructor')
|
||||
- if expert_signed_in? && nav_bar_profile != :expert
|
||||
|
@ -33,7 +33,7 @@
|
|||
= t('.go_expert')
|
||||
- if administrateur_signed_in? && nav_bar_profile != :administrateur
|
||||
%li
|
||||
= link_to admin_procedures_path, class: "fr-nav__link" do
|
||||
= link_to admin_path, class: "fr-nav__link" do
|
||||
%span.fr-icon-refresh-line.fr-icon--sm
|
||||
= t('.go_admin')
|
||||
- if gestionnaire_signed_in? && nav_bar_profile != :gestionnaire
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue