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

271 lines
11 KiB
Text
Raw Normal View History

= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
"#{@procedure.libelle}", ],
metadatas: ["Créée le #{@procedure.created_at.strftime('%d/%m/%Y')} - n° #{@procedure.id}", "#{@procedure.close? ? "Close le #{@procedure.closed_at.strftime('%d/%m/%Y')}" : @procedure.locked? ? "Publiée - #{procedure_lien(@procedure)}" : "Brouillon"}"] }
2020-07-20 10:37:08 +02:00
.container.procedure-admin-container
= link_to @procedure.active_revision.draft? ? commencer_dossier_vide_test_path(path: @procedure.path) : commencer_dossier_vide_path(path: @procedure.path), target: "_blank", rel: "noopener", class: 'button', id: "pdf-procedure" do
%span.icon.printer
PDF
2021-10-04 10:38:23 +02:00
= link_to apercu_admin_procedure_path(@procedure), target: "_blank", rel: "noopener", class: 'button', id: "preview-procedure" do
2020-07-20 10:37:08 +02:00
%span.icon.preview
Prévisualiser
2021-06-24 11:57:05 +02:00
- if @procedure.brouillon? || @procedure.draft_changed?
= link_to sanitize_url(@procedure_lien_test), target: :blank, rel: :noopener, class: 'button' do
2020-07-20 10:37:08 +02:00
%span.icon.in-progress
Tester
- if @procedure.publiee? || @procedure.brouillon?
2020-09-29 10:52:13 +02:00
= link_to admin_procedure_transfert_path(@procedure), class: 'button' do
%span.icon.reply
Envoyer une copie
- if !@procedure.publiee? && !@procedure.close? && !@procedure.depubliee?
2020-07-20 10:37:08 +02:00
= link_to 'Publier', admin_procedure_publication_path(@procedure), class: 'button primary', id: 'publish-procedure-link', data: { disable_with: "Publication..." }
- if @procedure.close? || @procedure.depubliee?
= link_to 'Réactiver', admin_procedure_publication_path(@procedure), class: 'button primary', id: 'publish-procedure-link', data: { disable_with: "Publication..." }
- if @procedure.locked? && !@procedure.close?
= link_to admin_procedure_archive_path(procedure_id: @procedure.id), method: :put, class: 'button', id: "close-procedure-link", data: { confirm: "Voulez-vous vraiment clore la démarche ? \nLes dossiers en cours pourront être instruits, mais aucun nouveau dossier ne pourra plus être déposé.", disable_with: "Archivage..."} do
2020-07-20 10:37:08 +02:00
%span.icon.archive
Clore
2021-06-18 11:15:10 +02:00
- if @procedure.draft_changed?
= link_to 'Publier les modifications', admin_procedure_publication_path(@procedure), class: 'button primary', id: 'publish-procedure-link', data: { disable_with: "Publication..." }
- if @procedure.draft_changed?
2021-06-23 18:56:04 +02:00
.container
.card.featured
.card-title
= t(:has_changes, scope: [:administrateurs, :revision_changes])
2021-06-23 18:56:04 +02:00
= render partial: 'revision_changes', locals: { changes: @procedure.revision_changes }
2021-06-18 11:15:10 +02:00
- if !@procedure.procedure_expires_when_termine_enabled?
= render partial: 'administrateurs/procedures/suggest_expires_when_termine', locals: { procedure: @procedure }
.container
2020-07-20 10:37:08 +02:00
%h2.procedure-admin-explanation Indispensable avant publication
.procedure-grid
2021-06-10 15:37:45 +02:00
= link_to edit_admin_procedure_path(@procedure), id: 'presentation', class: 'card-admin' do
%div
%span.icon.accept
%p.card-admin-status-accept Validé
%div
%p.card-admin-title Présentation
%p.card-admin-subtitle Logo, nom, description
2021-06-10 15:37:45 +02:00
%p.button Modifier
2021-06-18 11:15:10 +02:00
- if !@procedure.locked? || @procedure.feature_enabled?(:procedure_revisions)
- @procedure.validate(:publication)
- error_messages = @procedure.errors.messages_for(:draft_types_de_champ).to_sentence
= link_to champs_admin_procedure_path(@procedure), class: 'card-admin', title: error_messages do
- if @procedure.draft_types_de_champ.empty?
%div
%span.icon.clock
%p.card-admin-status-todo À faire
- elsif error_messages.present?
%div
%span.icon.refuse
%p.card-admin-status-error À modifier
- else
%div
%span.icon.accept
%p.card-admin-status-accept Validé
%div
%p.card-admin-title
%span.badge.baseline= @procedure.draft_types_de_champ.size
Champs du formulaire
%p.card-admin-subtitle À remplir par les usagers
2021-06-10 15:37:45 +02:00
%p.button Modifier
- if @procedure.service.present?
- service_link = edit_admin_service_path(@procedure.service, procedure_id: @procedure.id)
- service_button_text = 'Modifier'
- elsif current_administrateur.services.present?
- service_link = admin_services_path(procedure_id: @procedure.id)
- service_button_text = 'Choisir'
- else
- service_link = new_admin_service_path(procedure_id: @procedure.id)
- service_button_text = 'Remplir'
= link_to service_link, class: 'card-admin' do
- if @procedure.service_id.present?
%div
%span.icon.accept
%p.card-admin-status-accept Validé
- else
%div
%span.icon.clock
%p.card-admin-status-todo À faire
%div
%p.card-admin-title Service
2020-07-20 10:37:08 +02:00
%p.card-admin-subtitle
- if @procedure.service_id.present?
= @procedure.service.nom
- else
Choix du service administratif
2021-06-10 15:37:45 +02:00
%p.button= service_button_text
2021-06-10 15:37:45 +02:00
= link_to admin_procedure_administrateurs_path(@procedure), id: 'administrateurs', class: 'card-admin' do
%div
%span.icon.accept
%p.card-admin-status-accept Validé
%div
%p.card-admin-title
%span.badge.baseline= @procedure.administrateurs.size
#{"Administrateur".pluralize(@procedure.administrateurs.size)}
%p.card-admin-subtitle Gestion de la démarche
2021-06-10 15:37:45 +02:00
%p.button Modifier
= link_to admin_procedure_groupe_instructeurs_path(@procedure), id: 'groupe-instructeurs', class: 'card-admin' do
- if @procedure.routee? || @procedure.instructeurs.size > 1
%div
%span.icon.accept
%p.card-admin-status-accept Validé
- else
%div
%span.icon.clock
%p.card-admin-status-todo À faire
%div
%p.card-admin-title
- if @procedure.routee?
%span.badge.baseline= @procedure.groupe_instructeurs.size
- else
%span.badge.baseline= @procedure.instructeurs.size
2020-07-20 10:37:08 +02:00
= @procedure.routee? ? "Groupe Instructeurs" : "#{"Instructeur".pluralize(@procedure.instructeurs.size)}"
%p.card-admin-subtitle Suivi des dossiers
2021-06-10 15:37:45 +02:00
%p.button Modifier
- if @procedure.revised?
= link_to modifications_admin_procedure_path(@procedure), id: 'modifications', class: 'card-admin' do
%div
%span.icon.accept
%p.card-admin-status-accept Activée
%div
%p.card-admin-title
%span.badge.baseline= @procedure.revisions.size - 1
Modifications
%p.card-admin-subtitle Historique des modifications du formulaire
%p.button Voir
2020-07-20 10:37:08 +02:00
%h2.procedure-admin-explanation Pour aller plus loin
.procedure-grid
2021-06-10 15:37:45 +02:00
= link_to edit_admin_procedure_attestation_template_path(@procedure), class: 'card-admin' do
- if @procedure.draft_attestation_template&.activated?
%div
%span.icon.accept
%p.card-admin-status-accept Activée
- else
%div
%span.icon.clock
%p.card-admin-status-todo Désactivée
%div
%p.card-admin-title Attestation
%p.card-admin-subtitle Délivrance automatique pour les dossiers acceptés
2021-06-10 15:37:45 +02:00
%p.button Modifier
2021-06-10 15:37:45 +02:00
= link_to admin_procedure_experts_path(@procedure), class: 'card-admin' do
%div
2021-04-16 11:13:47 +02:00
%span.icon.preview
%p.card-admin-status-todo À configurer
%div
%p.card-admin-title Avis externes
%p.card-admin-subtitle Gérer les avis des experts invités
2021-06-10 15:37:45 +02:00
%p.button Modifier
2021-06-10 15:37:45 +02:00
= link_to admin_procedure_mail_templates_path(@procedure), class: 'card-admin' do
%div
%span.icon.clock
%p.card-admin-status-todo À configurer
%div
%p.card-admin-title Configuration des emails
%p.card-admin-subtitle Notifications automatiques
2021-06-10 15:37:45 +02:00
%p.button Modifier
2020-07-16 18:13:51 +02:00
2021-06-18 11:15:10 +02:00
- if !@procedure.locked? || @procedure.feature_enabled?(:procedure_revisions)
- @procedure.validate(:publication)
- error_messages = @procedure.errors.messages_for(:draft_types_de_champ_private).to_sentence
= link_to annotations_admin_procedure_path(@procedure), class: 'card-admin', title: error_messages do
2020-08-27 19:55:10 +02:00
- if @procedure.draft_types_de_champ_private.present?
2020-07-16 18:13:51 +02:00
%div
%span.icon.accept
%p.card-admin-status-accept Validé
- elsif error_messages.present?
%div
%span.icon.refuse
%p.card-admin-status-error À modifier
2020-07-16 18:13:51 +02:00
- else
%div
%span.icon.clock
%p.card-admin-status-todo À configurer
%div
%p.card-admin-title Annotations privées
%p.card-admin-subtitle Champs à remplir par ladministration
2021-06-10 15:37:45 +02:00
%p.button Modifier
2021-06-10 15:37:45 +02:00
= link_to jeton_admin_procedure_path(@procedure), class: 'card-admin' do
- if @procedure.api_entreprise_token.present?
%div
%span.icon.accept
%p.card-admin-status-accept Validé
- else
%div
%span.icon.clock
%p.card-admin-status-todo À configurer
%div
%p.card-admin-title Jeton Entreprise
%p.card-admin-subtitle Configurer le jeton API entreprise
2021-06-10 15:37:45 +02:00
%p.button Modifier
- if feature_enabled?(:api_particulier)
2021-09-28 15:11:15 +02:00
= link_to admin_procedure_api_particulier_path(@procedure), class: 'card-admin', id: 'api-particulier' do
- if @procedure.api_particulier_token.present?
%div
%span.icon.accept
2021-09-09 19:48:34 +02:00
%p.card-admin-status-accept= t('.ready')
- else
%div
%span.icon.clock
2021-09-09 19:48:34 +02:00
%p.card-admin-status-todo= t('.needs_configuration')
%div
2021-09-09 19:48:34 +02:00
%p.card-admin-title= Procedure.human_attribute_name(:api_particulier_token)
%p.card-admin-subtitle= t('.configure_api_particulier_token')
%p.button= t('views.shared.actions.edit')
2021-06-10 15:37:45 +02:00
= link_to monavis_admin_procedure_path(@procedure), class: 'card-admin' do
- if @procedure.monavis_embed.present?
%div
%span.icon.accept
%p.card-admin-status-accept Validé
- else
%div
%span.icon.clock
%p.card-admin-status-todo À configurer
%div
%p.card-admin-title MonAvis
%p.card-admin-subtitle Avis des usagers sur votre démarche
2021-06-10 15:37:45 +02:00
%p.button Modifier
= link_to edit_admin_procedure_dossier_submitted_message_path(@procedure), class: 'card-admin' do
- if @procedure.active_dossier_submitted_message.present?
%div
%span.icon.accept
%p.card-admin-status-accept Validé
- else
%div
%span.icon.clock
%p.card-admin-status-todo À configurer
%div
%p.card-admin-title Fin de dépot
2022-03-03 16:48:26 +01:00
%p.card-admin-subtitle Orienter l'usager suite à l'envoi de son dossier
%p.button Modifier