demarches-normaliennes/app/views/admin/procedures/show.html.haml
2018-09-05 15:46:24 +02:00

123 lines
4.8 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

= render partial: 'admin/closed_mail_template_attestation_inconsistency_alert'
.row.white-back
#procedure_show
= render partial: '/admin/procedures/modal_publish'
= render partial: '/admin/procedures/modal_transfer'
- if @procedure.brouillon?
- if @procedure.gestionnaires.empty? || @procedure.service.nil?
- missing_elements = []
- if @procedure.gestionnaires.empty?
- missing_elements << 'des instructeurs'
- if @procedure.service.nil?
- missing_elements << 'un service'
- message = "Affectez #{missing_elements.join(' et ')} à votre démarche."
%a.action_button.btn.btn-success#disabled-publish-procedure{ data: { toggle: :tooltip, placement: :bottom }, style: 'float: right; margin-top: 10px;', disabled: true, title: message }
%i.fa.fa-eraser
Publier
- else
%a.btn.btn-success#publish-procedure{ data: { target: '#publish-modal', toggle: :modal }, type: 'button', style: 'float: right; margin-top: 10px;' }
%i.fa.fa-eraser
Publier
%a.btn.btn-default#transfer-procedure{ data: { target: '#transfer-modal', toggle: :modal }, type: 'button', style: 'float: right; margin-top: 10px; margin-right: 10px;' }
%i.fa.fa-exchange
Envoyer une copie
- if @procedure.archivee?
%a.btn.btn-default#reopen-procedure{ data: { target: '#publish-modal', toggle: :modal }, type: 'button', style: 'float: right; margin-top: 10px; margin-right: 10px;' }
%i.fa.fa-rocket
Réactiver
- elsif @procedure.publiee?
= form_tag admin_procedure_archive_path(procedure_id: @procedure.id), method: :put, style: 'float: right; margin-top: 10px;' do
%button#archive-procedure.btn.btn-small.btn-default.text-info{ type: :button }
%i.fa.fa-eraser
Archiver
#confirm
%button#valid.btn.btn-small.btn-success{ type: :submit }
%i.fa.fa-check
Valider
%button#cancel.btn.btn-small.btn-danger{ type: :button }
%i.fa.fa-remove
Annuler
- if @procedure.locked?
#procedure_locked
.alert.alert-info
Cette démarche a été publiée, certains éléments ne peuvent plus être modifiés.
%div
%h3 Lien démarche
%div{ style: 'margin-left: 3%;' }
- if @procedure.archivee?
%b
Cette démarche est archivée et nest donc pas accessible par le public.
- elsif @procedure.brouillon_avec_lien? || @procedure.publiee?
= link_to procedure_lien(@procedure), sanitize_url(procedure_lien(@procedure)), target: :blank
- else
%b
Cette démarche na pas encore de lien, et nest donc pas accessible par le public.
%br
%h3 Détails
.row{ style: 'margin-right: 3%; margin-left: 3%;' }
.description.col-xs-6.col-md-3.procedure-description
%h4.text-info
= @procedure.libelle
= h string_to_html(@procedure.description)
.champs.col-xs-6.col-md-3
%h4.text-info
Champs
.badge.progress-bar-info
= @procedure.types_de_champ.size
%ul
- @procedure.types_de_champ.order(:order_place).each do |champ|
%li= champ.libelle
.champs_private.col-xs-6.col-md-3
%h4.text-info
Annotations privées
.badge.progress-bar-info
= @procedure.types_de_champ_private.size
%ul
- @procedure.types_de_champ_private.order(:order_place).each do |champ|
%li= champ.libelle
.pieces-justificatives.col-xs-6.col-md-3
%h4.text-info
Pièces jointes
.badge.progress-bar-info
= @procedure.types_de_piece_justificative.size
- @procedure.types_de_piece_justificative.each do |piece_justificative|
= piece_justificative.libelle
%br
- durees_de_conservation = politiques_conservation_de_donnees(@procedure)
- if durees_de_conservation.present?
.row{ style: 'margin-right: 3%; margin-left: 3%;' }
.col-xs-6.col-md-3
%h4.text-info Conservation des données
- durees_de_conservation.each do |text|
%p= text
- if @procedure.publiee_ou_archivee?
%h3 Supprimer la démarche
.alert.alert-danger
%p
Attention : la suppression dune démarche est définitive.
- dossiers_count = @procedure.dossiers.count
- if dossiers_count > 0
%p
= dossiers_deletion_warning(@procedure)
%p.text-right
= link_to "J'ai compris, je supprime la démarche",
hide_admin_procedure_path(@procedure),
method: :post,
class: "btn btn-danger",
data: { confirm: "Voulez-vous supprimer la démarche ?", disable: true }