Merge pull request #10993 from demarches-simplifiees/a11y-specific-fields
ETQ usager, je veux que le titre du modèle de pièce jointe reprenne l'intitulé visible
This commit is contained in:
commit
83c942c338
14 changed files with 18 additions and 14 deletions
|
@ -9,7 +9,7 @@ class Dsfr::DownloadComponent < ApplicationComponent
|
|||
attr_reader :new_tab
|
||||
attr_reader :truncate
|
||||
|
||||
def initialize(attachment:, name: nil, url: nil, ephemeral_link: false, virus_not_analyzed: false, new_tab: false, truncate: false)
|
||||
def initialize(attachment:, name: nil, url: nil, ephemeral_link: false, virus_not_analyzed: false, new_tab: false, truncate: false, title: nil)
|
||||
@attachment = attachment
|
||||
@name = name || attachment.filename.to_s
|
||||
@url = url
|
||||
|
@ -17,10 +17,11 @@ class Dsfr::DownloadComponent < ApplicationComponent
|
|||
@virus_not_analyzed = virus_not_analyzed
|
||||
@new_tab = new_tab
|
||||
@truncate = truncate
|
||||
@title = title
|
||||
end
|
||||
|
||||
def title
|
||||
t(".title", filename: attachment.filename.to_s)
|
||||
@title || t(".title", filename: attachment.filename.to_s)
|
||||
end
|
||||
|
||||
def url
|
||||
|
|
|
@ -3,5 +3,4 @@ en:
|
|||
changes_to_save: "modifications to submit"
|
||||
modified_at: "modified on %{datetime}"
|
||||
check_content_rebased: "Information: field updated by administration. Check its content."
|
||||
optional_champ: (optional)
|
||||
recommended_size: The recommended maximum size is %{size} characters.
|
||||
|
|
|
@ -3,5 +3,4 @@ fr:
|
|||
changes_to_save: "modification à déposer"
|
||||
modified_at: "modifié le %{datetime}"
|
||||
check_content_rebased: "Information : champ actualisé par l'administration. Vérifier son contenu."
|
||||
optional_champ: (facultatif)
|
||||
recommended_size: La taille maximale conseillée est de %{size} caractères.
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
%span.updated-at{ class: highlight_if_unseen_class }
|
||||
= t('.modified_at', datetime: try_format_datetime(@champ.updated_at))
|
||||
|
||||
|
||||
- if @champ.rebased_at.present? && @champ.rebased_at > (@seen_at || @champ.updated_at) && current_user.owns_or_invite?(@champ.dossier)
|
||||
%span.updated-at.highlighted
|
||||
= t('.check_content_rebased')
|
||||
|
|
|
@ -1 +1 @@
|
|||
= render Dsfr::DownloadComponent.new(attachment: champ.type_de_champ.piece_justificative_template, url: champs_piece_justificative_template_path(champ.dossier, champ.stable_id, row_id: champ.row_id), name: "Modèle à télécharger", ephemeral_link: administrateur_signed_in? )
|
||||
= render Dsfr::DownloadComponent.new(attachment: champ.type_de_champ.piece_justificative_template, url: champs_piece_justificative_template_path(champ.dossier, champ.stable_id, row_id: champ.row_id), name: t('views.shared.piece_justificative.name'), ephemeral_link: administrateur_signed_in?, title: t('views.shared.piece_justificative.title', filename: champ.type_de_champ.piece_justificative_template.blob.filename.to_s) )
|
||||
|
|
|
@ -4,4 +4,4 @@ en:
|
|||
champs/carte_champ:
|
||||
hints:
|
||||
value_html: |
|
||||
Need help ? <a href="https://doc.demarches-simplifiees.fr/pour-aller-plus-loin/cartographie" target="_blank" rel="noreferrer">Check our video tutorial</a>"
|
||||
Need help ? <a href="https://doc.demarches-simplifiees.fr/pour-aller-plus-loin/cartographie" target="_blank" rel="noreferrer">Check our video tutorial</a>
|
||||
|
|
|
@ -3,4 +3,4 @@ en:
|
|||
attributes:
|
||||
champs/decimal_number_champ:
|
||||
hints:
|
||||
value: "You can enter up to 3 decimal places after the decimal point. Exemple: 3.141"
|
||||
value: "You can enter up to 3 decimal places after the decimal point. Example: 3.141"
|
||||
|
|
|
@ -9,4 +9,4 @@ en:
|
|||
attributes:
|
||||
champs/iban_champ:
|
||||
hints:
|
||||
value: "Example (France) : FR76 1234 1234 1234 1234 1234 123"
|
||||
value: "Example (France): FR76 1234 1234 1234 1234 1234 123"
|
||||
|
|
|
@ -3,4 +3,4 @@ en:
|
|||
attributes:
|
||||
champs/phone_champ:
|
||||
hints:
|
||||
value: "Phone number must be valid. Example : 0612345678"
|
||||
value: "Phone number must be valid. Example: 0612345678"
|
||||
|
|
|
@ -15,4 +15,4 @@ en:
|
|||
attributes:
|
||||
champs/rna_champ:
|
||||
hints:
|
||||
value: "Expected format : W123456789. Exemple : W503726238"
|
||||
value: "Expected format: W123456789. Example: W503726238"
|
||||
|
|
|
@ -3,4 +3,4 @@ en:
|
|||
attributes:
|
||||
champs/siret_champ:
|
||||
hints:
|
||||
value: "Enter 14 digits. Example : 500 0012 345 6789"
|
||||
value: "Enter 14 digits. Example: 500 0012 345 6789"
|
||||
|
|
|
@ -23,3 +23,6 @@ en:
|
|||
signin: 'Sign in'
|
||||
messages:
|
||||
remove_file: 'Remove file'
|
||||
piece_justificative:
|
||||
name: "Download template"
|
||||
title: "Download template %{filename}"
|
||||
|
|
|
@ -24,3 +24,6 @@ fr:
|
|||
messages:
|
||||
remove_file: 'Supprimer le fichier'
|
||||
remove_all: "Supprimer tous les fichiers"
|
||||
piece_justificative:
|
||||
name: "Télécharger le modèle"
|
||||
title: "Télécharger le modèle %{filename}"
|
||||
|
|
|
@ -22,14 +22,14 @@ describe EditableChamp::PieceJustificativeComponent, type: :component do
|
|||
end
|
||||
|
||||
it 'renders a link to template' do
|
||||
expect(subject).to have_link('Modèle à télécharger')
|
||||
expect(subject).to have_link('Télécharger le modèle')
|
||||
expect(subject).not_to have_text("éphémère")
|
||||
end
|
||||
|
||||
context 'as an administrator' do
|
||||
let(:profil) { :administrateur }
|
||||
it 'warn about ephemeral template url' do
|
||||
expect(subject).to have_link('Modèle à télécharger')
|
||||
expect(subject).to have_link('Télécharger le modèle')
|
||||
expect(subject).to have_text("éphémère")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue