demarches-normaliennes/app/views/instructeurs/procedures/show.html.haml
Pierre de La Morinerie 52a491bde3 instructeur: improve description of unfiltered tab
The previous text was misleading: filters can be applied to this tab.
What it really does is present all dossiers regardless of their status.

Fix #5056
2020-04-20 11:34:57 +02:00

150 lines
7.7 KiB
Text
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

- 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}" }
.procedure-header
%h1= procedure_libelle @procedure
= link_to 'gestion des notifications', email_notifications_instructeur_procedure_path(@procedure), class: 'header-link'
|
= link_to 'statistiques', stats_instructeur_procedure_path(@procedure), class: 'header-link', data: { turbolinks: false } # Turbolinks disabled for Chartkick. See Issue #350
- if @procedure.routee?
|
- if current_administrateur.present? && current_administrateur.owns?(@procedure)
= link_to 'instructeurs', procedure_groupe_instructeurs_path(@procedure), class: 'header-link'
- else
= link_to 'instructeurs', instructeur_groupes_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_dossiers.count))
= tab_item(t('pluralize.followed', count: @followed_dossiers.count),
instructeur_procedure_path(@procedure, statut: 'suivis'),
active: @statut == 'suivis',
badge: number_with_html_delimiter(@followed_dossiers.count),
notification: current_instructeur.notifications_for_procedure(@procedure, :en_cours).exists?)
= tab_item(t('pluralize.processed', count: @termines_dossiers.count),
instructeur_procedure_path(@procedure, statut: 'traites'),
active: @statut == 'traites',
badge: number_with_html_delimiter(@termines_dossiers.count),
notification: current_instructeur.notifications_for_procedure(@procedure, :termine).exists?)
= tab_item('tous les dossiers',
instructeur_procedure_path(@procedure, statut: 'tous'),
active: @statut == 'tous',
badge: number_with_html_delimiter(@all_state_dossiers.count))
= tab_item(t('pluralize.archived', count: @archived_dossiers.count),
instructeur_procedure_path(@procedure, statut: 'archives'),
active: @statut == 'archives',
badge: number_with_html_delimiter(@archived_dossiers.count))
.procedure-actions
= render partial: "download_dossiers",
locals: { procedure: @procedure, xlsx_export: @xlsx_export, csv_export: @csv_export, ods_export: @ods_export }
.container
- if @statut == 'a-suivre'
%p.explication-onglet Aucun instructeur n'est affecté au suivi de ces dossiers. Soyez le premier !
- if @statut == 'suivis'
%p.explication-onglet Les dossiers qui sont dans cet onglet sont uniquement ceux que vous suivez. Vous pouvez échanger avec le demandeur jusqu'à pouvoir les accepter, les refuser ou les classer sans suite.
- if @statut == 'traites'
%p.explication-onglet Les dossiers dans cet onglet sont terminés : ils ont été acceptés, refusés ou classés sans suite.
- if @statut == 'tous'
%p.explication-onglet Tous les dossiers qui ont été déposés sur cette démarche, quel que soit le statut.
- if @statut == 'archives'
%p.explication-onglet Les dossiers de cet onglet sont archivés : vous ne pouvez plus y répondre, et les demandeurs ne peuvent plus les modifier.
.afficher-dossiers-supprimes
= link_to deleted_dossiers_instructeur_procedure_path(@procedure) do
%span.icon.delete
Afficher les dossiers supprimés
- if @dossiers.present? || @current_filters.count > 0
= paginate @dossiers
%span.dropdown
%button.button.dropdown-button
Filtrer
.dropdown-content.left-aligned.fade-in-down
= form_tag add_filter_instructeur_procedure_path(@procedure), method: :post, class: 'dropdown-form large' do
= label_tag :field, "Colonne"
= select_tag :field, options_for_select(@available_fields_to_filters)
%br
= label_tag :value, "Valeur"
= text_field_tag :value
= hidden_field_tag :statut, @statut
%br
= submit_tag "Ajouter le filtre", class: 'button'
- @current_filters.group_by { |filter| filter['table'] }.each_with_index do |(table, filters), i|
- if i > 0
et
- filters.each_with_index do |filter, i|
- if i > 0
ou
%span.filter
= link_to remove_filter_instructeur_procedure_path(@procedure, { statut: @statut, table: filter['table'], column: filter['column'], value: filter['value'] }) do
%img.close-icon{ src: image_url("close.svg") }
= "#{filter['label'].truncate(50)} : #{filter['value']}"
%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
= render partial: "header_field", locals: { field: { "label" => "Nº dossier", "table" => "self", "column" => "id" }, classname: "number-col" }
- @procedure_presentation.displayed_fields.each do |field|
= render partial: "header_field", locals: { field: field, classname: "" }
= render partial: "header_field", locals: { field: { "label" => "Statut", "table" => "self", "column" => "state" }, classname: "status-col" }
%th.action-col.follow-col
%span.dropdown
%button.button.dropdown-button
Personnaliser
.dropdown-content.fade-in-down
= form_tag update_displayed_fields_instructeur_procedure_path(@procedure), method: :patch, class: 'dropdown-form columns-form' do
= select_tag :values,
options_for_select(@procedure_presentation.fields_for_select,
selected: @displayed_fields_values),
multiple: true,
class: 'select2-limited'
= submit_tag "Enregistrer", class: 'button'
%tbody
- @dossiers.each do |dossier|
%tr
%td.folder-col
= link_to(instructeur_dossier_path(@procedure, dossier), class: 'cell-link') do
%span.icon.folder
- if current_instructeur.notifications_for_procedure(@procedure, :not_archived).include?(dossier)
%span.notifications{ 'aria-label': 'notifications' }
%td.number-col
= link_to(instructeur_dossier_path(@procedure, dossier), class: 'cell-link') do
= dossier.id
- @procedure_presentation.displayed_field_values(dossier).each do |value|
%td
/ FIXME: value should automatically fallback to `""` instead of nil
/ #get_value should call to_s on the champ
= link_to(value || "", instructeur_dossier_path(@procedure, dossier), class: 'cell-link')
%td.status-col
= link_to(instructeur_dossier_path(@procedure, dossier), class: 'cell-link') do
= status_badge(dossier.state)
%td.action-col.follow-col= render partial: 'dossier_actions', locals: { procedure: @procedure, dossier: dossier, dossier_is_followed: @followed_dossiers_id.include?(dossier.id) }
= paginate @dossiers
- else
%h2.empty-text Aucun dossier