Merge pull request #7594 from tchak/refactor-procedure-cards
refactor(procedure): move cards to components
This commit is contained in:
commit
8887142761
43 changed files with 379 additions and 216 deletions
|
@ -0,0 +1,5 @@
|
|||
class Procedure::Card::AdministrateursComponent < ApplicationComponent
|
||||
def initialize(procedure:)
|
||||
@procedure = procedure
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
fr:
|
||||
title:
|
||||
one: Administrateur
|
||||
other: Administrateurs
|
|
@ -0,0 +1,10 @@
|
|||
= 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
|
||||
= t('.title', count: @procedure.administrateurs.size)
|
||||
%p.card-admin-subtitle Gestion de la démarche
|
||||
%p.button= t('views.shared.actions.edit')
|
17
app/components/procedure/card/annotations_component.rb
Normal file
17
app/components/procedure/card/annotations_component.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
class Procedure::Card::AnnotationsComponent < ApplicationComponent
|
||||
def initialize(procedure:)
|
||||
@procedure = procedure
|
||||
@procedure.validate(:publication)
|
||||
@count = @procedure.draft_revision.types_de_champ.private_only.size
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def render?
|
||||
!@procedure.locked? || @procedure.feature_enabled?(:procedure_revisions)
|
||||
end
|
||||
|
||||
def error_messages
|
||||
@procedure.errors.messages_for(:draft_types_de_champ_private).to_sentence
|
||||
end
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
fr:
|
||||
title: Annotations privées
|
|
@ -0,0 +1,19 @@
|
|||
= link_to annotations_admin_procedure_path(@procedure), class: 'card-admin', title: error_messages do
|
||||
- if error_messages.present?
|
||||
%div
|
||||
%span.icon.refuse
|
||||
%p.card-admin-status-error À modifier
|
||||
- elsif @count == 0
|
||||
%div
|
||||
%span.icon.clock
|
||||
%p.card-admin-status-todo À configurer
|
||||
- else
|
||||
%div
|
||||
%span.icon.accept
|
||||
%p.card-admin-status-accept Validé
|
||||
%div
|
||||
%p.card-admin-title
|
||||
%span.badge.baseline= @count
|
||||
= t('.title')
|
||||
%p.card-admin-subtitle Champs à remplir par l’administration
|
||||
%p.button= t('views.shared.actions.edit')
|
|
@ -0,0 +1,5 @@
|
|||
class Procedure::Card::APIEntrepriseComponent < ApplicationComponent
|
||||
def initialize(procedure:)
|
||||
@procedure = procedure
|
||||
end
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
fr:
|
||||
title: Jeton Entreprise
|
|
@ -0,0 +1,13 @@
|
|||
= 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= t('.title')
|
||||
%p.card-admin-subtitle Configurer le jeton API entreprise
|
||||
%p.button= t('views.shared.actions.edit')
|
11
app/components/procedure/card/api_particulier_component.rb
Normal file
11
app/components/procedure/card/api_particulier_component.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
class Procedure::Card::APIParticulierComponent < ApplicationComponent
|
||||
def initialize(procedure:)
|
||||
@procedure = procedure
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def render?
|
||||
helpers.feature_enabled?(:api_particulier)
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
fr:
|
||||
ready: "Validé"
|
||||
needs_configuration: "À configurer"
|
||||
configure_api_particulier_token: "Configurer le jeton API particulier"
|
|
@ -0,0 +1,13 @@
|
|||
= 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
|
||||
%p.card-admin-status-accept= t('.ready')
|
||||
- else
|
||||
%div
|
||||
%span.icon.clock
|
||||
%p.card-admin-status-todo= t('.needs_configuration')
|
||||
%div
|
||||
%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')
|
5
app/components/procedure/card/attestation_component.rb
Normal file
5
app/components/procedure/card/attestation_component.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class Procedure::Card::AttestationComponent < ApplicationComponent
|
||||
def initialize(procedure:)
|
||||
@procedure = procedure
|
||||
end
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
fr:
|
||||
title: Attestation
|
|
@ -0,0 +1,13 @@
|
|||
= 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= t('.title')
|
||||
%p.card-admin-subtitle Délivrance automatique pour les dossiers acceptés
|
||||
%p.button= t('views.shared.actions.edit')
|
17
app/components/procedure/card/champs_component.rb
Normal file
17
app/components/procedure/card/champs_component.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
class Procedure::Card::ChampsComponent < ApplicationComponent
|
||||
def initialize(procedure:)
|
||||
@procedure = procedure
|
||||
@procedure.validate(:publication)
|
||||
@count = @procedure.draft_revision.types_de_champ.public_only.size
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def render?
|
||||
!@procedure.locked? || @procedure.feature_enabled?(:procedure_revisions)
|
||||
end
|
||||
|
||||
def error_messages
|
||||
@procedure.errors.messages_for(:draft_types_de_champ).to_sentence
|
||||
end
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
fr:
|
||||
title: Champs du formulaire
|
|
@ -0,0 +1,19 @@
|
|||
= link_to champs_admin_procedure_path(@procedure), class: 'card-admin', title: error_messages do
|
||||
- if error_messages.present?
|
||||
%div
|
||||
%span.icon.refuse
|
||||
%p.card-admin-status-error À modifier
|
||||
- elsif @count == 0
|
||||
%div
|
||||
%span.icon.clock
|
||||
%p.card-admin-status-todo À faire
|
||||
- else
|
||||
%div
|
||||
%span.icon.accept
|
||||
%p.card-admin-status-accept Validé
|
||||
%div
|
||||
%p.card-admin-title
|
||||
%span.badge.baseline= @count
|
||||
= t('.title')
|
||||
%p.card-admin-subtitle À remplir par les usagers
|
||||
%p.button= t('views.shared.actions.edit')
|
|
@ -0,0 +1,5 @@
|
|||
class Procedure::Card::DossierSubmittedMessageComponent < ApplicationComponent
|
||||
def initialize(procedure:)
|
||||
@procedure = procedure
|
||||
end
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
fr:
|
||||
title: Fin de dépot
|
|
@ -0,0 +1,13 @@
|
|||
= 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= t('.title')
|
||||
%p.card-admin-subtitle Orienter l'usager suite à l'envoi de son dossier
|
||||
%p.button= t('views.shared.actions.edit')
|
5
app/components/procedure/card/emails_component.rb
Normal file
5
app/components/procedure/card/emails_component.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class Procedure::Card::EmailsComponent < ApplicationComponent
|
||||
def initialize(procedure:)
|
||||
@procedure = procedure
|
||||
end
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
fr:
|
||||
title: Configuration des emails
|
|
@ -0,0 +1,8 @@
|
|||
= 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= t('.title')
|
||||
%p.card-admin-subtitle Notifications automatiques
|
||||
%p.button= t('views.shared.actions.edit')
|
5
app/components/procedure/card/experts_component.rb
Normal file
5
app/components/procedure/card/experts_component.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class Procedure::Card::ExpertsComponent < ApplicationComponent
|
||||
def initialize(procedure:)
|
||||
@procedure = procedure
|
||||
end
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
fr:
|
||||
title: Avis externes
|
|
@ -0,0 +1,8 @@
|
|||
= link_to admin_procedure_experts_path(@procedure), class: 'card-admin' do
|
||||
%div
|
||||
%span.icon.preview
|
||||
%p.card-admin-status-todo À configurer
|
||||
%div
|
||||
%p.card-admin-title= t('.title')
|
||||
%p.card-admin-subtitle Gérer les avis des experts invités
|
||||
%p.button= t('views.shared.actions.edit')
|
5
app/components/procedure/card/instructeurs_component.rb
Normal file
5
app/components/procedure/card/instructeurs_component.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class Procedure::Card::InstructeursComponent < ApplicationComponent
|
||||
def initialize(procedure:)
|
||||
@procedure = procedure
|
||||
end
|
||||
end
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
fr:
|
||||
title:
|
||||
"0": Instructeurs
|
||||
one: Instructeur
|
||||
other: Instructeurs
|
||||
routee:
|
||||
title:
|
||||
"0": Groupe Instructeurs
|
||||
one: Groupe Instructeur
|
||||
other: Groupe Instructeurs
|
|
@ -0,0 +1,19 @@
|
|||
= 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
|
||||
|
||||
= @procedure.routee? ? t('.routee.title', count: @procedure.groupe_instructeurs.size) : t('.title', count: @procedure.instructeurs.size)
|
||||
%p.card-admin-subtitle Suivi des dossiers
|
||||
%p.button= t('views.shared.actions.edit')
|
9
app/components/procedure/card/modifications_component.rb
Normal file
9
app/components/procedure/card/modifications_component.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
class Procedure::Card::ModificationsComponent < ApplicationComponent
|
||||
def initialize(procedure:)
|
||||
@procedure = procedure
|
||||
end
|
||||
|
||||
def render?
|
||||
@procedure.revised?
|
||||
end
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
fr:
|
||||
title: Modifications
|
|
@ -0,0 +1,11 @@
|
|||
= 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
|
||||
= t('.title')
|
||||
|
||||
%p.card-admin-subtitle Historique des modifications du formulaire
|
||||
%p.button Voir
|
5
app/components/procedure/card/mon_avis_component.rb
Normal file
5
app/components/procedure/card/mon_avis_component.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class Procedure::Card::MonAvisComponent < ApplicationComponent
|
||||
def initialize(procedure:)
|
||||
@procedure = procedure
|
||||
end
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
fr:
|
||||
title: MonAvis
|
|
@ -0,0 +1,13 @@
|
|||
= 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= t('.title')
|
||||
%p.card-admin-subtitle Avis des usagers sur votre démarche
|
||||
%p.button= t('views.shared.actions.edit')
|
5
app/components/procedure/card/presentation_component.rb
Normal file
5
app/components/procedure/card/presentation_component.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class Procedure::Card::PresentationComponent < ApplicationComponent
|
||||
def initialize(procedure:)
|
||||
@procedure = procedure
|
||||
end
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
fr:
|
||||
title: Présentation
|
|
@ -0,0 +1,8 @@
|
|||
= 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= t('.title')
|
||||
%p.card-admin-subtitle Logo, nom, description
|
||||
%p.button= t('views.shared.actions.edit')
|
28
app/components/procedure/card/service_component.rb
Normal file
28
app/components/procedure/card/service_component.rb
Normal file
|
@ -0,0 +1,28 @@
|
|||
class Procedure::Card::ServiceComponent < ApplicationComponent
|
||||
def initialize(procedure:, administrateur:)
|
||||
@procedure = procedure
|
||||
@administrateur = administrateur
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def service_link
|
||||
if @procedure.service.present?
|
||||
edit_admin_service_path(@procedure.service, procedure_id: @procedure.id)
|
||||
elsif @administrateur.services.present?
|
||||
admin_services_path(procedure_id: @procedure.id)
|
||||
else
|
||||
new_admin_service_path(procedure_id: @procedure.id)
|
||||
end
|
||||
end
|
||||
|
||||
def service_button_text
|
||||
if @procedure.service.present?
|
||||
'Modifier'
|
||||
elsif @administrateur.services.present?
|
||||
'Choisir'
|
||||
else
|
||||
'Remplir'
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
fr:
|
||||
title: Service
|
|
@ -0,0 +1,17 @@
|
|||
= 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= t('.title')
|
||||
%p.card-admin-subtitle
|
||||
- if @procedure.service_id.present?
|
||||
= @procedure.service.nom
|
||||
- else
|
||||
Choix du service administratif
|
||||
%p.button= service_button_text
|
|
@ -53,223 +53,21 @@
|
|||
.container
|
||||
%h2.procedure-admin-explanation Indispensable avant publication
|
||||
.procedure-grid
|
||||
= 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
|
||||
%p.button Modifier
|
||||
|
||||
- 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
|
||||
%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
|
||||
%p.card-admin-subtitle
|
||||
- if @procedure.service_id.present?
|
||||
= @procedure.service.nom
|
||||
- else
|
||||
Choix du service administratif
|
||||
%p.button= service_button_text
|
||||
|
||||
= 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
|
||||
%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
|
||||
|
||||
= @procedure.routee? ? "Groupe Instructeurs" : "#{"Instructeur".pluralize(@procedure.instructeurs.size)}"
|
||||
%p.card-admin-subtitle Suivi des dossiers
|
||||
%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
|
||||
= render Procedure::Card::PresentationComponent.new(procedure: @procedure)
|
||||
= render Procedure::Card::ChampsComponent.new(procedure: @procedure)
|
||||
= render Procedure::Card::ServiceComponent.new(procedure: @procedure, administrateur: current_administrateur)
|
||||
= render Procedure::Card::AdministrateursComponent.new(procedure: @procedure)
|
||||
= render Procedure::Card::InstructeursComponent.new(procedure: @procedure)
|
||||
= render Procedure::Card::ModificationsComponent.new(procedure: @procedure)
|
||||
|
||||
%h2.procedure-admin-explanation Pour aller plus loin
|
||||
.procedure-grid
|
||||
|
||||
= 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
|
||||
%p.button Modifier
|
||||
|
||||
= link_to admin_procedure_experts_path(@procedure), class: 'card-admin' do
|
||||
%div
|
||||
%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
|
||||
%p.button Modifier
|
||||
|
||||
|
||||
= 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
|
||||
%p.button Modifier
|
||||
|
||||
- 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
|
||||
- if @procedure.draft_types_de_champ_private.present?
|
||||
%div
|
||||
%span.icon.accept
|
||||
%p.card-admin-status-accept Validé
|
||||
- elsif error_messages.present?
|
||||
%div
|
||||
%span.icon.refuse
|
||||
%p.card-admin-status-error À modifier
|
||||
- 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 l’administration
|
||||
%p.button Modifier
|
||||
|
||||
= 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
|
||||
%p.button Modifier
|
||||
|
||||
- if feature_enabled?(:api_particulier)
|
||||
= 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
|
||||
%p.card-admin-status-accept= t('.ready')
|
||||
- else
|
||||
%div
|
||||
%span.icon.clock
|
||||
%p.card-admin-status-todo= t('.needs_configuration')
|
||||
%div
|
||||
%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')
|
||||
|
||||
= 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
|
||||
%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
|
||||
%p.card-admin-subtitle Orienter l'usager suite à l'envoi de son dossier
|
||||
%p.button Modifier
|
||||
= render Procedure::Card::AttestationComponent.new(procedure: @procedure)
|
||||
= render Procedure::Card::ExpertsComponent.new(procedure: @procedure)
|
||||
= render Procedure::Card::EmailsComponent.new(procedure: @procedure)
|
||||
= render Procedure::Card::AnnotationsComponent.new(procedure: @procedure)
|
||||
= render Procedure::Card::APIEntrepriseComponent.new(procedure: @procedure)
|
||||
= render Procedure::Card::APIParticulierComponent.new(procedure: @procedure)
|
||||
= render Procedure::Card::MonAvisComponent.new(procedure: @procedure)
|
||||
= render Procedure::Card::DossierSubmittedMessageComponent.new(procedure: @procedure)
|
||||
|
||||
|
|
Loading…
Reference in a new issue