demarches-normaliennes/app/views/new_gestionnaire/procedures/show.html.haml
2017-10-02 17:45:22 +02:00

97 lines
4.2 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.

#procedure-show
.backoffice-header
.container.flex
.procedure-logo
- if @procedure.logo.present?
= image_tag @procedure.logo, alt: "Logo de la procédure"
.procedure-header
%h1= @procedure.libelle
%ul.tabs
%li{ class: (@statut == 'a-suivre') ? 'active' : nil }>
= link_to(procedure_path(@procedure, statut: 'a-suivre')) do
à suivre
%span.badge= @a_suivre_dossiers.count
%li{ class: (@statut == 'suivis') ? 'active' : nil }>
- if @followed_dossiers.with_unread_notifications.present?
%span.notifications{ 'aria-label': 'notifications' }
= link_to(procedure_path(@procedure, statut: 'suivis')) do
= t('pluralize.followed', count: @followed_dossiers.count)
%span.badge= @followed_dossiers.count
%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
%li{ class: (@statut == 'tous') ? 'active' : nil }>
- if @followed_dossiers.with_unread_notifications.present?
%span.notifications{ 'aria-label': 'notifications' }
= link_to(procedure_path(@procedure, statut: 'tous')) do
tous les dossiers
%span.badge= @all_state_dossiers.count
%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 .xls", backoffice_download_dossiers_tps_path(format: :xls, 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
- if @dossiers.present?
%table.table.dossiers-table.hoverable
%thead
%tr
%th.number-col Nº dossier
- @displayed_fields.each do |field|
%th= field['label']
%th.status-col Statut
%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
%i.folder
- if @followed_dossiers.with_unread_notifications.include?(dossier)
%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) }
= paginate @dossiers
- else
%h2.empty-text Aucun dossier