From 020d2951d47799b1c48117261b03a0ad11fbe753 Mon Sep 17 00:00:00 2001 From: tnicolas1 Date: Fri, 22 Nov 2024 08:53:52 +0100 Subject: [PATCH] =?UTF-8?q?R=C3=A9introduction=20de=20'can=5Ftry=5Fto=5Fge?= =?UTF-8?q?nerate=5Fattributive=5Fdecisions=3F'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/home_helper.rb | 2 -- app/models/concerns/user_authorisation.rb | 4 ++-- app/views/classes/_attributive_decisions_panel.html.haml | 6 ++++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb index aaf5eba8e..1f8c8f744 100644 --- a/app/helpers/home_helper.rb +++ b/app/helpers/home_helper.rb @@ -13,8 +13,6 @@ def progress_badge(count, total, **args) end def attributive_decisions_download_button - return unless current_establishment.some_attributive_decisions?(selected_school_year) - count = current_establishment.schoolings.with_attributive_decisions .joins(:classe) .where(classe: { school_year: selected_school_year }) diff --git a/app/models/concerns/user_authorisation.rb b/app/models/concerns/user_authorisation.rb index 38ea4daf5..f13b03f41 100644 --- a/app/models/concerns/user_authorisation.rb +++ b/app/models/concerns/user_authorisation.rb @@ -38,8 +38,8 @@ def cannot_validate? !can_validate? end - def can_generate_attributive_decisions? - confirmed_director? + def can_try_to_generate_attributive_decisions? + director? end end end diff --git a/app/views/classes/_attributive_decisions_panel.html.haml b/app/views/classes/_attributive_decisions_panel.html.haml index 0c9d1403b..63cc889f2 100644 --- a/app/views/classes/_attributive_decisions_panel.html.haml +++ b/app/views/classes/_attributive_decisions_panel.html.haml @@ -12,8 +12,10 @@ %p Les décisions d'attribution sont en train d'être éditées, veuillez rafraichir la page dans quelques minutes. Vous pouvez commencer à remplir des coordonnées bancaires ou des PFMPs pendant ce temps. - else .buttons-group - = attributive_decisions_download_button - - if current_user.director? + - if current_establishment.some_attributive_decisions?(selected_school_year) + = attributive_decisions_download_button + + - if :can_try_to_generate_attributive_decisions? - if current_establishment.missing_attributive_decisions?(selected_school_year) = attributive_decisions_generation_form - if current_establishment.some_attributive_decisions?(selected_school_year)