Merge pull request #2599 from betagouv/improve-demarches

Affichage du service dans la liste des démarches
This commit is contained in:
gregoirenovel 2018-09-18 10:56:22 +02:00 committed by GitHub
commit 8aab263a1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 2 deletions

View file

@ -30,3 +30,7 @@
background-color: $lighter-blue;
}
}
.service-name {
color: $grey;
}

View file

@ -9,6 +9,7 @@ module NewUser
.select { |p| p.publiee? }
@popular_demarches = Procedure
.includes(:service)
.select("procedures.*, COUNT(*) AS procedures_count")
.joins(:dossiers)
.publiees

View file

@ -12,14 +12,22 @@
%ul.demarche-links
- @previous_demarches_still_active.each do |demarche|
%li
= link_to(demarche.libelle, commencer_url(procedure_path: demarche.path), class: "demarche-link")
= link_to(commencer_url(procedure_path: demarche.path), class: "demarche-link") do
= demarche.libelle
%br
.service-name
= demarche&.service&.nom
- if @popular_demarches.present?
%h2.list-header LES PLUS POPULAIRES
%ul.demarche-links
- @popular_demarches.each do |demarche|
%li
= link_to(demarche.libelle, commencer_url(procedure_path: demarche.path), class: "demarche-link")
= link_to(commencer_url(procedure_path: demarche.path), class: "demarche-link") do
= demarche.libelle
%br
.service-name
= demarche&.service&.nom
%h2.list-header TOUTES LES DÉMARCHES
= link_to("Voir l'intégralité des démarches disponibles", LISTE_DES_DEMARCHES_URL, class: "button")