demarches-normaliennes/app/views/instructeurs/procedures/show.html.haml
2022-05-17 18:34:00 +02:00

147 lines
6.8 KiB
Text

- content_for(:title, "#{@procedure.libelle}")
#procedure-show
.sub-header
.container.flex
.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, statut: @statut }
.procedure-actions
- if @can_download_dossiers
= render Dossiers::ExportComponent.new(procedure: @procedure, exports: @exports)
.container.flex= render partial: "tabs", locals: { procedure: @procedure,
statut: @statut,
a_suivre_count: @counts[:a_suivre],
suivis_count: @counts[:suivis],
traites_count: @counts[:traites],
tous_count: @counts[:tous],
supprimes_recemment_count: @counts[:supprimes_recemment],
archives_count: @counts[:archives],
expirant_count: @counts[:expirant],
has_en_cours_notifications: @has_en_cours_notifications,
has_termine_notifications: @has_termine_notifications }
.container
- if @statut == 'a-suivre'
%p.explication-onglet
= t('views.instructeurs.dossiers.tab_explainations.a_suivre')
- if @statut == 'suivis'
%p.explication-onglet
= t('views.instructeurs.dossiers.tab_explainations.suivis')
- if @statut == 'traites'
%p.explication-onglet
= t('views.instructeurs.dossiers.tab_explainations.traites_html', archives_path: instructeur_archives_path(@procedure))
- if @statut == 'tous'
%p.explication-onglet
= t('views.instructeurs.dossiers.tab_explainations.tous')
- if @statut == 'supprimes_recemment'
%p.explication-onglet
= t('views.instructeurs.dossiers.tab_explainations.supprimes_recemment')
- if @statut == 'archives'
%p.explication-onglet
= t('views.instructeurs.dossiers.tab_explainations.archives')
%br
Ces dossiers seront supprimés lorsque leur délai de conservation dans Démarches-simplifiées
- if @procedure.duree_conservation_dossiers_dans_ds
= "(#{@procedure.duree_conservation_dossiers_dans_ds} mois)"
sera expiré.
= link_to 'En savoir plus', ARCHIVAGE_DOC_URL
.afficher-dossiers-supprimes
= link_to deleted_dossiers_instructeur_procedure_path(@procedure) do
%span.icon.delete
Afficher les dossiers supprimés
- if @statut == 'expirant'
%p.explication-onglet
= t('views.instructeurs.dossiers.tab_explainations.expirant')
- if @filtered_sorted_paginated_ids.present? || @current_filters.count > 0
- pagination = paginate @filtered_sorted_paginated_ids
= pagination
.flex
.flex-grow
= render partial: "dossiers_filter", locals: { procedure: @procedure, procedure_presentation: @procedure_presentation, current_filters: @current_filters, statut: @statut, displayed_fields_options: @displayed_fields_options }
- if @dossiers_count > 0
.dossiers-export
= render Dossiers::ExportComponent.new(procedure: @procedure, exports: @exports, statut: @statut, count: @dossiers_count)
%table.table.dossiers-table.hoverable
%thead
%tr
- if @statut.in? %w(suivis traites tous)
= render partial: "header_field", locals: { field: { "label" => "●", "table" => "notifications", "column" => "notifications" }, classname: "notification-col" }
- else
%th.notification-col
- @procedure_presentation.displayed_fields_for_headers.each do |field|
= render partial: "header_field", locals: { field: field, classname: field['classname'] }
%th.action-col.follow-col
%span.dropdown{ data: { controller: 'menu-button', popover: 'true' } }
%button.button.dropdown-button{ data: { menu_button_target: 'button' } }
= t('views.instructeurs.dossiers.personalize')
#custom-menu.dropdown-content.fade-in-down{ data: { menu_button_target: 'menu' } }
= form_tag update_displayed_fields_instructeur_procedure_path(@procedure), method: :patch, class: 'dropdown-form large columns-form' do
= hidden_field_tag :values, nil
= react_component("ComboMultiple",
options: @displayed_fields_options,
selected: @displayed_fields_selected,
disabled: [],
label: 'Colonne à afficher',
group: '.columns-form',
name: 'values')
= submit_tag t('views.instructeurs.dossiers.save'), class: 'button'
%tbody
- @projected_dossiers.each do |p|
- path = instructeur_dossier_path(@procedure, p.dossier_id)
%tr{ class: [p.hidden_by_user_at.present? && "file-hidden-by-user"] }
%td.folder-col
- if p.hidden_by_administration_at.present?
%span.cell-link
%span.icon.folder
- else
%a.cell-link{ href: path }
%span.icon.folder
- if @not_archived_notifications_dossier_ids.include?(p.dossier_id)
%span.notifications{ 'aria-label': 'notifications' }
%td.number-col
- if p.hidden_by_administration_at.present?
%span.cell-link= p.dossier_id
- else
%a.cell-link{ href: path }= p.dossier_id
- p.columns.each do |column|
%td
- if p.hidden_by_administration_at.present?
%span.cell-link
= column
= "- #{t('views.instructeurs.dossiers.deleted_by_user')}" if p.hidden_by_user_at.present?
- else
%a.cell-link{ href: path }
= column
= "- #{t('views.instructeurs.dossiers.deleted_by_user')}" if p.hidden_by_user_at.present?
%td.status-col
- if p.hidden_by_administration_at.present?
%span.cell-link= status_badge(p.state)
- else
%a.cell-link{ href: path }= status_badge(p.state)
%td.action-col.follow-col= render partial: 'dossier_actions',
locals: { procedure_id: @procedure.id,
dossier_id: p.dossier_id,
state: p.state,
archived: p.archived,
dossier_is_followed: @followed_dossiers_id.include?(p.dossier_id),
close_to_expiration: @statut == 'expirant',
hidden_by_administration: @statut == 'supprimes_recemment' }
= pagination
- else
%h2.empty-text
= t('views.instructeurs.dossiers.no_file')