Skip to content

Commit

Permalink
Adaptation de la colonne des objets prioritaires dans le tableau des …
Browse files Browse the repository at this point in the history
…communes de la vue département des conservateurs
  • Loading branch information
bricedurand committed Aug 18, 2023
1 parent 6fe26b0 commit 1630e50
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/controllers/conservateurs/departements_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def show
.where(departement: @departement)
.includes(:dossier)
.include_objets_count
.include_objets_recenses_count
.include_recensements_prioritaires_count
.ransack(params[:q])
@pagy, @communes = pagy @ransack.result, items: 20
@query_present = params[:q].present?
Expand Down
17 changes: 9 additions & 8 deletions app/views/conservateurs/departements/_communes_search.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,20 @@
%td= commune.objets_count
%td
- if commune.recensements_prioritaires_count.positive?
%span.fr-badge.fr-badge--sm.fr-badge--warning
- if commune.recensements_prioritaires_count == 1
1 objet prioritaire
- else
\#{commune.recensements_prioritaires_count} objets prioritaires
- recensements_en_peril_count = commune.recensements.en_peril.count
- if recensements_en_peril_count.positive?
= dsfr_badge(status: :warning, classes: ["fr-badge--sm"]) { "#{recensements_en_peril_count} PERIL" }
- recensements_absent_count = commune.recensements.absent.count
- if recensements_absent_count.positive?
= dsfr_badge(status: :warning, classes: ["fr-badge--sm"]) { "#{commune.recensements.absent.count} DISPARU" }
- else
0
0
%td= t("activerecord.attributes.commune.statuses.#{commune.status}")
%td
- if commune.dossier
%div= dossier_status_badge(commune.dossier, small: true)
- if commune.dossier.submitted?
\#{commune.recensements_analysed_percentage.round}% des recensements revus
-# - if commune.dossier.submitted?
-# \#{commune.recensements_analysed_percentage.round}% des recensements revus
- if pagy.pages > 1
.fr-mt-8w.co-pagination-wrapper
!= render partial: 'shared/pagy_nav', locals: {pagy:}

0 comments on commit 1630e50

Please sign in to comment.