style(procedures): dsfr compat instructeurs/expert procedures list
This commit is contained in:
parent
0480a0336d
commit
df1d7ae2bd
4 changed files with 124 additions and 135 deletions
|
@ -4,26 +4,11 @@
|
|||
|
||||
.procedure-list {
|
||||
.procedure-item {
|
||||
border-bottom: 1px solid $border-grey;
|
||||
background-color: rgba(0, 0, 0, 0.02);
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
a {
|
||||
@include vertical-padding(24px);
|
||||
background-image: none; // remove DSFR underline
|
||||
color: $black;
|
||||
width: 100%;
|
||||
|
||||
&:hover {
|
||||
background-color: $light-grey;
|
||||
|
||||
.procedure-title {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
.procedure-logo-link {
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.procedure-logo {
|
||||
|
@ -35,32 +20,29 @@
|
|||
background-position: 95% 50%;
|
||||
}
|
||||
|
||||
.procedure-title {
|
||||
min-height: 40px;
|
||||
font-size: 20px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.procedure-status {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.procedure-stats {
|
||||
list-style-type: none;
|
||||
padding-inline-start: 0;
|
||||
|
||||
li {
|
||||
min-height: 36px;
|
||||
border-left: 1px solid $border-grey;
|
||||
width: 90px;
|
||||
position: relative;
|
||||
|
||||
border-left: 1px solid $border-grey;
|
||||
|
||||
&:first-child {
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-right: 1px solid $border-grey;
|
||||
}
|
||||
|
||||
.stats-number,
|
||||
.stats-legend {
|
||||
|
|
|
@ -8,11 +8,17 @@ module ProcedureHelper
|
|||
end
|
||||
|
||||
def procedure_libelle(procedure)
|
||||
parts = procedure.brouillon? ? [tag.span(t('helpers.procedure.testing_procedure'), class: 'badge')] : []
|
||||
parts = procedure.brouillon? ? [procedure_badge(procedure)] : []
|
||||
parts << procedure.libelle
|
||||
safe_join(parts, ' ')
|
||||
end
|
||||
|
||||
def procedure_badge(procedure)
|
||||
return nil unless procedure.brouillon?
|
||||
|
||||
tag.span(t('helpers.procedure.testing_procedure'), class: 'fr-badge')
|
||||
end
|
||||
|
||||
def procedure_publish_label(procedure, key)
|
||||
# i18n-tasks-use t('modal.publish.body.publish')
|
||||
# i18n-tasks-use t('modal.publish.body.reopen')
|
||||
|
|
|
@ -5,39 +5,40 @@
|
|||
|
||||
%ul.procedure-list
|
||||
- @avis_by_procedure.each do |p, procedure_avis|
|
||||
%li.procedure-item.flex.align-start
|
||||
= link_to(procedure_instructeur_avis_index_path(p)) do
|
||||
.flex
|
||||
|
||||
%li.procedure-item.flex.align-start.fr-my-3w.fr-p-2w
|
||||
.flex
|
||||
= link_to instructeur_procedure_path(p), class: 'procedure-logo-link' do
|
||||
.procedure-logo{ style: "background-image: url(#{p.logo_url})" }
|
||||
|
||||
.procedure-details
|
||||
%p.procedure-title
|
||||
= procedure_libelle p
|
||||
%ul.procedure-stats.flex
|
||||
%li
|
||||
%object
|
||||
= link_to(procedure_instructeur_avis_index_path(p, statut: Instructeurs::AvisController::A_DONNER_STATUS)) do
|
||||
- without_answer_count = procedure_avis.select { |a| a.answer.nil? }.size
|
||||
- if without_answer_count > 0
|
||||
%span.notifications{ 'aria-label': "notifications" }
|
||||
.stats-number
|
||||
= without_answer_count
|
||||
.stats-legend
|
||||
avis à donner
|
||||
%li
|
||||
%object
|
||||
= link_to(procedure_instructeur_avis_index_path(p, statut: Instructeurs::AvisController::DONNES_STATUS)) do
|
||||
- with_answer_count = procedure_avis.select { |a| a.answer.present? }.size
|
||||
.stats-number= with_answer_count
|
||||
.stats-legend
|
||||
= pluralize(with_answer_count, "avis donné")
|
||||
.procedure-details
|
||||
%p.fr-mb-2w
|
||||
= procedure_badge(p)
|
||||
= link_to(p.libelle, procedure_instructeur_avis_index_path(p), class: "fr-link fr-ml-1w")
|
||||
|
||||
- if p.close?
|
||||
.procedure-status
|
||||
%span.label
|
||||
= t('helpers.procedure.close')
|
||||
- elsif p.depubliee?
|
||||
.procedure-status
|
||||
%span.label
|
||||
= t('helpers.procedure.unpublished')
|
||||
%ul.procedure-stats.flex
|
||||
%li
|
||||
%object
|
||||
= link_to(procedure_instructeur_avis_index_path(p, statut: Instructeurs::AvisController::A_DONNER_STATUS)) do
|
||||
- without_answer_count = procedure_avis.select { |a| a.answer.nil? }.size
|
||||
- if without_answer_count > 0
|
||||
%span.notifications{ 'aria-label': "notifications" }
|
||||
.stats-number
|
||||
= without_answer_count
|
||||
.stats-legend
|
||||
avis à donner
|
||||
%li
|
||||
%object
|
||||
= link_to(procedure_instructeur_avis_index_path(p, statut: Instructeurs::AvisController::DONNES_STATUS)) do
|
||||
- with_answer_count = procedure_avis.select { |a| a.answer.present? }.size
|
||||
.stats-number= with_answer_count
|
||||
.stats-legend
|
||||
= pluralize(with_answer_count, "avis donné")
|
||||
|
||||
- if p.close?
|
||||
.procedure-status
|
||||
%span.label
|
||||
= t('helpers.procedure.close')
|
||||
- elsif p.depubliee?
|
||||
.procedure-status
|
||||
%span.label
|
||||
= t('helpers.procedure.unpublished')
|
||||
|
|
|
@ -1,81 +1,81 @@
|
|||
%li.procedure-item.flex.align-start
|
||||
= link_to(instructeur_procedure_path(p)) do
|
||||
.flex
|
||||
|
||||
%li.procedure-item.flex.align-start.fr-my-3w.fr-p-2w
|
||||
.flex
|
||||
= link_to instructeur_procedure_path(p), class: 'procedure-logo-link' do
|
||||
.procedure-logo{ style: "background-image: url(#{p.logo_url})" }
|
||||
|
||||
.procedure-details
|
||||
%p.procedure-title
|
||||
= procedure_libelle p
|
||||
%ul.procedure-stats.flex
|
||||
%li
|
||||
%object
|
||||
= link_to(instructeur_procedure_path(p, statut: 'a-suivre')) do
|
||||
- a_suivre_count = dossiers_a_suivre_count_per_procedure[p.id] || 0
|
||||
.stats-number
|
||||
= number_with_html_delimiter(a_suivre_count)
|
||||
.stats-legend
|
||||
= t('instructeurs.dossiers.labels.to_follow')
|
||||
%li
|
||||
%object
|
||||
= link_to(instructeur_procedure_path(p, statut: 'suivis')) do
|
||||
- if procedure_ids_en_cours_with_notifications.include?(p.id)
|
||||
%span.notifications{ 'aria-label': "notifications" }
|
||||
- followed_count = followed_dossiers_count_per_procedure[p.id] || 0
|
||||
.stats-number
|
||||
= number_with_html_delimiter(followed_count)
|
||||
.stats-legend
|
||||
= t('pluralize.followed', count: followed_count)
|
||||
%li
|
||||
%object
|
||||
= link_to(instructeur_procedure_path(p, statut: 'traites')) do
|
||||
- if procedure_ids_termines_with_notifications.include?(p.id)
|
||||
%span.notifications{ 'aria-label': "notifications" }
|
||||
- termines_count = dossiers_termines_count_per_procedure[p.id] || 0
|
||||
.stats-number
|
||||
= number_with_html_delimiter(termines_count)
|
||||
.stats-legend
|
||||
= t('pluralize.processed', count: termines_count)
|
||||
%li
|
||||
%object
|
||||
= link_to(instructeur_procedure_path(p, statut: 'tous')) do
|
||||
- dossier_count = dossiers_count_per_procedure[p.id] || 0
|
||||
.stats-number
|
||||
= number_with_html_delimiter(dossier_count)
|
||||
.stats-legend
|
||||
= t('pluralize.case', count: dossier_count)
|
||||
.procedure-details
|
||||
%p.fr-mb-2w
|
||||
= procedure_badge(p)
|
||||
= link_to(p.libelle, instructeur_procedure_path(p), class: "fr-link fr-ml-1w")
|
||||
%ul.procedure-stats.flex
|
||||
%li
|
||||
%object
|
||||
= link_to(instructeur_procedure_path(p, statut: 'a-suivre')) do
|
||||
- a_suivre_count = dossiers_a_suivre_count_per_procedure[p.id] || 0
|
||||
.stats-number
|
||||
= number_with_html_delimiter(a_suivre_count)
|
||||
.stats-legend
|
||||
= t('instructeurs.dossiers.labels.to_follow')
|
||||
%li
|
||||
%object
|
||||
= link_to(instructeur_procedure_path(p, statut: 'suivis')) do
|
||||
- if procedure_ids_en_cours_with_notifications.include?(p.id)
|
||||
%span.notifications{ 'aria-label': "notifications" }
|
||||
- followed_count = followed_dossiers_count_per_procedure[p.id] || 0
|
||||
.stats-number
|
||||
= number_with_html_delimiter(followed_count)
|
||||
.stats-legend
|
||||
= t('pluralize.followed', count: followed_count)
|
||||
%li
|
||||
%object
|
||||
= link_to(instructeur_procedure_path(p, statut: 'traites')) do
|
||||
- if procedure_ids_termines_with_notifications.include?(p.id)
|
||||
%span.notifications{ 'aria-label': "notifications" }
|
||||
- termines_count = dossiers_termines_count_per_procedure[p.id] || 0
|
||||
.stats-number
|
||||
= number_with_html_delimiter(termines_count)
|
||||
.stats-legend
|
||||
= t('pluralize.processed', count: termines_count)
|
||||
%li
|
||||
%object
|
||||
= link_to(instructeur_procedure_path(p, statut: 'tous')) do
|
||||
- dossier_count = dossiers_count_per_procedure[p.id] || 0
|
||||
.stats-number
|
||||
= number_with_html_delimiter(dossier_count)
|
||||
.stats-legend
|
||||
= t('pluralize.case', count: dossier_count)
|
||||
|
||||
%li
|
||||
%object
|
||||
= link_to(instructeur_procedure_path(p, statut: 'supprimes_recemment')) do
|
||||
- dossier_count = dossiers_supprimes_recemment_count_per_procedure[p.id] || 0
|
||||
.stats-number
|
||||
= number_with_html_delimiter(dossier_count)
|
||||
.stats-legend
|
||||
= t('pluralize.dossiers_supprimes_recemment', count: dossier_count)
|
||||
|
||||
- if p.procedure_expires_when_termine_enabled
|
||||
%li
|
||||
%object
|
||||
= link_to(instructeur_procedure_path(p, statut: 'supprimes_recemment')) do
|
||||
- dossier_count = dossiers_supprimes_recemment_count_per_procedure[p.id] || 0
|
||||
= link_to(instructeur_procedure_path(p, statut: 'expirant')) do
|
||||
- expirant_count = dossiers_expirant_count_per_procedure[p.id] || 0
|
||||
.stats-number
|
||||
= number_with_html_delimiter(dossier_count)
|
||||
= number_with_html_delimiter(expirant_count)
|
||||
.stats-legend
|
||||
= t('pluralize.dossiers_supprimes_recemment', count: dossier_count)
|
||||
= t('pluralize.dossiers_close_to_expiration', count: expirant_count)
|
||||
|
||||
- if p.procedure_expires_when_termine_enabled
|
||||
%li
|
||||
%object
|
||||
= link_to(instructeur_procedure_path(p, statut: 'expirant')) do
|
||||
- expirant_count = dossiers_expirant_count_per_procedure[p.id] || 0
|
||||
.stats-number
|
||||
= number_with_html_delimiter(expirant_count)
|
||||
.stats-legend
|
||||
= t('pluralize.dossiers_close_to_expiration', count: expirant_count)
|
||||
%li
|
||||
%object
|
||||
= link_to(instructeur_procedure_path(p, statut: 'archives')) do
|
||||
- archived_count = dossiers_archived_count_per_procedure[p.id] || 0
|
||||
.stats-number
|
||||
= number_with_html_delimiter(archived_count)
|
||||
.stats-legend
|
||||
= t('pluralize.archived', count: archived_count)
|
||||
|
||||
%li
|
||||
%object
|
||||
= link_to(instructeur_procedure_path(p, statut: 'archives')) do
|
||||
- archived_count = dossiers_archived_count_per_procedure[p.id] || 0
|
||||
.stats-number
|
||||
= number_with_html_delimiter(archived_count)
|
||||
.stats-legend
|
||||
= t('pluralize.archived', count: archived_count)
|
||||
|
||||
- if p.close?
|
||||
.procedure-status
|
||||
%span.label Close
|
||||
- elsif p.depubliee?
|
||||
.procedure-status
|
||||
%span.label Dépubliée
|
||||
- if p.close?
|
||||
.procedure-status
|
||||
%span.label Close
|
||||
- elsif p.depubliee?
|
||||
.procedure-status
|
||||
%span.label Dépubliée
|
||||
|
|
Loading…
Reference in a new issue