Skip to content

Commit

Permalink
Déplacer le bouton 'Retirer l'élève de la classe' (#1222)
Browse files Browse the repository at this point in the history
  • Loading branch information
tnicolas1 authored Nov 19, 2024
1 parent 4a32f3e commit 358b137
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
17 changes: 10 additions & 7 deletions app/views/pfmps/_pfmp_student_table.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@
%td
%strong= number_to_currency(pfmp.amount)

.actions
.fr-btns-group.fr-btns-group--inline
= button_to "Ajouter une PFMP", new_school_year_class_schooling_pfmp_path(classe.school_year, classe, schooling), class: 'fr-btn', disabled: !classe.establishment.eql?(current_establishment), method: :get
- if schooling.attributive_decision.attached?
= button_to "Télécharger la décision d'attribution", url_for(schooling.attributive_decision), class: 'fr-btn fr-btn--secondary', disabled: !classe.establishment.eql?(current_establishment), target: :download, method: :get
- if schooling.abrogation_decision.attached?
= button_to "Télécharger la décision d'abrogation", url_for(schooling.abrogation_decision), class: 'fr-btn fr-btn--secondary', disabled: !classe.establishment.eql?(current_establishment), target: :download, method: :get
- if classe.establishment.eql?(current_establishment)
.actions
.fr-btns-group.fr-btns-group--inline
= button_to "Ajouter une PFMP", new_school_year_class_schooling_pfmp_path(classe.school_year, classe, schooling), class: 'fr-btn', method: :get
- if schooling.attributive_decision.attached?
= button_to "Télécharger la décision d'attribution", url_for(schooling.attributive_decision), class: 'fr-btn fr-btn--secondary', target: :download, method: :get
- if schooling.abrogation_decision.attached?
= button_to "Télécharger la décision d'abrogation", url_for(schooling.abrogation_decision), class: 'fr-btn fr-btn--secondary', target: :download, method: :get
- if [email protected]_schooling.nil? && @student.current_schooling.eql?(schooling) && !schooling.removed?
= button_to "Retirer l'élève de la classe", confirm_removal_school_year_class_schooling_path(classe.school_year, classe, schooling), class: 'fr-btn fr-btn--danger', method: :get
4 changes: 0 additions & 4 deletions app/views/students/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
%section.fr-pb-3w
-if [email protected]_schooling.nil? && [email protected]_schooling.removed?
.fr-btns-group.fr-btns-group--inline.fr-mt-3w
= button_to "Retirer l'élève de la classe", confirm_removal_school_year_class_schooling_path(selected_school_year, @student.current_schooling.classe, @student.current_schooling), class: 'fr-btn fr-btn--danger', method: :get

%h2.fr-h4 Coordonnées bancaires
- if @student.rib(current_establishment).nil?
%p Aucune coordonnée bancaire enregistrée pour le moment.
Expand Down
2 changes: 1 addition & 1 deletion features/gestion_de_pfmp.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Fonctionnalité: Le personnel de direction édite les PFMPs
Scénario: Le personnel peut voir les PFMPs d'autres établissements et ne peut pas les modifier
Sachant que l'élève "Marie Curie" a une PFMP dans la classe "A2" dans un autre établissement
Et que je rafraîchis la page
Alors la section pour la classe "A2" contient un bouton "Ajouter une PFMP" désactivé
Alors la section pour la classe "A2" ne contient pas de bouton "Ajouter une PFMP"
Et la section pour la classe "A2" ne contient pas de lien sur "Voir la PFMP"

Scénario: Le personnel de direction peut ajouter une PFMP pour toute la classe
Expand Down
4 changes: 2 additions & 2 deletions features/step_definitions/web_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@
expect(page.find("section", text: title)).to have_table(caption, with_rows: table.rows)
end

Alors("la section pour la classe {string} contient un bouton {string} désactivé") do |title, content|
expect(page.find("section", text: title)).to have_button(content, disabled: true)
Alors("la section pour la classe {string} ne contient pas de bouton {string}") do |title, content|
expect(page.find("section", text: title)).to have_no_button(content)
end

Alors("la section pour la classe {string} contient un lien sur {string}") do |title, content|
Expand Down

0 comments on commit 358b137

Please sign in to comment.