From f135df0c74efdc01a51b05778c50275dcb57c5ef Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 27 Apr 2023 11:35:18 +0200 Subject: [PATCH] refactor(fork): feedback to user that a modification must be submitted --- .../champ_label_content_component.en.yml | 5 +++++ .../champ_label_content_component.fr.yml | 5 +++++ .../champ_label_content_component.html.haml | 6 +++--- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 app/components/editable_champ/champ_label_content_component/champ_label_content_component.en.yml create mode 100644 app/components/editable_champ/champ_label_content_component/champ_label_content_component.fr.yml diff --git a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.en.yml b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.en.yml new file mode 100644 index 000000000..052df2f89 --- /dev/null +++ b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.en.yml @@ -0,0 +1,5 @@ +--- +en: + changes_to_save: "modifications to submit" + modified_at: "modified on %{datetime}" + check_content_rebased: The type of this field or its description has been modified by the administration. Check its content. diff --git a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.fr.yml b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.fr.yml new file mode 100644 index 000000000..f23db0dab --- /dev/null +++ b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.fr.yml @@ -0,0 +1,5 @@ +--- +fr: + changes_to_save: "modification à déposer" + modified_at: "modifié le %{datetime}" + check_content_rebased: Le type de ce champ ou sa description ont été modifiés par l'administration. Vérifier son contenu. diff --git a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml index eeac93d00..298c3a867 100644 --- a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml +++ b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml @@ -4,11 +4,11 @@ - if @champ.forked_with_changes? %span.updated-at.highlighted - = @champ.updated_at > 1.minutes.ago ? "modifié à l’instant" : "modification à déposer" + = t('.changes_to_save') - elsif @champ.updated_at.present? && @seen_at.present? %span.updated-at{ class: highlight_if_unseen_class } - = "modifié le #{try_format_datetime(@champ.updated_at)}" + = 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 - Le type de ce champ ou sa description ont été modifiés par l'administration. Vérifier son contenu. + = t('.check_content_rebased')