Skip to content

Commit

Permalink
N'affiche pas les évaluations anonymisées sur le tableau de bord
Browse files Browse the repository at this point in the history
  • Loading branch information
etienneCharignon authored and cprodhomme committed Feb 6, 2023
1 parent 0c7590f commit 5ed236a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
9 changes: 3 additions & 6 deletions app/admin/dashboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,12 @@ def recupere_support
end

def recupere_evaluations
@evaluations = Evaluation.accessible_by(current_ability).order(created_at: :desc).limit(10)
@evaluations = Evaluation.tableau_de_bord(current_ability)
end

def recupere_evaluations_sans_mise_en_action
@evaluations_sans_mise_en_action = Evaluation.accessible_by(current_ability)
.where(mise_en_action_effectuee: nil)
.illettrisme_potentiel
.non_anonymes
.order(created_at: :desc)
@evaluations_sans_mise_en_action =
Evaluation.illettrismes_sans_mise_en_action(current_ability)
end

def recupere_actualites
Expand Down
16 changes: 16 additions & 0 deletions app/models/evaluation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,22 @@ def enregistre_date
update(mise_en_action_le: Time.zone.now)
end

def self.tableau_de_bord(ability)
accessible_by(ability)
.non_anonymes
.order(created_at: :desc)
.limit(10)
end

def self.illettrismes_sans_mise_en_action(ability)
accessible_by(ability)
.where(mise_en_action_effectuee: nil)
.illettrisme_potentiel
.non_anonymes
.order(created_at: :desc)
.limit(6)
end

private

def trouve_campagne_depuis_code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ div class: 'contenu-avec-evaluations' do
text_node image_tag 'point_interrogation.svg', class: 'mr-3'
div md(t('.question')), class: 'fw-semi-bold'
end
render 'liste_evaluations', evaluations: evaluations.limit(6),
render 'liste_evaluations', evaluations: evaluations,
partial_evaluation: 'evaluation_sans_mise_en_action'
render 'components/banniere_solutions_illettrisme', asterisque: false
end
Expand Down

0 comments on commit 5ed236a

Please sign in to comment.