demarches-normaliennes/app/views/new_gestionnaire/procedures/show.html.haml

118 lines
5.5 KiB
Text
Raw Normal View History

2017-07-11 16:09:03 +02:00
#procedure-show
2017-07-18 15:12:55 +02:00
.backoffice-header
.container.flex
2017-07-11 16:09:03 +02:00
.procedure-logo
- if @procedure.logo.present?
= image_tag @procedure.logo, alt: "Logo de la procédure"
.procedure-header
2017-07-11 16:09:03 +02:00
%h1= @procedure.libelle
%ul.tabs
2017-07-11 16:09:03 +02:00
%li{ class: (@statut == 'a-suivre') ? 'active' : nil }>
= link_to(procedure_path(@procedure, statut: 'a-suivre')) do
à suivre
%span.badge= @a_suivre_dossiers.count
2017-07-11 16:09:03 +02:00
%li{ class: (@statut == 'suivis') ? 'active' : nil }>
- if current_gestionnaire.notifications_for_procedure(@procedure).present?
2017-08-30 15:31:17 +02:00
%span.notifications{ 'aria-label': 'notifications' }
2017-07-11 16:09:03 +02:00
= link_to(procedure_path(@procedure, statut: 'suivis')) do
= t('pluralize.followed', count: @followed_dossiers.count)
%span.badge= @followed_dossiers.count
2017-07-11 16:09:03 +02:00
%li{ class: (@statut == 'traites') ? 'active' : nil }>
= link_to(procedure_path(@procedure, statut: 'traites')) do
= t('pluralize.processed', count: @termines_dossiers.count)
%span.badge= @termines_dossiers.count
2017-07-11 16:09:03 +02:00
%li{ class: (@statut == 'tous') ? 'active' : nil }>
- if current_gestionnaire.notifications_for_procedure(@procedure).present?
2017-08-30 15:31:17 +02:00
%span.notifications{ 'aria-label': 'notifications' }
2017-07-11 16:09:03 +02:00
= link_to(procedure_path(@procedure, statut: 'tous')) do
tous les dossiers
%span.badge= @all_state_dossiers.count
2017-07-11 16:09:03 +02:00
%li{ class: (@statut == 'archives') ? 'active' : nil }>
= link_to(procedure_path(@procedure, statut: 'archives')) do
= t('pluralize.archived', count: @archived_dossiers.count)
%span.badge= @archived_dossiers.count
.procedure-actions
%span.button.dropdown
Télécharger tous les dossiers
.dropdown-content.fade-in-down
%ul.dropdown-items
%li
= link_to "Au format .csv", backoffice_download_dossiers_tps_path(format: :csv, procedure_id: @procedure.id), target: "_blank"
%li
= link_to "Au format .xlsx", backoffice_download_dossiers_tps_path(format: :xlsx, procedure_id: @procedure.id), target: "_blank"
%li
= link_to "Au format .ods", backoffice_download_dossiers_tps_path(format: :ods, procedure_id: @procedure.id), target: "_blank"
.container
2017-09-28 11:04:18 +02:00
- if @dossiers.present? || @current_filters.count > 0
%span.button.dropdown
Filtrer
.dropdown-content.left-aligned.fade-in-down
= form_tag add_filter_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.each do |filter|
%span.filter
= "#{filter['label']} : #{filter['value']}"
= link_to remove_filter_procedure_path(@procedure, statut: @statut, table: filter['table'], column: filter['column']) do
%img.close-icon{ src: image_url("close.svg") }
%table.table.dossiers-table.hoverable
%thead
%tr
= render partial: "header_field", locals: { field: { "label" => "Nº dossier", "table" => "self", "column" => "id" }, classname: "number-col" }
- @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.follow-col
%span.button.dropdown
Personnaliser
.dropdown-content.fade-in-down
= form_tag update_displayed_fields_procedure_path(@procedure), method: :patch, class: 'dropdown-form' do
= select_tag :values,
options_for_select(@procedure.fields_for_select,
selected: @displayed_fields_values),
multiple: true,
class: 'select2-limited'
= submit_tag "Enregistrer", class: 'button'
%tbody
- @dossiers.each do |dossier|
%tr
%td.number-col
= link_to(dossier_path(@procedure, dossier), class: 'cell-link') do
2017-10-16 18:29:40 +02:00
.icon.folder
- if current_gestionnaire.notifications_for_procedure(@procedure).include?(dossier.id)
2017-08-30 15:31:17 +02:00
%span.notifications{ 'aria-label': 'notifications' }
= dossier.id
- @displayed_fields.each do |field|
%td
= link_to(dossier_path(@procedure, dossier), class: 'cell-link') do
= dossier.get_value(field['table'], field['column'])
%td.status-col
= link_to(dossier_path(@procedure, dossier), class: 'cell-link') do
= render partial: 'status', locals: { dossier: dossier }
%td.follow-col= render partial: 'dossier_actions', locals: { procedure: @procedure, dossier: dossier, dossier_is_followed: @followed_dossiers_id.include?(dossier.id) }
2017-09-21 16:47:43 +02:00
= paginate @dossiers
- else
%h2.empty-text Aucun dossier