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-list {
|
||||||
.procedure-item {
|
.procedure-item {
|
||||||
border-bottom: 1px solid $border-grey;
|
background-color: rgba(0, 0, 0, 0.02);
|
||||||
|
}
|
||||||
|
|
||||||
&:last-child {
|
.procedure-logo-link {
|
||||||
border-bottom: none;
|
background-image: 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 {
|
.procedure-logo {
|
||||||
|
@ -35,32 +20,29 @@
|
||||||
background-position: 95% 50%;
|
background-position: 95% 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.procedure-title {
|
|
||||||
min-height: 40px;
|
|
||||||
font-size: 20px;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.procedure-status {
|
.procedure-status {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.procedure-stats {
|
.procedure-stats {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
|
padding-inline-start: 0;
|
||||||
|
|
||||||
li {
|
li {
|
||||||
min-height: 36px;
|
min-height: 36px;
|
||||||
border-left: 1px solid $border-grey;
|
|
||||||
width: 90px;
|
width: 90px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
border-left: 1px solid $border-grey;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
border-left: none;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: rgba(0, 0, 0, 0.05);
|
background-color: rgba(0, 0, 0, 0.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
border-right: 1px solid $border-grey;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stats-number,
|
.stats-number,
|
||||||
.stats-legend {
|
.stats-legend {
|
||||||
|
|
|
@ -8,11 +8,17 @@ module ProcedureHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def procedure_libelle(procedure)
|
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
|
parts << procedure.libelle
|
||||||
safe_join(parts, ' ')
|
safe_join(parts, ' ')
|
||||||
end
|
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)
|
def procedure_publish_label(procedure, key)
|
||||||
# i18n-tasks-use t('modal.publish.body.publish')
|
# i18n-tasks-use t('modal.publish.body.publish')
|
||||||
# i18n-tasks-use t('modal.publish.body.reopen')
|
# i18n-tasks-use t('modal.publish.body.reopen')
|
||||||
|
|
|
@ -5,39 +5,40 @@
|
||||||
|
|
||||||
%ul.procedure-list
|
%ul.procedure-list
|
||||||
- @avis_by_procedure.each do |p, procedure_avis|
|
- @avis_by_procedure.each do |p, procedure_avis|
|
||||||
%li.procedure-item.flex.align-start
|
%li.procedure-item.flex.align-start.fr-my-3w.fr-p-2w
|
||||||
= link_to(procedure_instructeur_avis_index_path(p)) do
|
.flex
|
||||||
.flex
|
= link_to instructeur_procedure_path(p), class: 'procedure-logo-link' do
|
||||||
|
|
||||||
.procedure-logo{ style: "background-image: url(#{p.logo_url})" }
|
.procedure-logo{ style: "background-image: url(#{p.logo_url})" }
|
||||||
|
|
||||||
.procedure-details
|
.procedure-details
|
||||||
%p.procedure-title
|
%p.fr-mb-2w
|
||||||
= procedure_libelle p
|
= procedure_badge(p)
|
||||||
%ul.procedure-stats.flex
|
= link_to(p.libelle, procedure_instructeur_avis_index_path(p), class: "fr-link fr-ml-1w")
|
||||||
%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?
|
%ul.procedure-stats.flex
|
||||||
.procedure-status
|
%li
|
||||||
%span.label
|
%object
|
||||||
= t('helpers.procedure.close')
|
= link_to(procedure_instructeur_avis_index_path(p, statut: Instructeurs::AvisController::A_DONNER_STATUS)) do
|
||||||
- elsif p.depubliee?
|
- without_answer_count = procedure_avis.select { |a| a.answer.nil? }.size
|
||||||
.procedure-status
|
- if without_answer_count > 0
|
||||||
%span.label
|
%span.notifications{ 'aria-label': "notifications" }
|
||||||
= t('helpers.procedure.unpublished')
|
.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
|
%li.procedure-item.flex.align-start.fr-my-3w.fr-p-2w
|
||||||
= link_to(instructeur_procedure_path(p)) do
|
.flex
|
||||||
.flex
|
= link_to instructeur_procedure_path(p), class: 'procedure-logo-link' do
|
||||||
|
|
||||||
.procedure-logo{ style: "background-image: url(#{p.logo_url})" }
|
.procedure-logo{ style: "background-image: url(#{p.logo_url})" }
|
||||||
|
|
||||||
.procedure-details
|
.procedure-details
|
||||||
%p.procedure-title
|
%p.fr-mb-2w
|
||||||
= procedure_libelle p
|
= procedure_badge(p)
|
||||||
%ul.procedure-stats.flex
|
= link_to(p.libelle, instructeur_procedure_path(p), class: "fr-link fr-ml-1w")
|
||||||
%li
|
%ul.procedure-stats.flex
|
||||||
%object
|
%li
|
||||||
= link_to(instructeur_procedure_path(p, statut: 'a-suivre')) do
|
%object
|
||||||
- a_suivre_count = dossiers_a_suivre_count_per_procedure[p.id] || 0
|
= link_to(instructeur_procedure_path(p, statut: 'a-suivre')) do
|
||||||
.stats-number
|
- a_suivre_count = dossiers_a_suivre_count_per_procedure[p.id] || 0
|
||||||
= number_with_html_delimiter(a_suivre_count)
|
.stats-number
|
||||||
.stats-legend
|
= number_with_html_delimiter(a_suivre_count)
|
||||||
= t('instructeurs.dossiers.labels.to_follow')
|
.stats-legend
|
||||||
%li
|
= t('instructeurs.dossiers.labels.to_follow')
|
||||||
%object
|
%li
|
||||||
= link_to(instructeur_procedure_path(p, statut: 'suivis')) do
|
%object
|
||||||
- if procedure_ids_en_cours_with_notifications.include?(p.id)
|
= link_to(instructeur_procedure_path(p, statut: 'suivis')) do
|
||||||
%span.notifications{ 'aria-label': "notifications" }
|
- if procedure_ids_en_cours_with_notifications.include?(p.id)
|
||||||
- followed_count = followed_dossiers_count_per_procedure[p.id] || 0
|
%span.notifications{ 'aria-label': "notifications" }
|
||||||
.stats-number
|
- followed_count = followed_dossiers_count_per_procedure[p.id] || 0
|
||||||
= number_with_html_delimiter(followed_count)
|
.stats-number
|
||||||
.stats-legend
|
= number_with_html_delimiter(followed_count)
|
||||||
= t('pluralize.followed', count: followed_count)
|
.stats-legend
|
||||||
%li
|
= t('pluralize.followed', count: followed_count)
|
||||||
%object
|
%li
|
||||||
= link_to(instructeur_procedure_path(p, statut: 'traites')) do
|
%object
|
||||||
- if procedure_ids_termines_with_notifications.include?(p.id)
|
= link_to(instructeur_procedure_path(p, statut: 'traites')) do
|
||||||
%span.notifications{ 'aria-label': "notifications" }
|
- if procedure_ids_termines_with_notifications.include?(p.id)
|
||||||
- termines_count = dossiers_termines_count_per_procedure[p.id] || 0
|
%span.notifications{ 'aria-label': "notifications" }
|
||||||
.stats-number
|
- termines_count = dossiers_termines_count_per_procedure[p.id] || 0
|
||||||
= number_with_html_delimiter(termines_count)
|
.stats-number
|
||||||
.stats-legend
|
= number_with_html_delimiter(termines_count)
|
||||||
= t('pluralize.processed', count: termines_count)
|
.stats-legend
|
||||||
%li
|
= t('pluralize.processed', count: termines_count)
|
||||||
%object
|
%li
|
||||||
= link_to(instructeur_procedure_path(p, statut: 'tous')) do
|
%object
|
||||||
- dossier_count = dossiers_count_per_procedure[p.id] || 0
|
= link_to(instructeur_procedure_path(p, statut: 'tous')) do
|
||||||
.stats-number
|
- dossier_count = dossiers_count_per_procedure[p.id] || 0
|
||||||
= number_with_html_delimiter(dossier_count)
|
.stats-number
|
||||||
.stats-legend
|
= number_with_html_delimiter(dossier_count)
|
||||||
= t('pluralize.case', count: 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
|
%li
|
||||||
%object
|
%object
|
||||||
= link_to(instructeur_procedure_path(p, statut: 'supprimes_recemment')) do
|
= link_to(instructeur_procedure_path(p, statut: 'expirant')) do
|
||||||
- dossier_count = dossiers_supprimes_recemment_count_per_procedure[p.id] || 0
|
- expirant_count = dossiers_expirant_count_per_procedure[p.id] || 0
|
||||||
.stats-number
|
.stats-number
|
||||||
= number_with_html_delimiter(dossier_count)
|
= number_with_html_delimiter(expirant_count)
|
||||||
.stats-legend
|
.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
|
||||||
%li
|
%object
|
||||||
%object
|
= link_to(instructeur_procedure_path(p, statut: 'archives')) do
|
||||||
= link_to(instructeur_procedure_path(p, statut: 'expirant')) do
|
- archived_count = dossiers_archived_count_per_procedure[p.id] || 0
|
||||||
- expirant_count = dossiers_expirant_count_per_procedure[p.id] || 0
|
.stats-number
|
||||||
.stats-number
|
= number_with_html_delimiter(archived_count)
|
||||||
= number_with_html_delimiter(expirant_count)
|
.stats-legend
|
||||||
.stats-legend
|
= t('pluralize.archived', count: archived_count)
|
||||||
= t('pluralize.dossiers_close_to_expiration', count: expirant_count)
|
|
||||||
|
|
||||||
%li
|
- if p.close?
|
||||||
%object
|
.procedure-status
|
||||||
= link_to(instructeur_procedure_path(p, statut: 'archives')) do
|
%span.label Close
|
||||||
- archived_count = dossiers_archived_count_per_procedure[p.id] || 0
|
- elsif p.depubliee?
|
||||||
.stats-number
|
.procedure-status
|
||||||
= number_with_html_delimiter(archived_count)
|
%span.label Dépubliée
|
||||||
.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
|
|
||||||
|
|
Loading…
Reference in a new issue