-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1331 from betagouv/feature/notifications-conserva…
…teurs Ajout d'un raccourci vers l'activité des communes pour les conservateurs
- Loading branch information
Showing
7 changed files
with
87 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.fr-grid-row.fr-grid-row--gutters.fr-mb-4w | ||
.fr-col | ||
.fr-card | ||
.fr-card__body | ||
.fr-card__content | ||
%h2.fr-card__title.fr-text-title--blue-france | ||
Nouveaux messages : #{commune_messages_count.values.sum} | ||
.fr-card__desc | ||
- if commune_messages_count.size.positive? | ||
%ul.fr-links-group.fr-pl-0.fr-mb-0 | ||
- commune_messages_count.each do |commune, count| | ||
%li.co-flex.co-flex--space-between.co-flex--align-items-center.co-position-relative.fr-enlarge-link.fr-px-1w.fr-mx-n1w.fr-pt-1w.fr-mt-n1w | ||
- title = "#{commune.nom} : #{Message.human_attribute_name(:count, count:)}" | ||
= link_to commune.nom, conservateurs_commune_messages_path(commune), class: "fr-link", title:, "data-turbo-frame": :_top | ||
= badge :info, class: "fr-badge--no-icon" do count end | ||
- else | ||
%p.co-text--italic Aucun message des communes entre #{l @date_start.to_date, format: :long_with_weekday} et #{l @date_end.to_date, format: :long_with_weekday}. | ||
|
||
.fr-col | ||
.fr-card | ||
.fr-card__body | ||
.fr-card__content | ||
%h2.fr-card__title.fr-text-title--blue-france | ||
Dossiers transmis : #{commune_dossiers_transmis.load.size} | ||
.fr-card__desc | ||
- if commune_dossiers_transmis.size.positive? | ||
%ul.fr-links-group.fr-pl-0.fr-mb-0 | ||
- commune_dossiers_transmis.each do |commune| | ||
%li.co-flex.co-flex--space-between.co-flex--align-items-center.co-position-relative.fr-enlarge-link.fr-px-1w.fr-mx-n1w.fr-pt-1w.fr-mt-n1w | ||
= link_to commune.nom, conservateurs_commune_path(commune), class: "fr-link", title: "Recensement des objets de #{commune_name_with_objets_rouges_count(commune)}", "data-turbo-frame": :_top | ||
- if commune.en_peril_count.positive? | ||
= badge :warning do Objet.human_attribute_name(:en_peril_count, count: commune.en_peril_count) end | ||
- if commune.disparus_count.positive? | ||
= badge :warning do Objet.human_attribute_name(:disparus_count, count: commune.disparus_count) end | ||
- else | ||
%p.co-text--italic Aucun dossier transmis du #{l @date_start.to_date, format: :long_with_weekday} au #{l @date_end.to_date, format: :long_with_weekday}. |
12 changes: 12 additions & 0 deletions
12
app/views/conservateurs/departements/_selecteur_de_periode.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
= form_with url: url_for, method: :GET, builder: FormBuilderDsfr, data: { turbo_action: :replace } do |f| | ||
.fr-grid-row.fr-grid-row--gutters.co-flex--align-items-end.fr-mb-2w | ||
.fr-col-md-4 | ||
.fr-input-group | ||
= f.label :du, "Date de début" | ||
= f.date_field :du, value: @date_start, class: "fr-input" | ||
.fr-col-md-4 | ||
.fr-input-group | ||
= f.label :au, "Date de fin" | ||
= f.date_field :au, value: @date_end, class: "fr-input" | ||
.fr-col-md-4 | ||
= f.button "Voir l'activité dans cette période", name: nil, class: "fr-btn fr-btn--secondary" |
54 changes: 2 additions & 52 deletions
54
app/views/conservateurs/departements/_tab_activite.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,3 @@ | ||
- commune_messages_count = @departement.commune_messages_count(@date_range) | ||
- commune_dossiers_transmis = @departement.commune_dossiers_transmis(@date_range) | ||
|
||
= turbo_frame_tag :activite do | ||
= form_with url: url_for, method: :GET, builder: FormBuilderDsfr, data: { turbo_action: :replace } do |f| | ||
.fr-grid-row.fr-grid-row--gutters.co-flex--align-items-end.fr-mb-2w | ||
.fr-col-md-4 | ||
.fr-input-group | ||
= f.label :du, "Date de début" | ||
= f.date_field :du, value: @date_start, class: "fr-input" | ||
.fr-col-md-4 | ||
.fr-input-group | ||
= f.label :au, "Date de fin" | ||
= f.date_field :au, value: @date_end, class: "fr-input" | ||
.fr-col-md-4 | ||
= f.button "Voir l'activité dans cette période", name: nil, class: "fr-btn fr-btn--secondary" | ||
|
||
.fr-grid-row.fr-grid-row--gutters | ||
.fr-col | ||
.fr-card | ||
.fr-card__body | ||
.fr-card__content | ||
%h2.fr-card__title.fr-text-title--blue-france | ||
Nouveaux messages : #{commune_messages_count.values.sum} | ||
.fr-card__desc | ||
- if commune_messages_count.size.positive? | ||
%ul.fr-links-group.fr-pl-0.fr-mb-0 | ||
- commune_messages_count.each do |commune, count| | ||
%li.co-flex.co-flex--space-between.co-flex--align-items-center.co-position-relative.fr-enlarge-link.fr-px-1w.fr-mx-n1w.fr-pt-1w.fr-mt-n1w | ||
- title = "#{commune.nom} : #{Message.human_attribute_name(:count, count:)}" | ||
= link_to commune.nom, conservateurs_commune_messages_path(commune), class: "fr-link", title:, "data-turbo-frame": :_top | ||
= badge :info, class: "fr-badge--no-icon" do count end | ||
- else | ||
%p.co-text--italic Aucun message des communes entre #{l @date_start.to_date, format: :long_with_weekday} et #{l @date_end.to_date, format: :long_with_weekday}. | ||
|
||
.fr-col | ||
.fr-card | ||
.fr-card__body | ||
.fr-card__content | ||
%h2.fr-card__title.fr-text-title--blue-france | ||
Dossiers transmis : #{commune_dossiers_transmis.load.size} | ||
.fr-card__desc | ||
- if commune_dossiers_transmis.size.positive? | ||
%ul.fr-links-group.fr-pl-0.fr-mb-0 | ||
- commune_dossiers_transmis.each do |commune| | ||
%li.co-flex.co-flex--space-between.co-flex--align-items-center.co-position-relative.fr-enlarge-link.fr-px-1w.fr-mx-n1w.fr-pt-1w.fr-mt-n1w | ||
= link_to commune.nom, conservateurs_commune_path(commune), class: "fr-link", title: "Recensement des objets de #{commune_name_with_objets_rouges_count(commune)}", "data-turbo-frame": :_top | ||
- if commune.en_peril_count.positive? | ||
= badge :warning do Objet.human_attribute_name(:en_peril_count, count: commune.en_peril_count) end | ||
- if commune.disparus_count.positive? | ||
= badge :warning do Objet.human_attribute_name(:disparus_count, count: commune.disparus_count) end | ||
- else | ||
%p.co-text--italic Aucun dossier transmis du #{l @date_start.to_date, format: :long_with_weekday} au #{l @date_end.to_date, format: :long_with_weekday}. | ||
= render "selecteur_de_periode" | ||
= render "activite", commune_messages_count: @departement.commune_messages_count(@date_range), commune_dossiers_transmis: @departement.commune_dossiers_transmis(@date_range) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- title = "Activité de vos départements" | ||
- content_for(:head_title) { title } | ||
|
||
%main#contenu.fr-container.fr-py-4w.co-min-height-50vh | ||
%h1= title | ||
|
||
= render "selecteur_de_periode" | ||
|
||
- @departements.each do |departement| | ||
%h2= departement.nom | ||
|
||
= render "activite", commune_messages_count: departement.commune_messages_count(@date_range), commune_dossiers_transmis: departement.commune_dossiers_transmis(@date_range) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters