feat(instructeurs/procedures#show): re-align tabs at the start of the container. re-align demander cell content verticaly
This commit is contained in:
parent
081d5094a9
commit
2778b42f1a
6 changed files with 46 additions and 44 deletions
|
@ -15,9 +15,9 @@ module Instructeurs
|
|||
dossiers = current_instructeur.dossiers.joins(:groupe_instructeur)
|
||||
@dossiers_count_per_procedure = dossiers.all_state.group('groupe_instructeurs.procedure_id').reorder(nil).count
|
||||
@dossiers_a_suivre_count_per_procedure = dossiers.without_followers.en_cours.group('groupe_instructeurs.procedure_id').reorder(nil).count
|
||||
@dossiers_archived_count_per_procedure = dossiers.archived.group('groupe_instructeurs.procedure_id').count # why not reorder(nil)
|
||||
@dossiers_archived_count_per_procedure = dossiers.archived.group('groupe_instructeurs.procedure_id').count
|
||||
@dossiers_termines_count_per_procedure = dossiers.termine.group('groupe_instructeurs.procedure_id').reorder(nil).count
|
||||
@dossiers_expirant_count_per_procedure = dossiers.termine_or_en_construction_close_to_expiration.group('groupe_instructeurs.procedure_id').count # why not reorder(nil)
|
||||
@dossiers_expirant_count_per_procedure = dossiers.termine_or_en_construction_close_to_expiration.group('groupe_instructeurs.procedure_id').count
|
||||
groupe_ids = current_instructeur.groupe_instructeurs.pluck(:id)
|
||||
|
||||
@followed_dossiers_count_per_procedure = current_instructeur
|
||||
|
|
|
@ -17,37 +17,3 @@
|
|||
|
|
||||
= link_to 'contacter les usagers (brouillon)', email_usagers_instructeur_procedure_path(procedure), class: 'header-link'
|
||||
|
||||
%ul.tabs
|
||||
= tab_item('à suivre',
|
||||
instructeur_procedure_path(procedure, statut: 'a-suivre'),
|
||||
active: statut == 'a-suivre',
|
||||
badge: number_with_html_delimiter(a_suivre_count))
|
||||
|
||||
= tab_item(t('pluralize.followed', count: suivis_count),
|
||||
instructeur_procedure_path(procedure, statut: 'suivis'),
|
||||
active: statut == 'suivis',
|
||||
badge: number_with_html_delimiter(suivis_count),
|
||||
notification: has_en_cours_notifications)
|
||||
|
||||
= tab_item(t('pluralize.processed', count: traites_count),
|
||||
instructeur_procedure_path(procedure, statut: 'traites'),
|
||||
active: statut == 'traites',
|
||||
badge: number_with_html_delimiter(traites_count),
|
||||
notification: has_termine_notifications)
|
||||
|
||||
= tab_item('au total',
|
||||
instructeur_procedure_path(procedure, statut: 'tous'),
|
||||
active: statut == 'tous',
|
||||
badge: number_with_html_delimiter(tous_count))
|
||||
|
||||
- if procedure.procedure_expires_when_termine_enabled
|
||||
= tab_item(t('pluralize.dossiers_close_to_expiration', count: expirant_count),
|
||||
instructeur_procedure_path(procedure, statut: 'expirant'),
|
||||
active: statut == 'expirant',
|
||||
badge: number_with_html_delimiter(expirant_count))
|
||||
|
||||
= tab_item(t('pluralize.archived', count: archives_count),
|
||||
instructeur_procedure_path(procedure, statut: 'archives'),
|
||||
active: statut == 'archives',
|
||||
badge: number_with_html_delimiter(archives_count))
|
||||
|
||||
|
|
34
app/views/instructeurs/procedures/_tabs.html.haml
Normal file
34
app/views/instructeurs/procedures/_tabs.html.haml
Normal file
|
@ -0,0 +1,34 @@
|
|||
%ul.tabs.mt-3
|
||||
= tab_item('à suivre',
|
||||
instructeur_procedure_path(procedure, statut: 'a-suivre'),
|
||||
active: statut == 'a-suivre',
|
||||
badge: number_with_html_delimiter(a_suivre_count))
|
||||
|
||||
= tab_item(t('pluralize.followed', count: suivis_count),
|
||||
instructeur_procedure_path(procedure, statut: 'suivis'),
|
||||
active: statut == 'suivis',
|
||||
badge: number_with_html_delimiter(suivis_count),
|
||||
notification: has_en_cours_notifications)
|
||||
|
||||
= tab_item(t('pluralize.processed', count: traites_count),
|
||||
instructeur_procedure_path(procedure, statut: 'traites'),
|
||||
active: statut == 'traites',
|
||||
badge: number_with_html_delimiter(traites_count),
|
||||
notification: has_termine_notifications)
|
||||
|
||||
= tab_item('au total',
|
||||
instructeur_procedure_path(procedure, statut: 'tous'),
|
||||
active: statut == 'tous',
|
||||
badge: number_with_html_delimiter(tous_count))
|
||||
|
||||
- if procedure.procedure_expires_when_termine_enabled
|
||||
= tab_item(t('pluralize.dossiers_close_to_expiration', count: expirant_count),
|
||||
instructeur_procedure_path(procedure, statut: 'expirant'),
|
||||
active: statut == 'expirant',
|
||||
badge: number_with_html_delimiter(expirant_count))
|
||||
|
||||
= tab_item(t('pluralize.archived', count: archives_count),
|
||||
instructeur_procedure_path(procedure, statut: 'archives'),
|
||||
active: statut == 'archives',
|
||||
badge: number_with_html_delimiter(archives_count))
|
||||
|
|
@ -7,7 +7,11 @@
|
|||
.procedure-logo{ style: "background-image: url(#{@procedure.logo_url})",
|
||||
role: 'img', 'aria-label': "logo de la démarche #{@procedure.libelle}" }
|
||||
|
||||
= render partial: 'header', locals: { procedure: @procedure,
|
||||
= render partial: 'header', locals: { procedure: @procedure, statut: @statut }
|
||||
|
||||
.procedure-actions
|
||||
= render partial: "download_dossiers", locals: { procedure: @procedure, exports: @exports, dossier_count: @tous_count + @archives_count }
|
||||
.container.flex= render partial: "tabs", locals: { procedure: @procedure,
|
||||
statut: @statut,
|
||||
a_suivre_count: @a_suivre_count,
|
||||
suivis_count: @suivis_count,
|
||||
|
@ -18,9 +22,6 @@
|
|||
has_en_cours_notifications: @has_en_cours_notifications,
|
||||
has_termine_notifications: @has_termine_notifications }
|
||||
|
||||
.procedure-actions
|
||||
= render partial: "download_dossiers", locals: { procedure: @procedure, exports: @exports, dossier_count: @tous_count + @archives_count }
|
||||
|
||||
.container
|
||||
- if @statut == 'a-suivre'
|
||||
%p.explication-onglet Aucun instructeur n’est affecté au suivi de ces dossiers. Soyez le premier !
|
||||
|
@ -46,6 +47,7 @@
|
|||
- if @statut == 'expirant'
|
||||
%p.explication-onglet Les dossiers n'expireront pas avant la période de conservation des données.
|
||||
|
||||
|
||||
- if @filtered_sorted_paginated_ids.present? || @current_filters.count > 0
|
||||
- pagination = paginate @filtered_sorted_paginated_ids
|
||||
= pagination
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
= link_to(url_for_dossier(dossier), class: 'cell-link') do
|
||||
= procedure_libelle(dossier.procedure)
|
||||
- if dossiers.present?
|
||||
%td.cell-link
|
||||
= demandeur_dossier(dossier)
|
||||
%td
|
||||
%span.cell-link= demandeur_dossier(dossier)
|
||||
%td.status-col
|
||||
= status_badge(dossier.state)
|
||||
%td.updated-at-col.cell-link
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
describe 'instructeurs/procedures/_header.html.haml', type: :view do
|
||||
describe 'instructeurs/procedures/_tabs.html.haml', type: :view do
|
||||
let(:procedure) { create(:procedure, id: 1, procedure_expires_when_termine_enabled: expiration_enabled) }
|
||||
|
||||
before { allow(view).to receive(:current_instructeur).and_return(create(:instructeur)) }
|
||||
|
||||
subject do
|
||||
render('instructeurs/procedures/header.html.haml',
|
||||
render('instructeurs/procedures/tabs.html.haml',
|
||||
procedure: procedure,
|
||||
statut: 'tous',
|
||||
a_suivre_count: 0,
|
Loading…
Reference in a new issue