fix fropdown navbar profile
This commit is contained in:
parent
97e4cf437a
commit
7b1b771b25
4 changed files with 29 additions and 18 deletions
|
@ -3,6 +3,10 @@ module Administrateurs
|
||||||
before_action :authenticate_administrateur!
|
before_action :authenticate_administrateur!
|
||||||
helper_method :administrateur_as_manager?
|
helper_method :administrateur_as_manager?
|
||||||
|
|
||||||
|
def nav_bar_profile
|
||||||
|
:administrateur
|
||||||
|
end
|
||||||
|
|
||||||
def retrieve_procedure
|
def retrieve_procedure
|
||||||
id = params[:procedure_id] || params[:id]
|
id = params[:procedure_id] || params[:id]
|
||||||
|
|
||||||
|
|
|
@ -1,43 +1,40 @@
|
||||||
%nav.fr-translate.fr-nav{ role: "navigation", "aria-label"=> t('menu_aria_label', scope: [:layouts]) }
|
%nav.fr-translate.fr-nav{ role: "navigation", "aria-label"=> t('menu_aria_label', scope: [:layouts]) }
|
||||||
.fr-nav__item
|
.fr-nav__item
|
||||||
%button.account-btn.fr-translate__btn.fr-btn{ "aria-controls" => "account", "aria-expanded" => "false", :title => t('my_account', scope: [:layouts]) }
|
%button.account-btn.fr-translate__btn.fr-btn{ "aria-controls" => "account", "aria-expanded" => "false", :title => t('my_account', scope: [:layouts]) }
|
||||||
= image_tag "icons/account-circle.svg", alt: t('my_account', scope: [:layouts]), width: 20, height: 20, loading: 'lazy'
|
|
||||||
|
|
||||||
= " #{current_email}"
|
= " #{current_email}"
|
||||||
#account.fr-collapse.fr-menu
|
#account.fr-collapse.fr-menu
|
||||||
%ul.fr-menu__list
|
%ul.fr-menu__list
|
||||||
- if super_admin_signed_in?
|
|
||||||
%li
|
|
||||||
= link_to manager_root_path, class: "fr-nav__link flex align-center" do
|
|
||||||
= image_tag "icons/super-admin.svg", alt: '',width: 20, height: 20, class: 'mr-1'
|
|
||||||
= t('go_superadmin', scope: [:layouts])
|
|
||||||
- if multiple_devise_profile_connect?
|
- if multiple_devise_profile_connect?
|
||||||
|
%li
|
||||||
|
= link_to "#", class: "fr-nav__link", "aria-current" => "true" do
|
||||||
|
= t('connected_as', profile: t("#{nav_bar_profile}"), scope: [:layouts])
|
||||||
|
|
||||||
- if user_signed_in? && nav_bar_profile != :user
|
- if user_signed_in? && nav_bar_profile != :user
|
||||||
%li
|
%li
|
||||||
= link_to dossiers_path, class: "fr-nav__link flex align-center" do
|
= link_to dossiers_path, class: "fr-nav__link" do
|
||||||
= image_tag "icons/switch-profile.svg", alt: '', width: 20, height: 20, class: 'mr-1'
|
|
||||||
= t('go_user', scope: [:layouts])
|
= t('go_user', scope: [:layouts])
|
||||||
- if instructeur_signed_in? && nav_bar_profile != :instructeur
|
- if instructeur_signed_in? && nav_bar_profile != :instructeur
|
||||||
%li
|
%li
|
||||||
= link_to instructeur_procedures_path, class: "fr-nav__link flex align-center" do
|
= link_to instructeur_procedures_path, class: "fr-nav__link" do
|
||||||
= image_tag "icons/switch-profile.svg", alt: '', width: 20, height: 20, class: 'mr-1'
|
|
||||||
= t('go_instructor', scope: [:layouts])
|
= t('go_instructor', scope: [:layouts])
|
||||||
- if expert_signed_in? && nav_bar_profile != :expert
|
- if expert_signed_in? && nav_bar_profile != :expert
|
||||||
%li
|
%li
|
||||||
= link_to expert_all_avis_path, class: "fr-nav__link flex align-center" do
|
= link_to expert_all_avis_path, class: "fr-nav__link" do
|
||||||
= image_tag "icons/switch-profile.svg", alt: '', width: 20, height: 20, class: 'mr-1'
|
|
||||||
= t('go_expert', scope: [:layouts])
|
= t('go_expert', scope: [:layouts])
|
||||||
- if administrateur_signed_in? && nav_bar_profile != :administrateur
|
- if administrateur_signed_in? && nav_bar_profile != :administrateur
|
||||||
%li
|
%li
|
||||||
= link_to admin_procedures_path, class: "fr-nav__link flex align-center" do
|
= link_to admin_procedures_path, class: "fr-nav__link" do
|
||||||
= image_tag "icons/switch-profile.svg", alt: '', width: 20, height: 20, class: 'mr-1'
|
|
||||||
= t('go_admin', scope: [:layouts])
|
= t('go_admin', scope: [:layouts])
|
||||||
|
|
||||||
|
- if super_admin_signed_in?
|
||||||
|
%li
|
||||||
|
= link_to manager_root_path, class: "fr-nav__link" do
|
||||||
|
= t('go_superadmin', scope: [:layouts])
|
||||||
|
|
||||||
%li
|
%li
|
||||||
= link_to profil_path, class: "fr-nav__link flex align-center" do
|
= link_to profil_path, class: "fr-nav__link" do
|
||||||
= image_tag "icons/switch-profile.svg", alt: '', width: 20, height: 20, class: 'mr-1'
|
|
||||||
= t('profile', scope: [:layouts])
|
= t('profile', scope: [:layouts])
|
||||||
%li
|
%li
|
||||||
= link_to destroy_user_session_path, method: :delete, class: "fr-nav__link flex align-center" do
|
= link_to destroy_user_session_path, method: :delete, class: "fr-nav__link" do
|
||||||
= image_tag "icons/sign-out.svg", alt: '', width: 20, height: 20, class: 'mr-1'
|
|
||||||
= t('logout', scope: [:layouts])
|
= t('logout', scope: [:layouts])
|
||||||
|
|
|
@ -11,3 +11,8 @@ en:
|
||||||
profile: "See my profile"
|
profile: "See my profile"
|
||||||
logout: "Log out"
|
logout: "Log out"
|
||||||
my_account: "My account"
|
my_account: "My account"
|
||||||
|
connected_as: "connected as %{profile}"
|
||||||
|
instructeur: instructor
|
||||||
|
administrateur: admin
|
||||||
|
expert: expert
|
||||||
|
user: user
|
||||||
|
|
|
@ -11,3 +11,8 @@ fr:
|
||||||
profile: "Voir mon profil"
|
profile: "Voir mon profil"
|
||||||
logout: "Se déconnecter"
|
logout: "Se déconnecter"
|
||||||
my_account: "Mon compte"
|
my_account: "Mon compte"
|
||||||
|
connected_as: "connecté en tant qu'%{profile}"
|
||||||
|
instructeur: instructeur
|
||||||
|
administrateur: administrateur
|
||||||
|
expert: expert
|
||||||
|
user: usager
|
||||||
|
|
Loading…
Add table
Reference in a new issue