style(demande): homogeneize "blank" champs and not attached files champs
This commit is contained in:
parent
da9f76a538
commit
1bdc6c02c6
6 changed files with 16 additions and 10 deletions
|
@ -1,3 +1,4 @@
|
||||||
---
|
---
|
||||||
en:
|
en:
|
||||||
blank: "blank (optional)"
|
blank: "blank (optional)"
|
||||||
|
blank_attachment: "document not supplied (optional)"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
---
|
---
|
||||||
fr:
|
fr:
|
||||||
blank: "non saisi (facultatif)"
|
blank: "non saisi (facultatif)"
|
||||||
|
blank_attachment: "pièce justificative non saisie (facultative)"
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
%span{ class: highlight_if_unseen_class(@demande_seen_at, champ.updated_at) }
|
%span{ class: highlight_if_unseen_class(@demande_seen_at, champ.updated_at) }
|
||||||
= t(:updated_at, scope: [:views, :shared, :dossiers, :form], datetime: try_format_datetime(champ.updated_at))
|
= t(:updated_at, scope: [:views, :shared, :dossiers, :form], datetime: try_format_datetime(champ.updated_at))
|
||||||
|
|
||||||
- if champ.blank? && ![TypeDeChamp.type_champs.fetch(:piece_justificative), TypeDeChamp.type_champs.fetch(:titre_identite)].include?(champ.type_champ)
|
- if champ.blank?
|
||||||
.champ-content.fr-text-mention--grey{ class: [highlight_if_unseen_class(@demande_seen_at, champ.updated_at), champ.type_champ] }
|
.champ-content.fr-text-mention--grey{ class: [highlight_if_unseen_class(@demande_seen_at, champ.updated_at), champ.type_champ] }
|
||||||
%p
|
%p
|
||||||
%em= t('.blank')
|
%em= t(champ.type_de_champ.piece_justificative? ? '.blank_attachment' : '.blank')
|
||||||
- else
|
- else
|
||||||
.champ-content{ class: [highlight_if_unseen_class(@demande_seen_at, champ.updated_at), champ.type_champ] }
|
.champ-content{ class: [highlight_if_unseen_class(@demande_seen_at, champ.updated_at), champ.type_champ] }
|
||||||
- case champ.type_champ
|
- case champ.type_champ
|
||||||
|
|
|
@ -43,6 +43,10 @@ class Champs::PieceJustificativeChamp < Champ
|
||||||
mandatory? && !piece_justificative_file.attached?
|
mandatory? && !piece_justificative_file.attached?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def blank?
|
||||||
|
piece_justificative_file.blank?
|
||||||
|
end
|
||||||
|
|
||||||
def for_export
|
def for_export
|
||||||
piece_justificative_file.map { _1.filename.to_s }.join(', ')
|
piece_justificative_file.map { _1.filename.to_s }.join(', ')
|
||||||
end
|
end
|
||||||
|
|
|
@ -37,6 +37,10 @@ class Champs::TitreIdentiteChamp < Champ
|
||||||
mandatory? && !piece_justificative_file.attached?
|
mandatory? && !piece_justificative_file.attached?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def blank?
|
||||||
|
piece_justificative_file.blank?
|
||||||
|
end
|
||||||
|
|
||||||
def for_export
|
def for_export
|
||||||
piece_justificative_file.attached? ? "présent" : "absent"
|
piece_justificative_file.attached? ? "présent" : "absent"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
- pj = champ.piece_justificative_file
|
.fr-downloads-group
|
||||||
- if pj.attached?
|
%ul
|
||||||
.fr-downloads-group
|
- champ.piece_justificative_file.attachments.each do |attachment|
|
||||||
%ul
|
%li= render Attachment::ShowComponent.new(attachment:, new_tab: true)
|
||||||
- pj.attachments.each do |attachment|
|
|
||||||
%li= render Attachment::ShowComponent.new(attachment:, new_tab: true)
|
|
||||||
- else
|
|
||||||
Pièce justificative non fournie
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue