refactor(demande): single champ row component everywhere
This commit is contained in:
parent
d41f224a2c
commit
0ffc14944d
16 changed files with 204 additions and 226 deletions
|
@ -6,14 +6,14 @@
|
|||
.fr-grid-row.fr-grid-row--center
|
||||
.fr-col-12
|
||||
%h2.fr-h6.fr-background-alt--grey.fr-mb-0
|
||||
.flex-grow.fr-py-3v.fr-px-4v= t('views.shared.dossiers.demande.en_construction')
|
||||
.flex-grow.fr-py-3v.fr-px-2w= t('views.shared.dossiers.demande.en_construction')
|
||||
|
||||
- if dossier.depose_at.present?
|
||||
= render partial: "shared/dossiers/infos_generales", locals: { dossier: dossier }
|
||||
|
||||
.tab-title
|
||||
%h2.fr-h6.fr-background-alt--grey.fr-mb-0.flex
|
||||
.flex-grow.fr-py-3v.fr-px-4v
|
||||
.flex-grow.fr-py-3v.fr-px-2w
|
||||
= t('views.shared.dossiers.demande.requester_identity')
|
||||
|
||||
- if dossier.identity_updated_at.present? && demande_seen_at&.<(dossier.identity_updated_at)
|
||||
|
@ -27,17 +27,17 @@
|
|||
= link_to t('views.shared.dossiers.demande.edit_identity'), identite_dossier_path(dossier), class: 'fr-py-3v fr-btn fr-btn--tertiary-no-outline'
|
||||
|
||||
|
||||
.fr-my-4v.fr-px-4v
|
||||
= render partial: "shared/dossiers/user_infos", locals: { user_deleted: dossier.user_deleted?, email: dossier.user_email_for(:display) }
|
||||
= render partial: "shared/dossiers/user_infos", locals: { user_deleted: dossier.user_deleted?, email: dossier.user_email_for(:display) }
|
||||
|
||||
- if dossier.etablissement.present?
|
||||
- if dossier.individual.present?
|
||||
= render partial: "shared/dossiers/identite_individual", locals: { individual: dossier.individual }
|
||||
|
||||
- if dossier.etablissement.present?
|
||||
.fr-mt-1w.fr-mb-4w.fr-px-2w
|
||||
= render partial: "shared/dossiers/identite_entreprise", locals: { etablissement: dossier.etablissement, profile: profile }
|
||||
|
||||
- if dossier.individual.present?
|
||||
= render partial: "shared/dossiers/identite_individual", locals: { individual: dossier.individual }
|
||||
|
||||
%h2.fr-h6.fr-background-alt--grey.fr-mb-0.flex
|
||||
.flex-grow.fr-py-3v.fr-px-4v= t('views.shared.dossiers.demande.form')
|
||||
.flex-grow.fr-py-3v.fr-px-2w= t('views.shared.dossiers.demande.form')
|
||||
|
||||
- champs = dossier.champs_public
|
||||
- if champs.any? || dossier.procedure.routing_enabled?
|
||||
|
|
|
@ -8,96 +8,85 @@
|
|||
|
||||
.fr-background-alt--grey.fr-p-3v
|
||||
- if etablissement.as_degraded_mode?
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label SIRET :
|
||||
.champ-content
|
||||
= render Dossiers::RowShowComponent.new(label: "SIRET") do |c|
|
||||
- c.with_value do
|
||||
%p #{pretty_siret(etablissement.siret)} #{ render Dsfr::CopyButtonComponent.new(text: etablissement.siret, title: "Copier le siret dans le presse-papier", success: "Le siret a été copié dans le presse-papier") }
|
||||
|
||||
- else
|
||||
- if etablissement.diffusable_commercialement == false && profile != 'instructeur'
|
||||
.fr-my-2v.champ-row
|
||||
.champ-content
|
||||
= render Dossiers::RowShowComponent.new(label: nil) do |c|
|
||||
- c.with_value do
|
||||
%p= t('warning_for_private_info', scope: 'views.shared.dossiers.identite_entreprise', siret: pretty_siret(etablissement.siret))
|
||||
- else
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Dénomination :
|
||||
.champ-content
|
||||
= render Dossiers::RowShowComponent.new(label: "Dénomination") do |c|
|
||||
- c.with_value do
|
||||
%p= raison_sociale_or_name(etablissement)
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label SIRET :
|
||||
.champ-content
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: "SIRET") do |c|
|
||||
- c.with_value do
|
||||
%p #{pretty_siret(etablissement.siret)} #{ render Dsfr::CopyButtonComponent.new(text: etablissement.siret, title: "Copier le siret dans le presse-papier", success: "Le siret a été copié dans le presse-papier") }
|
||||
|
||||
|
||||
- unless local_assigns[:short_identity]
|
||||
- if etablissement.siret != etablissement.entreprise.siret_siege_social
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label SIRET du siège social:
|
||||
.champ-content
|
||||
= render Dossiers::RowShowComponent.new(label: "SIRET du siège social") do |c|
|
||||
- c.with_value do
|
||||
%p
|
||||
= pretty_siret(etablissement.entreprise.siret_siege_social)
|
||||
= render Dsfr::CopyButtonComponent.new(text: etablissement.entreprise.siret_siege_social, title: "Copier le siret dans le presse-papier", success: "Le siret a été copié dans le presse-papier")
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Forme juridique :
|
||||
.champ-content
|
||||
%p= sanitize(etablissement.entreprise.forme_juridique)
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Libellé NAF :
|
||||
.champ-content
|
||||
%p= etablissement.libelle_naf
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Code NAF :
|
||||
.champ-content
|
||||
%p= etablissement.naf
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Date de création :
|
||||
.champ-content
|
||||
%p
|
||||
= try_format_date(etablissement.entreprise.date_creation)
|
||||
|
||||
- if etablissement.entreprise_etat_administratif.present?
|
||||
%span.fr-badge.fr-badge--sm{ class: entreprise_etat_administratif_badge_class(etablissement)}= humanized_entreprise_etat_administratif(etablissement)
|
||||
= render Dossiers::RowShowComponent.new(label: "Forme juridique") do |c|
|
||||
- c.with_value do
|
||||
%p= sanitize(etablissement.entreprise.forme_juridique)
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: "Libellé NAF") do |c|
|
||||
- c.with_value do
|
||||
%p= etablissement.libelle_naf
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: "Libellé NAF") do |c|
|
||||
- c.with_value do
|
||||
%p= etablissement.naf
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: "Date de création") do |c|
|
||||
- c.with_value do
|
||||
%p
|
||||
= try_format_date(etablissement.entreprise.date_creation)
|
||||
|
||||
- if etablissement.entreprise_etat_administratif.present?
|
||||
%span.fr-badge.fr-badge--sm{ class: entreprise_etat_administratif_badge_class(etablissement) }
|
||||
= humanized_entreprise_etat_administratif(etablissement)
|
||||
|
||||
- if profile == 'instructeur'
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label
|
||||
Effectif mensuel
|
||||
= try_format_mois_effectif(etablissement)
|
||||
(URSSAF) :
|
||||
.champ-content
|
||||
= render Dossiers::RowShowComponent.new(label: "Effectif mensuel #{try_format_mois_effectif(etablissement)} (URSSAF)") do |c|
|
||||
- c.with_value do
|
||||
%p= etablissement.entreprise_effectif_mensuel
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label
|
||||
Effectif moyen annuel
|
||||
= etablissement.entreprise_effectif_annuel_annee
|
||||
(URSSAF) :
|
||||
.champ-content
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: "Effectif moyen annuel #{etablissement.entreprise_effectif_annuel_annee} (URSSAF)") do |c|
|
||||
- c.with_value do
|
||||
%p= etablissement.entreprise_effectif_annuel
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Effectif de l'organisation (INSEE) :
|
||||
.champ-content
|
||||
%p
|
||||
= effectif(etablissement)
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Numéro de TVA intracommunautaire :
|
||||
.champ-content
|
||||
%p= etablissement.entreprise.numero_tva_intracommunautaire
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Adresse :
|
||||
.champ-content
|
||||
%p
|
||||
- etablissement.adresse.split("\n").compact_blank.each do |line|
|
||||
= line
|
||||
%br
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Capital social :
|
||||
.champ-content
|
||||
%p= pretty_currency(etablissement.entreprise.capital_social)
|
||||
.fr-my-2v.champ-row
|
||||
- if etablissement.exercices.any?
|
||||
%p.champ-label Chiffre d’affaires :
|
||||
.champ-content
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: "Effectif de l’organisation (INSEE)") do |c|
|
||||
- c.with_value do
|
||||
%p= effectif(etablissement)
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: "Numéro de TVA intracommunautaire") do |c|
|
||||
- c.with_value do
|
||||
%p= etablissement.entreprise.numero_tva_intracommunautaire
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: "Adresse") do |c|
|
||||
- c.with_value do
|
||||
%p
|
||||
- etablissement.adresse.split("\n").compact_blank.each do |line|
|
||||
= line
|
||||
%br
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: "Capital social") do |c|
|
||||
- c.with_value do
|
||||
%p= pretty_currency(etablissement.entreprise.capital_social)
|
||||
|
||||
- if etablissement.exercices.any?
|
||||
= render Dossiers::RowShowComponent.new(label: "Chiffre d’affaires") do |c|
|
||||
- c.with_value do
|
||||
- if profile == 'instructeur'
|
||||
%details
|
||||
- etablissement.exercices.each_with_index do |exercice, index|
|
||||
|
@ -107,7 +96,6 @@
|
|||
- elsif etablissement.exercices.present?
|
||||
= t('activemodel.models.exercices_summary', count: etablissement.exercices.count)
|
||||
|
||||
|
||||
- if etablissement.entreprise_bilans_bdf.present?
|
||||
- if profile == 'instructeur'
|
||||
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
|
||||
|
@ -121,83 +109,73 @@
|
|||
|
||||
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
|
||||
locals: { libelle: 'Besoin en fonds de roulement', key: 'besoin_en_fonds_de_roulement', etablissement: etablissement }
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label
|
||||
Chiffres financiers clés (Banque de France)
|
||||
= "en #{pretty_currency_unit(etablissement.entreprise_bilans_bdf_monnaie)} :"
|
||||
|
||||
- if controller.is_a?(Instructeurs::AvisController)
|
||||
.champ-content
|
||||
= render Dossiers::RowShowComponent.new(label: "Chiffres financiers clés (Banque de France) en #{pretty_currency_unit(etablissement.entreprise_bilans_bdf_monnaie)}") do |c|
|
||||
- c.with_value do
|
||||
- if controller.is_a?(Instructeurs::AvisController)
|
||||
%p
|
||||
Les consulter
|
||||
= link_to "au format csv", bilans_bdf_instructeur_avis_path(@avis, format: 'csv')
|
||||
,
|
||||
= link_to "au format xlsx", bilans_bdf_instructeur_avis_path(@avis, format: 'xlsx')
|
||||
ou
|
||||
= link_to "au format ods", bilans_bdf_instructeur_avis_path(@avis, format: 'ods')
|
||||
- else
|
||||
.champ-content
|
||||
Les consulter
|
||||
= link_to "au format csv", bilans_bdf_instructeur_avis_path(@avis, format: 'csv')
|
||||
,
|
||||
= link_to "au format xlsx", bilans_bdf_instructeur_avis_path(@avis, format: 'xlsx')
|
||||
ou
|
||||
= link_to "au format ods", bilans_bdf_instructeur_avis_path(@avis, format: 'ods')
|
||||
- else
|
||||
%p
|
||||
Les consulter
|
||||
= link_to "au format csv", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'csv')
|
||||
,
|
||||
= link_to "au format xlsx", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'xlsx')
|
||||
ou
|
||||
= link_to "au format ods", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'ods')
|
||||
Les consulter
|
||||
= link_to "au format csv", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'csv')
|
||||
,
|
||||
= link_to "au format xlsx", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'xlsx')
|
||||
ou
|
||||
= link_to "au format ods", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'ods')
|
||||
- else
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label
|
||||
Bilans Banque de France :
|
||||
.champ-content
|
||||
= render Dossiers::RowShowComponent.new(label: "Bilans Banque de France") do |c|
|
||||
- c.with_value do
|
||||
%p Les 3 derniers bilans connus de votre entreprise par la Banque de France ont été joints à votre dossier.
|
||||
|
||||
- if etablissement.entreprise_attestation_sociale.attached?
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Attestation sociale :
|
||||
- if profile == 'instructeur'
|
||||
.champ-content
|
||||
= render Dossiers::RowShowComponent.new(label: "Attestation sociale") do |c|
|
||||
- c.with_value do
|
||||
- if profile == 'instructeur'
|
||||
%p= link_to "Consulter l'attestation", url_for(etablissement.entreprise_attestation_sociale), **external_link_attributes
|
||||
- else
|
||||
.champ-content
|
||||
- else
|
||||
%p Une attestation de vigilance délivrée par l'ACOSS a été jointe à votre dossier.
|
||||
|
||||
- if etablissement.entreprise_attestation_fiscale.attached?
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Attestation fiscale :
|
||||
- if profile == 'instructeur'
|
||||
.champ-content
|
||||
= render Dossiers::RowShowComponent.new(label: "Attestation fiscale") do |c|
|
||||
- c.with_value do
|
||||
- if profile == 'instructeur'
|
||||
%p= link_to "Consulter l'attestation", url_for(etablissement.entreprise_attestation_fiscale), **external_link_attributes
|
||||
- else
|
||||
.champ-content
|
||||
- else
|
||||
%p Une attestation fiscale délivrée par l'URSSAF a été jointe à votre dossier.
|
||||
|
||||
- if etablissement.association?
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Numéro RNA :
|
||||
.champ-content
|
||||
= render Dossiers::RowShowComponent.new(label: "Numéro RNA") do |c|
|
||||
- c.with_value do
|
||||
%p= etablissement.association_rna
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Titre :
|
||||
.champ-content
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: "Titre") do |c|
|
||||
- c.with_value do
|
||||
%p= etablissement.association_titre
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Objet :
|
||||
.champ-content
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: "Objet") do |c|
|
||||
- c.with_value do
|
||||
%p= etablissement.association_objet
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Date de création :
|
||||
.champ-content
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: "Date de création") do |c|
|
||||
- c.with_value do
|
||||
%p= try_format_date(etablissement.association_date_creation)
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Date de publication :
|
||||
.champ-content
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: "Date de publication") do |c|
|
||||
- c.with_value do
|
||||
%p= try_format_date(etablissement.association_date_publication)
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label Date de déclaration :
|
||||
.champ-content
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: "Date de déclaration") do |c|
|
||||
- c.with_value do
|
||||
%p= try_format_date(etablissement.association_date_declaration)
|
||||
|
||||
- unless local_assigns[:short_identity]
|
||||
%p.text-center
|
||||
= link_to "➡ Autres informations sur l’organisme sur « annuaire-entreprises.data.gouv.fr » (ex: fiche d’immatriculation RNCS)",
|
||||
annuaire_link(etablissement.siret),
|
||||
**external_link_attributes
|
||||
annuaire_link(etablissement.siret),
|
||||
**external_link_attributes
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
.fr-my-2v.champ-row
|
||||
%p.champ-label= "#{libelle} :"
|
||||
.champ-content
|
||||
= render Dossiers::RowShowComponent.new(label: libelle) do |c|
|
||||
- c.with_value do
|
||||
%details
|
||||
- etablissement.entreprise_bilans_bdf.each do |bilan|
|
||||
= "#{pretty_date_exercice(year_for_bilan(bilan))} :"
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
.fr-my-2v.champ-row
|
||||
%p.champ-label= t('views.users.dossiers.identite.civility')
|
||||
.champ-content
|
||||
= render Dossiers::RowShowComponent.new(label: t('views.users.dossiers.identite.civility')) do |c|
|
||||
- c.with_value do
|
||||
%p= individual.gender
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label= t('views.users.dossiers.identite.first_name')
|
||||
.champ-content
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: t('views.users.dossiers.identite.first_name')) do |c|
|
||||
- c.with_value do
|
||||
%p= individual.prenom
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label= t('views.users.dossiers.identite.last_name')
|
||||
.champ-content
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: t('views.users.dossiers.identite.last_name')) do |c|
|
||||
- c.with_value do
|
||||
%p= individual.nom
|
||||
|
||||
- if individual.birthdate.present?
|
||||
.fr-my-2v.champ-row
|
||||
%p.champ-label= t('views.users.dossiers.identite.birthdate')
|
||||
.champ-content
|
||||
= render Dossiers::RowShowComponent.new(label: t('views.users.dossiers.identite.birthdate')) do |c|
|
||||
- c.with_value do
|
||||
%p= try_format_date(individual.birthdate)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.fr-px-2w
|
||||
.fr-px-2w.fr-mb-4w
|
||||
.fr-my-2w
|
||||
%p
|
||||
= t(:submitted_at, scope: [:views, :shared, :dossiers, :form], datetime: l(dossier.depose_at))
|
||||
|
@ -9,25 +9,18 @@
|
|||
.fr-highlight
|
||||
%p.fr-text--sm.fr-text-mention--grey Sauf mention contraire, les champs ont été saisis à la date du dépôt du dossier.
|
||||
|
||||
|
||||
- if dossier.justificatif_motivation.attached?
|
||||
-# download component already has margin bottom
|
||||
%div.champ-row
|
||||
%p.champ-label Justificatif :
|
||||
.champ-content
|
||||
= render Dossiers::RowShowComponent.new(label: "Justificatif") do |c|
|
||||
- c.with_value do
|
||||
.action
|
||||
= render Attachment::ShowComponent.new(attachment: dossier.justificatif_motivation.attachment)
|
||||
|
||||
- if dossier.motivation.present?
|
||||
.fr-mb-2w.champ-row
|
||||
%p.champ-label Motivation :
|
||||
.champ-content
|
||||
.action
|
||||
= dossier.motivation
|
||||
= render Dossiers::RowShowComponent.new(label: "Motivation") do |c|
|
||||
- c.with_value do
|
||||
= dossier.motivation
|
||||
|
||||
- if dossier.attestation.present?
|
||||
.fr-mb-2w.champ-row
|
||||
%p.champ-label Attestation :
|
||||
.champ-content
|
||||
.action
|
||||
= link_to('Voir l’attestation', attestation_instructeur_dossier_path(dossier.procedure, dossier), **external_link_attributes)
|
||||
= render Dossiers::RowShowComponent.new(label: "Attestation") do |c|
|
||||
- c.with_value do
|
||||
= link_to('Voir l’attestation', attestation_instructeur_dossier_path(dossier.procedure, dossier), **external_link_attributes)
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
.fr-my-2w.champ-row
|
||||
%p.champ-label Email :
|
||||
.champ-content
|
||||
%p= user_deleted ? "#{email} (l’usager a supprimé son compte)" : email
|
||||
= render Dossiers::RowShowComponent.new(label: 'Email', profile: @profile) do |c|
|
||||
- c.with_value do
|
||||
= user_deleted ? "#{email} (l’usager a supprimé son compte)" : email
|
||||
|
|
|
@ -15,9 +15,7 @@
|
|||
= render partial: 'shared/dossiers/demande', locals: { dossier: @dossier, demande_seen_at: nil, profile: 'usager' }
|
||||
|
||||
|
||||
.fr-container.fr-mt-2w
|
||||
.fr-grid-row.fr-grid-row--center
|
||||
.fr-col-xl-10
|
||||
- if !@dossier.read_only?
|
||||
= link_to t('views.users.dossiers.demande.edit_dossier'), modifier_dossier_path(@dossier), class: 'fr-btn fr-btn-sm', 'title'=> "Modifier mon dossier tant qu'il n'est pas passé en instruction"
|
||||
.clearfix
|
||||
- if !@dossier.read_only?
|
||||
.fr-container.fr-mt-2w
|
||||
%p= link_to t('views.users.dossiers.demande.edit_dossier'), modifier_dossier_path(@dossier), class: 'fr-btn fr-btn-sm',
|
||||
title: "Modifier mon dossier tant qu'il n'est pas passé en instruction"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue