Skip to content

Commit

Permalink
Réintroduction de 'can_try_to_generate_attributive_decisions?'
Browse files Browse the repository at this point in the history
  • Loading branch information
tnicolas1 committed Nov 22, 2024
1 parent e5d5c1a commit 020d295
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions app/helpers/home_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down
4 changes: 2 additions & 2 deletions app/models/concerns/user_authorisation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions app/views/classes/_attributive_decisions_panel.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 020d295

Please sign in to comment.