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,6 +6,8 @@
|
||||||
@media (min-width: 48em) {
|
@media (min-width: 48em) {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.champ-label {
|
.champ-label {
|
||||||
|
@ -20,7 +22,6 @@
|
||||||
|
|
||||||
.champ-content {
|
.champ-content {
|
||||||
padding: 0 0 0.5rem;
|
padding: 0 0 0.5rem;
|
||||||
color: var(--text-action-high--grey);
|
|
||||||
|
|
||||||
@media (min-width: 48em) {
|
@media (min-width: 48em) {
|
||||||
flex: 4;
|
flex: 4;
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
class Dossiers::ChampRowShowComponent < ApplicationComponent
|
class Dossiers::ChampsRowsShowComponent < ApplicationComponent
|
||||||
include ChampHelper
|
attr_reader :profile
|
||||||
include DossierHelper
|
attr_reader :seen_at
|
||||||
include ApplicationHelper
|
|
||||||
|
|
||||||
def initialize(champs:, demande_seen_at:, profile:, repetition:)
|
def initialize(champs:, profile:, seen_at:)
|
||||||
@repetition = repetition
|
|
||||||
@champs = champs
|
@champs = champs
|
||||||
@demande_seen_at = demande_seen_at
|
@seen_at = seen_at
|
||||||
@profile = profile
|
@profile = profile
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -22,8 +20,7 @@ class Dossiers::ChampRowShowComponent < ApplicationComponent
|
||||||
end
|
end
|
||||||
|
|
||||||
def blank_key(champ)
|
def blank_key(champ)
|
||||||
key = ".blank"
|
key = ".blank_optional"
|
||||||
key += "_optional" if @profile == "usager"
|
|
||||||
key += "_attachment" if champ.type_de_champ.piece_justificative?
|
key += "_attachment" if champ.type_de_champ.piece_justificative?
|
||||||
|
|
||||||
key
|
key
|
||||||
|
@ -32,14 +29,4 @@ class Dossiers::ChampRowShowComponent < ApplicationComponent
|
||||||
def each_champ(&block)
|
def each_champ(&block)
|
||||||
@champs.filter { _1.visible? && !_1.exclude_from_view? && !_1.header_section? }.each(&block)
|
@champs.filter { _1.visible? && !_1.exclude_from_view? && !_1.header_section? }.each(&block)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def usager?
|
|
||||||
@profile == 'usager'
|
|
||||||
end
|
|
||||||
|
|
||||||
def instructeur?
|
|
||||||
@profile == 'instructeur'
|
|
||||||
end
|
|
||||||
end
|
end
|
|
@ -1,6 +1,4 @@
|
||||||
---
|
---
|
||||||
en:
|
en:
|
||||||
blank: "empty"
|
|
||||||
blank_attachment: "document not supplied"
|
|
||||||
blank_optional: "empty (optional)"
|
blank_optional: "empty (optional)"
|
||||||
blank_optional_attachment: "document not supplied (optional)"
|
blank_optional_attachment: "document not supplied (optional)"
|
|
@ -1,6 +1,4 @@
|
||||||
---
|
---
|
||||||
fr:
|
fr:
|
||||||
blank: "non saisi"
|
|
||||||
blank_attachment: "pièce justificative non saisie"
|
|
||||||
blank_optional: "non saisi (facultatif)"
|
blank_optional: "non saisi (facultatif)"
|
||||||
blank_optional_attachment: "pièce justificative non saisie (facultative)"
|
blank_optional_attachment: "pièce justificative non saisie (facultative)"
|
|
@ -4,26 +4,15 @@
|
||||||
.fr-background-alt--grey.fr-p-2w.fr-my-3w.fr-ml-2w.champ-repetition
|
.fr-background-alt--grey.fr-p-2w.fr-my-3w.fr-ml-2w.champ-repetition
|
||||||
%p.font-weight-bold= "#{champ.libelle} #{i + 1} :"
|
%p.font-weight-bold= "#{champ.libelle} #{i + 1} :"
|
||||||
|
|
||||||
= render Dossiers::ChampRowShowComponent.new(champs: row, demande_seen_at: @demande_seen_at, profile: @profile, repetition: true)
|
= render Dossiers::ChampsRowsShowComponent.new(champs: row, seen_at:, profile:)
|
||||||
|
|
||||||
- else
|
- else
|
||||||
.fr-px-2w.fr-my-2w.champ-row
|
= render Dossiers::RowShowComponent.new(label: champ.libelle, seen_at:, profile:, content_class: champ.type_champ, updated_at: updated_after_deposer?(champ) ? champ.updated_at : nil) do |c|
|
||||||
%p.champ-label= "#{champ.libelle} :"
|
|
||||||
|
|
||||||
- if champ.blank?
|
- if champ.blank?
|
||||||
.champ-content.fr-text-mention--grey{ class: champ.type_champ }
|
- c.blank do
|
||||||
- if usager?
|
= t(blank_key(champ))
|
||||||
%p
|
|
||||||
%em= t(blank_key(champ))
|
|
||||||
|
|
||||||
- else
|
- else
|
||||||
.champ-content{ class: champ.type_champ }
|
- c.with_value do
|
||||||
|
|
||||||
- if updated_after_deposer?(champ)
|
|
||||||
%p.fr-mb-1v.fr-ml-3v.champ-updated
|
|
||||||
%span.fr-badge.fr-badge--sm{ class: badge_class_if_unseen(@demande_seen_at, champ.updated_at) }
|
|
||||||
= t(:updated_at, scope: [:views, :shared, :dossiers, :form], datetime: try_format_datetime(champ.updated_at, format: :veryshort))
|
|
||||||
|
|
||||||
- case champ.type_champ
|
- case champ.type_champ
|
||||||
- when TypeDeChamp.type_champs.fetch(:carte)
|
- when TypeDeChamp.type_champs.fetch(:carte)
|
||||||
= render partial: "shared/champs/carte/show", locals: { champ: champ }
|
= render partial: "shared/champs/carte/show", locals: { champ: champ }
|
||||||
|
@ -64,7 +53,7 @@
|
||||||
- when TypeDeChamp.type_champs.fetch(:datetime)
|
- when TypeDeChamp.type_champs.fetch(:datetime)
|
||||||
%p= champ.to_s
|
%p= champ.to_s
|
||||||
- when TypeDeChamp.type_champs.fetch(:number), TypeDeChamp.type_champs.fetch(:integer_number), TypeDeChamp.type_champs.fetch(:decimal_number)
|
- when TypeDeChamp.type_champs.fetch(:number), TypeDeChamp.type_champs.fetch(:integer_number), TypeDeChamp.type_champs.fetch(:decimal_number)
|
||||||
%p= number_with_html_delimiter(champ.to_s)
|
%p= helpers.number_with_html_delimiter(champ.to_s)
|
||||||
- else
|
- else
|
||||||
= format_text_value(champ.to_s.strip) # format already wrap in p
|
= helpers.format_text_value(champ.to_s.strip) # format already wrap in p
|
||||||
|
|
17
app/components/dossiers/row_show_component.html.haml
Normal file
17
app/components/dossiers/row_show_component.html.haml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
.champ-row
|
||||||
|
%p.champ-label= "#{label} :"
|
||||||
|
|
||||||
|
- if blank?
|
||||||
|
.champ-content.fr-text-mention--grey{ class: content_class }
|
||||||
|
- if usager?
|
||||||
|
%p
|
||||||
|
%em= blank
|
||||||
|
|
||||||
|
- else
|
||||||
|
.champ-content{ class: content_class }
|
||||||
|
- if updated_at.present?
|
||||||
|
%p.fr-mb-1v.fr-ml-3v.champ-updated
|
||||||
|
%span{ class: badge_updated_class }
|
||||||
|
= t(:updated_at, scope: [:views, :shared, :dossiers, :form], datetime: helpers.try_format_datetime(updated_at, format: :veryshort))
|
||||||
|
|
||||||
|
= value
|
29
app/components/dossiers/row_show_component.rb
Normal file
29
app/components/dossiers/row_show_component.rb
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
class Dossiers::RowShowComponent < ApplicationComponent
|
||||||
|
attr_reader :label
|
||||||
|
attr_reader :profile
|
||||||
|
attr_reader :updated_at
|
||||||
|
attr_reader :seen_at
|
||||||
|
attr_reader :content_class
|
||||||
|
|
||||||
|
renders_one :value
|
||||||
|
renders_one :blank
|
||||||
|
|
||||||
|
def initialize(label:, profile: nil, updated_at: nil, seen_at: nil, content_class: nil)
|
||||||
|
@label = label
|
||||||
|
@profile = profile
|
||||||
|
@updated_at = updated_at
|
||||||
|
@seen_at = seen_at
|
||||||
|
@content_class = content_class
|
||||||
|
end
|
||||||
|
|
||||||
|
def badge_updated_class
|
||||||
|
class_names(
|
||||||
|
"fr-badge fr-badge--sm" => true,
|
||||||
|
"fr-badge--new" => seen_at.present? && updated_at&.>(seen_at)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
def usager?
|
||||||
|
@profile == 'usager'
|
||||||
|
end
|
||||||
|
end
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
%div{ id: section_id, 'data-expand-target': 'content' }
|
%div{ id: section_id, 'data-expand-target': 'content' }
|
||||||
- if !champs.empty?
|
- if !champs.empty?
|
||||||
= render Dossiers::ChampRowShowComponent.new(champs: champs, demande_seen_at: @demande_seen_at, profile: @profile, repetition: false)
|
= render Dossiers::ChampsRowsShowComponent.new(champs: champs, seen_at: @demande_seen_at, profile: @profile)
|
||||||
|
|
||||||
- sections.each do |section|
|
- sections.each do |section|
|
||||||
= render section
|
= render section
|
||||||
|
|
|
@ -17,13 +17,6 @@ module DossierHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def badge_class_if_unseen(seen_at, updated_at)
|
|
||||||
return if updated_at.blank? || seen_at.blank?
|
|
||||||
return if seen_at > updated_at
|
|
||||||
|
|
||||||
"fr-badge--new"
|
|
||||||
end
|
|
||||||
|
|
||||||
def url_for_dossier(dossier)
|
def url_for_dossier(dossier)
|
||||||
if dossier.brouillon?
|
if dossier.brouillon?
|
||||||
brouillon_dossier_path(dossier)
|
brouillon_dossier_path(dossier)
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
.fr-grid-row.fr-grid-row--center
|
.fr-grid-row.fr-grid-row--center
|
||||||
.fr-col-12
|
.fr-col-12
|
||||||
%h2.fr-h6.fr-background-alt--grey.fr-mb-0
|
%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?
|
- if dossier.depose_at.present?
|
||||||
= render partial: "shared/dossiers/infos_generales", locals: { dossier: dossier }
|
= render partial: "shared/dossiers/infos_generales", locals: { dossier: dossier }
|
||||||
|
|
||||||
.tab-title
|
.tab-title
|
||||||
%h2.fr-h6.fr-background-alt--grey.fr-mb-0.flex
|
%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')
|
= t('views.shared.dossiers.demande.requester_identity')
|
||||||
|
|
||||||
- if dossier.identity_updated_at.present? && demande_seen_at&.<(dossier.identity_updated_at)
|
- 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'
|
= 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 }
|
= 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
|
%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
|
- champs = dossier.champs_public
|
||||||
- if champs.any? || dossier.procedure.routing_enabled?
|
- if champs.any? || dossier.procedure.routing_enabled?
|
||||||
|
|
|
@ -8,96 +8,85 @@
|
||||||
|
|
||||||
.fr-background-alt--grey.fr-p-3v
|
.fr-background-alt--grey.fr-p-3v
|
||||||
- if etablissement.as_degraded_mode?
|
- if etablissement.as_degraded_mode?
|
||||||
.fr-my-2v.champ-row
|
= render Dossiers::RowShowComponent.new(label: "SIRET") do |c|
|
||||||
%p.champ-label SIRET :
|
- c.with_value do
|
||||||
.champ-content
|
|
||||||
%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") }
|
%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
|
- else
|
||||||
- if etablissement.diffusable_commercialement == false && profile != 'instructeur'
|
- if etablissement.diffusable_commercialement == false && profile != 'instructeur'
|
||||||
.fr-my-2v.champ-row
|
= render Dossiers::RowShowComponent.new(label: nil) do |c|
|
||||||
.champ-content
|
- c.with_value do
|
||||||
%p= t('warning_for_private_info', scope: 'views.shared.dossiers.identite_entreprise', siret: pretty_siret(etablissement.siret))
|
%p= t('warning_for_private_info', scope: 'views.shared.dossiers.identite_entreprise', siret: pretty_siret(etablissement.siret))
|
||||||
- else
|
- else
|
||||||
.fr-my-2v.champ-row
|
= render Dossiers::RowShowComponent.new(label: "Dénomination") do |c|
|
||||||
%p.champ-label Dénomination :
|
- c.with_value do
|
||||||
.champ-content
|
|
||||||
%p= raison_sociale_or_name(etablissement)
|
%p= raison_sociale_or_name(etablissement)
|
||||||
.fr-my-2v.champ-row
|
|
||||||
%p.champ-label SIRET :
|
= render Dossiers::RowShowComponent.new(label: "SIRET") do |c|
|
||||||
.champ-content
|
- 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") }
|
%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]
|
- unless local_assigns[:short_identity]
|
||||||
- if etablissement.siret != etablissement.entreprise.siret_siege_social
|
- if etablissement.siret != etablissement.entreprise.siret_siege_social
|
||||||
.fr-my-2v.champ-row
|
= render Dossiers::RowShowComponent.new(label: "SIRET du siège social") do |c|
|
||||||
%p.champ-label SIRET du siège social:
|
- c.with_value do
|
||||||
.champ-content
|
|
||||||
%p
|
%p
|
||||||
= pretty_siret(etablissement.entreprise.siret_siege_social)
|
= 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")
|
= 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?
|
= render Dossiers::RowShowComponent.new(label: "Forme juridique") do |c|
|
||||||
%span.fr-badge.fr-badge--sm{ class: entreprise_etat_administratif_badge_class(etablissement)}= humanized_entreprise_etat_administratif(etablissement)
|
- 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'
|
- if profile == 'instructeur'
|
||||||
.fr-my-2v.champ-row
|
= render Dossiers::RowShowComponent.new(label: "Effectif mensuel #{try_format_mois_effectif(etablissement)} (URSSAF)") do |c|
|
||||||
%p.champ-label
|
- c.with_value do
|
||||||
Effectif mensuel
|
|
||||||
= try_format_mois_effectif(etablissement)
|
|
||||||
(URSSAF) :
|
|
||||||
.champ-content
|
|
||||||
%p= etablissement.entreprise_effectif_mensuel
|
%p= etablissement.entreprise_effectif_mensuel
|
||||||
.fr-my-2v.champ-row
|
|
||||||
%p.champ-label
|
= render Dossiers::RowShowComponent.new(label: "Effectif moyen annuel #{etablissement.entreprise_effectif_annuel_annee} (URSSAF)") do |c|
|
||||||
Effectif moyen annuel
|
- c.with_value do
|
||||||
= etablissement.entreprise_effectif_annuel_annee
|
|
||||||
(URSSAF) :
|
|
||||||
.champ-content
|
|
||||||
%p= etablissement.entreprise_effectif_annuel
|
%p= etablissement.entreprise_effectif_annuel
|
||||||
.fr-my-2v.champ-row
|
|
||||||
%p.champ-label Effectif de l'organisation (INSEE) :
|
= render Dossiers::RowShowComponent.new(label: "Effectif de l’organisation (INSEE)") do |c|
|
||||||
.champ-content
|
- c.with_value do
|
||||||
%p
|
%p= effectif(etablissement)
|
||||||
= effectif(etablissement)
|
|
||||||
.fr-my-2v.champ-row
|
= render Dossiers::RowShowComponent.new(label: "Numéro de TVA intracommunautaire") do |c|
|
||||||
%p.champ-label Numéro de TVA intracommunautaire :
|
- c.with_value do
|
||||||
.champ-content
|
%p= etablissement.entreprise.numero_tva_intracommunautaire
|
||||||
%p= etablissement.entreprise.numero_tva_intracommunautaire
|
|
||||||
.fr-my-2v.champ-row
|
= render Dossiers::RowShowComponent.new(label: "Adresse") do |c|
|
||||||
%p.champ-label Adresse :
|
- c.with_value do
|
||||||
.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
|
|
||||||
%p
|
%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'
|
- if profile == 'instructeur'
|
||||||
%details
|
%details
|
||||||
- etablissement.exercices.each_with_index do |exercice, index|
|
- etablissement.exercices.each_with_index do |exercice, index|
|
||||||
|
@ -107,7 +96,6 @@
|
||||||
- elsif etablissement.exercices.present?
|
- elsif etablissement.exercices.present?
|
||||||
= t('activemodel.models.exercices_summary', count: etablissement.exercices.count)
|
= t('activemodel.models.exercices_summary', count: etablissement.exercices.count)
|
||||||
|
|
||||||
|
|
||||||
- if etablissement.entreprise_bilans_bdf.present?
|
- if etablissement.entreprise_bilans_bdf.present?
|
||||||
- if profile == 'instructeur'
|
- if profile == 'instructeur'
|
||||||
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
|
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
|
||||||
|
@ -121,83 +109,73 @@
|
||||||
|
|
||||||
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
|
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
|
||||||
locals: { libelle: 'Besoin en fonds de roulement', key: 'besoin_en_fonds_de_roulement', etablissement: etablissement }
|
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)
|
= render Dossiers::RowShowComponent.new(label: "Chiffres financiers clés (Banque de France) en #{pretty_currency_unit(etablissement.entreprise_bilans_bdf_monnaie)}") do |c|
|
||||||
.champ-content
|
- c.with_value do
|
||||||
|
- if controller.is_a?(Instructeurs::AvisController)
|
||||||
%p
|
%p
|
||||||
Les consulter
|
Les consulter
|
||||||
= link_to "au format csv", bilans_bdf_instructeur_avis_path(@avis, format: 'csv')
|
= 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')
|
= link_to "au format xlsx", bilans_bdf_instructeur_avis_path(@avis, format: 'xlsx')
|
||||||
ou
|
ou
|
||||||
= link_to "au format ods", bilans_bdf_instructeur_avis_path(@avis, format: 'ods')
|
= link_to "au format ods", bilans_bdf_instructeur_avis_path(@avis, format: 'ods')
|
||||||
- else
|
- else
|
||||||
.champ-content
|
|
||||||
%p
|
%p
|
||||||
Les consulter
|
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 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')
|
= link_to "au format xlsx", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'xlsx')
|
||||||
ou
|
ou
|
||||||
= link_to "au format ods", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'ods')
|
= link_to "au format ods", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'ods')
|
||||||
- else
|
- else
|
||||||
.fr-my-2v.champ-row
|
= render Dossiers::RowShowComponent.new(label: "Bilans Banque de France") do |c|
|
||||||
%p.champ-label
|
- c.with_value do
|
||||||
Bilans Banque de France :
|
|
||||||
.champ-content
|
|
||||||
%p Les 3 derniers bilans connus de votre entreprise par la Banque de France ont été joints à votre dossier.
|
%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?
|
- if etablissement.entreprise_attestation_sociale.attached?
|
||||||
.fr-my-2v.champ-row
|
= render Dossiers::RowShowComponent.new(label: "Attestation sociale") do |c|
|
||||||
%p.champ-label Attestation sociale :
|
- c.with_value do
|
||||||
- if profile == 'instructeur'
|
- if profile == 'instructeur'
|
||||||
.champ-content
|
|
||||||
%p= link_to "Consulter l'attestation", url_for(etablissement.entreprise_attestation_sociale), **external_link_attributes
|
%p= link_to "Consulter l'attestation", url_for(etablissement.entreprise_attestation_sociale), **external_link_attributes
|
||||||
- else
|
- else
|
||||||
.champ-content
|
|
||||||
%p Une attestation de vigilance délivrée par l'ACOSS a été jointe à votre dossier.
|
%p Une attestation de vigilance délivrée par l'ACOSS a été jointe à votre dossier.
|
||||||
|
|
||||||
- if etablissement.entreprise_attestation_fiscale.attached?
|
- if etablissement.entreprise_attestation_fiscale.attached?
|
||||||
.fr-my-2v.champ-row
|
= render Dossiers::RowShowComponent.new(label: "Attestation fiscale") do |c|
|
||||||
%p.champ-label Attestation fiscale :
|
- c.with_value do
|
||||||
- if profile == 'instructeur'
|
- if profile == 'instructeur'
|
||||||
.champ-content
|
|
||||||
%p= link_to "Consulter l'attestation", url_for(etablissement.entreprise_attestation_fiscale), **external_link_attributes
|
%p= link_to "Consulter l'attestation", url_for(etablissement.entreprise_attestation_fiscale), **external_link_attributes
|
||||||
- else
|
- else
|
||||||
.champ-content
|
|
||||||
%p Une attestation fiscale délivrée par l'URSSAF a été jointe à votre dossier.
|
%p Une attestation fiscale délivrée par l'URSSAF a été jointe à votre dossier.
|
||||||
|
|
||||||
- if etablissement.association?
|
- if etablissement.association?
|
||||||
.fr-my-2v.champ-row
|
= render Dossiers::RowShowComponent.new(label: "Numéro RNA") do |c|
|
||||||
%p.champ-label Numéro RNA :
|
- c.with_value do
|
||||||
.champ-content
|
|
||||||
%p= etablissement.association_rna
|
%p= etablissement.association_rna
|
||||||
.fr-my-2v.champ-row
|
|
||||||
%p.champ-label Titre :
|
= render Dossiers::RowShowComponent.new(label: "Titre") do |c|
|
||||||
.champ-content
|
- c.with_value do
|
||||||
%p= etablissement.association_titre
|
%p= etablissement.association_titre
|
||||||
.fr-my-2v.champ-row
|
|
||||||
%p.champ-label Objet :
|
= render Dossiers::RowShowComponent.new(label: "Objet") do |c|
|
||||||
.champ-content
|
- c.with_value do
|
||||||
%p= etablissement.association_objet
|
%p= etablissement.association_objet
|
||||||
.fr-my-2v.champ-row
|
|
||||||
%p.champ-label Date de création :
|
= render Dossiers::RowShowComponent.new(label: "Date de création") do |c|
|
||||||
.champ-content
|
- c.with_value do
|
||||||
%p= try_format_date(etablissement.association_date_creation)
|
%p= try_format_date(etablissement.association_date_creation)
|
||||||
.fr-my-2v.champ-row
|
|
||||||
%p.champ-label Date de publication :
|
= render Dossiers::RowShowComponent.new(label: "Date de publication") do |c|
|
||||||
.champ-content
|
- c.with_value do
|
||||||
%p= try_format_date(etablissement.association_date_publication)
|
%p= try_format_date(etablissement.association_date_publication)
|
||||||
.fr-my-2v.champ-row
|
|
||||||
%p.champ-label Date de déclaration :
|
= render Dossiers::RowShowComponent.new(label: "Date de déclaration") do |c|
|
||||||
.champ-content
|
- c.with_value do
|
||||||
%p= try_format_date(etablissement.association_date_declaration)
|
%p= try_format_date(etablissement.association_date_declaration)
|
||||||
|
|
||||||
- unless local_assigns[:short_identity]
|
- unless local_assigns[:short_identity]
|
||||||
%p.text-center
|
%p.text-center
|
||||||
= link_to "➡ Autres informations sur l’organisme sur « annuaire-entreprises.data.gouv.fr » (ex: fiche d’immatriculation RNCS)",
|
= link_to "➡ Autres informations sur l’organisme sur « annuaire-entreprises.data.gouv.fr » (ex: fiche d’immatriculation RNCS)",
|
||||||
annuaire_link(etablissement.siret),
|
annuaire_link(etablissement.siret),
|
||||||
**external_link_attributes
|
**external_link_attributes
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
.fr-my-2v.champ-row
|
= render Dossiers::RowShowComponent.new(label: libelle) do |c|
|
||||||
%p.champ-label= "#{libelle} :"
|
- c.with_value do
|
||||||
.champ-content
|
|
||||||
%details
|
%details
|
||||||
- etablissement.entreprise_bilans_bdf.each do |bilan|
|
- etablissement.entreprise_bilans_bdf.each do |bilan|
|
||||||
= "#{pretty_date_exercice(year_for_bilan(bilan))} :"
|
= "#{pretty_date_exercice(year_for_bilan(bilan))} :"
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
.fr-my-2v.champ-row
|
= render Dossiers::RowShowComponent.new(label: t('views.users.dossiers.identite.civility')) do |c|
|
||||||
%p.champ-label= t('views.users.dossiers.identite.civility')
|
- c.with_value do
|
||||||
.champ-content
|
|
||||||
%p= individual.gender
|
%p= individual.gender
|
||||||
.fr-my-2v.champ-row
|
|
||||||
%p.champ-label= t('views.users.dossiers.identite.first_name')
|
= render Dossiers::RowShowComponent.new(label: t('views.users.dossiers.identite.first_name')) do |c|
|
||||||
.champ-content
|
- c.with_value do
|
||||||
%p= individual.prenom
|
%p= individual.prenom
|
||||||
.fr-my-2v.champ-row
|
|
||||||
%p.champ-label= t('views.users.dossiers.identite.last_name')
|
= render Dossiers::RowShowComponent.new(label: t('views.users.dossiers.identite.last_name')) do |c|
|
||||||
.champ-content
|
- c.with_value do
|
||||||
%p= individual.nom
|
%p= individual.nom
|
||||||
|
|
||||||
- if individual.birthdate.present?
|
- if individual.birthdate.present?
|
||||||
.fr-my-2v.champ-row
|
= render Dossiers::RowShowComponent.new(label: t('views.users.dossiers.identite.birthdate')) do |c|
|
||||||
%p.champ-label= t('views.users.dossiers.identite.birthdate')
|
- c.with_value do
|
||||||
.champ-content
|
|
||||||
%p= try_format_date(individual.birthdate)
|
%p= try_format_date(individual.birthdate)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.fr-px-2w
|
.fr-px-2w.fr-mb-4w
|
||||||
.fr-my-2w
|
.fr-my-2w
|
||||||
%p
|
%p
|
||||||
= t(:submitted_at, scope: [:views, :shared, :dossiers, :form], datetime: l(dossier.depose_at))
|
= t(:submitted_at, scope: [:views, :shared, :dossiers, :form], datetime: l(dossier.depose_at))
|
||||||
|
@ -9,25 +9,18 @@
|
||||||
.fr-highlight
|
.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.
|
%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?
|
- if dossier.justificatif_motivation.attached?
|
||||||
-# download component already has margin bottom
|
= render Dossiers::RowShowComponent.new(label: "Justificatif") do |c|
|
||||||
%div.champ-row
|
- c.with_value do
|
||||||
%p.champ-label Justificatif :
|
|
||||||
.champ-content
|
|
||||||
.action
|
.action
|
||||||
= render Attachment::ShowComponent.new(attachment: dossier.justificatif_motivation.attachment)
|
= render Attachment::ShowComponent.new(attachment: dossier.justificatif_motivation.attachment)
|
||||||
|
|
||||||
- if dossier.motivation.present?
|
- if dossier.motivation.present?
|
||||||
.fr-mb-2w.champ-row
|
= render Dossiers::RowShowComponent.new(label: "Motivation") do |c|
|
||||||
%p.champ-label Motivation :
|
- c.with_value do
|
||||||
.champ-content
|
= dossier.motivation
|
||||||
.action
|
|
||||||
= dossier.motivation
|
|
||||||
|
|
||||||
- if dossier.attestation.present?
|
- if dossier.attestation.present?
|
||||||
.fr-mb-2w.champ-row
|
= render Dossiers::RowShowComponent.new(label: "Attestation") do |c|
|
||||||
%p.champ-label Attestation :
|
- c.with_value do
|
||||||
.champ-content
|
= link_to('Voir l’attestation', attestation_instructeur_dossier_path(dossier.procedure, dossier), **external_link_attributes)
|
||||||
.action
|
|
||||||
= link_to('Voir l’attestation', attestation_instructeur_dossier_path(dossier.procedure, dossier), **external_link_attributes)
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
.fr-my-2w.champ-row
|
= render Dossiers::RowShowComponent.new(label: 'Email', profile: @profile) do |c|
|
||||||
%p.champ-label Email :
|
- c.with_value do
|
||||||
.champ-content
|
= user_deleted ? "#{email} (l’usager a supprimé son compte)" : email
|
||||||
%p= 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' }
|
= render partial: 'shared/dossiers/demande', locals: { dossier: @dossier, demande_seen_at: nil, profile: 'usager' }
|
||||||
|
|
||||||
|
|
||||||
.fr-container.fr-mt-2w
|
- if !@dossier.read_only?
|
||||||
.fr-grid-row.fr-grid-row--center
|
.fr-container.fr-mt-2w
|
||||||
.fr-col-xl-10
|
%p= link_to t('views.users.dossiers.demande.edit_dossier'), modifier_dossier_path(@dossier), class: 'fr-btn fr-btn-sm',
|
||||||
- if !@dossier.read_only?
|
title: "Modifier mon dossier tant qu'il n'est pas passé en instruction"
|
||||||
= 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
|
|
||||||
|
|
Loading…
Reference in a new issue