diff --git a/app/components/groupe_gestionnaire/card/administrateurs_component.rb b/app/components/groupe_gestionnaire/card/administrateurs_component.rb index 3551f5732..231cdd593 100644 --- a/app/components/groupe_gestionnaire/card/administrateurs_component.rb +++ b/app/components/groupe_gestionnaire/card/administrateurs_component.rb @@ -1,6 +1,7 @@ class GroupeGestionnaire::Card::AdministrateursComponent < ApplicationComponent - def initialize(groupe_gestionnaire:, path:) + def initialize(groupe_gestionnaire:, path:, is_gestionnaire: true) @groupe_gestionnaire = groupe_gestionnaire @path = path + @is_gestionnaire = is_gestionnaire end end diff --git a/app/components/groupe_gestionnaire/card/administrateurs_component/administrateurs_component.html.haml b/app/components/groupe_gestionnaire/card/administrateurs_component/administrateurs_component.html.haml index de7014288..0cdb0d3e9 100644 --- a/app/components/groupe_gestionnaire/card/administrateurs_component/administrateurs_component.html.haml +++ b/app/components/groupe_gestionnaire/card/administrateurs_component/administrateurs_component.html.haml @@ -7,4 +7,4 @@ %p.fr-tag= @groupe_gestionnaire.administrateurs.size %h3.fr-h6 = t('.title', count: @groupe_gestionnaire.administrateurs.size) - %p.fr-btn.fr-btn--tertiary= t('views.shared.actions.edit') + %p.fr-btn.fr-btn--tertiary= @is_gestionnaire ? t('views.shared.actions.edit') : t('views.shared.actions.see') diff --git a/app/components/groupe_gestionnaire/card/gestionnaires_component.rb b/app/components/groupe_gestionnaire/card/gestionnaires_component.rb index ef51f10bd..43b0c40a7 100644 --- a/app/components/groupe_gestionnaire/card/gestionnaires_component.rb +++ b/app/components/groupe_gestionnaire/card/gestionnaires_component.rb @@ -1,6 +1,7 @@ class GroupeGestionnaire::Card::GestionnairesComponent < ApplicationComponent - def initialize(groupe_gestionnaire:, path:) + def initialize(groupe_gestionnaire:, path:, is_gestionnaire: true) @groupe_gestionnaire = groupe_gestionnaire @path = path + @is_gestionnaire = is_gestionnaire end end diff --git a/app/components/groupe_gestionnaire/card/gestionnaires_component/gestionnaires_component.html.haml b/app/components/groupe_gestionnaire/card/gestionnaires_component/gestionnaires_component.html.haml index 6193a89be..cbcedb3fd 100644 --- a/app/components/groupe_gestionnaire/card/gestionnaires_component/gestionnaires_component.html.haml +++ b/app/components/groupe_gestionnaire/card/gestionnaires_component/gestionnaires_component.html.haml @@ -7,4 +7,4 @@ %p.fr-tag= @groupe_gestionnaire.gestionnaires.size %h3.fr-h6 = t('.title', count: @groupe_gestionnaire.gestionnaires.size) - %p.fr-btn.fr-btn--tertiary= t('views.shared.actions.edit') + %p.fr-btn.fr-btn--tertiary= @is_gestionnaire ? t('views.shared.actions.edit') : t('views.shared.actions.see') diff --git a/app/views/administrateurs/groupe_gestionnaire/show.html.haml b/app/views/administrateurs/groupe_gestionnaire/show.html.haml index 744423477..eebc4780a 100644 --- a/app/views/administrateurs/groupe_gestionnaire/show.html.haml +++ b/app/views/administrateurs/groupe_gestionnaire/show.html.haml @@ -5,6 +5,6 @@ .fr-container %h2= "Gestion du groupe gestionnaire \"#{@groupe_gestionnaire.name}\"" .fr-grid-row.fr-grid-row--gutters.fr-mb-5w - = render GroupeGestionnaire::Card::GestionnairesComponent.new(groupe_gestionnaire: @groupe_gestionnaire, path: admin_groupe_gestionnaire_gestionnaires_path) - = render GroupeGestionnaire::Card::AdministrateursComponent.new(groupe_gestionnaire: @groupe_gestionnaire, path: admin_groupe_gestionnaire_administrateurs_path) + = render GroupeGestionnaire::Card::GestionnairesComponent.new(groupe_gestionnaire: @groupe_gestionnaire, path: admin_groupe_gestionnaire_gestionnaires_path, is_gestionnaire: false) + = render GroupeGestionnaire::Card::AdministrateursComponent.new(groupe_gestionnaire: @groupe_gestionnaire, path: admin_groupe_gestionnaire_administrateurs_path, is_gestionnaire: false) = render GroupeGestionnaire::Card::CommentairesComponent.new(groupe_gestionnaire: @groupe_gestionnaire, administrateur: current_administrateur, path: admin_groupe_gestionnaire_commentaires_path)