From 14e1c79a102797d891ca403034eaafa68ce3dd2b Mon Sep 17 00:00:00 2001 From: pskl Date: Tue, 19 Nov 2024 18:44:28 +0100 Subject: [PATCH] Add checkbox for reissue --- app/helpers/home_helper.rb | 7 ++----- app/views/classes/_attributive_decisions_panel.html.haml | 2 +- .../home/_attributive_decision_reissue_form.html.haml | 7 +++++++ 3 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 app/views/home/_attributive_decision_reissue_form.html.haml diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb index 63e5c1f0a..e94145df4 100644 --- a/app/helpers/home_helper.rb +++ b/app/helpers/home_helper.rb @@ -29,13 +29,10 @@ def attributive_decisions_download_button ) end - def attributive_decisions_reissue_button + def attributive_decisions_reissue_generation_form return unless current_establishment.with_attributive_decisions?(selected_school_year) - button_to "Rééditer les décisions d'attribution", - school_year_establishment_reissue_attributive_decisions_path(selected_school_year, current_establishment), - method: :post, - class: "fr-btn fr-btn--tertiary" + render partial: "home/attributive_decision_reissue_form" end def attributive_decisions_generation_form diff --git a/app/views/classes/_attributive_decisions_panel.html.haml b/app/views/classes/_attributive_decisions_panel.html.haml index 85f41477c..845a26996 100644 --- a/app/views/classes/_attributive_decisions_panel.html.haml +++ b/app/views/classes/_attributive_decisions_panel.html.haml @@ -17,4 +17,4 @@ = attributive_decisions_generation_form = attributive_decisions_download_button - if current_establishment.with_attributive_decisions?(selected_school_year) && current_user.director? - = attributive_decisions_reissue_button + = attributive_decisions_reissue_generation_form diff --git a/app/views/home/_attributive_decision_reissue_form.html.haml b/app/views/home/_attributive_decision_reissue_form.html.haml new file mode 100644 index 000000000..4bb9d3ac8 --- /dev/null +++ b/app/views/home/_attributive_decision_reissue_form.html.haml @@ -0,0 +1,7 @@ += form_with method: :post, url: school_year_establishment_reissue_attributive_decisions_path(selected_school_year, current_establishment) do |form| + .fr-checkbox-group + = form.check_box :confirmed_director, checked: current_user.confirmed_director? + = form.label :confirmed_director, class: "fr-label" do + = t("panels.attributive_decisions.confirm_director").html_safe + .fr-text--sm.fr-mt-1w= confirmed_director_information + = form.submit "Rééditer les décisions d'attribution", class: "fr-btn fr-btn--secondary"