From a73a22ecff4a10ff4888616ac3d7cd81c408f99a Mon Sep 17 00:00:00 2001 From: Jannik Pulfer Date: Wed, 20 Nov 2024 16:12:52 +0100 Subject: [PATCH 1/4] Fix person relation labels with new method in actions_helper --- app/helpers/actions_helper.rb | 5 +++++ app/views/people/person_relations/_index.html.haml | 2 +- config/locales/de.yml | 12 ++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/helpers/actions_helper.rb b/app/helpers/actions_helper.rb index c1c9f0395..cc4af322a 100644 --- a/app/helpers/actions_helper.rb +++ b/app/helpers/actions_helper.rb @@ -59,6 +59,11 @@ def add_action_link(path = nil, url_options = {}, html_options = {}) action_link(ti('link.add'), 'plus', path, html_options) end + def add_person_relation_link(path, person_relation_name, html_options) + path = new_polymorphic_path(path, url_options, html_options) unless path.is_a?(String) + action_link(t("people.#{person_relation_name}.link.add"), 'plus', path, html_options) + end + def add_action_link_modal(path = nil, url_options = {}) path ||= path_args(model_class) path = new_polymorphic_path(path, url_options) unless path.is_a?(String) diff --git a/app/views/people/person_relations/_index.html.haml b/app/views/people/person_relations/_index.html.haml index fc9f605da..23e7e3974 100644 --- a/app/views/people/person_relations/_index.html.haml +++ b/app/views/people/person_relations/_index.html.haml @@ -2,7 +2,7 @@ %div.profile-header.mw-100.border-bottom = "#{list.model_name.human(count: list.count)} (#{list.count})" %div.d-flex.flex-column.ms-5.mt-3.mb-3 - = add_action_link new_polymorphic_path([entry, name_of_obj(list).to_sym]), {}, data: { turbo_frame: dom_id(list.model.new)} + = add_person_relation_link new_polymorphic_path([entry, name_of_obj(list).to_sym]), list.model_name.collection, data: { turbo_frame: dom_id(list.model.new)} %div.border.rounded.border %turbo-frame{id: dom_id(list.model.new)} %turbo-frame{id: name_of_obj(list)} diff --git a/config/locales/de.yml b/config/locales/de.yml index 8019c37a8..bfe358e4d 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -216,6 +216,18 @@ de: search: new_profile: Neues Profil updated_at: Zuletzt bearbeitet + educations: + link: + add: Neue Ausbildung + activities: + link: + add: Neue Station + advanced_trainings: + link: + add: Neue Weiterbildung + projects: + link: + add: Neues Projekt people/people_skills: edit_form: rate: Bewerten From f659f1d21b549d4dd59849dff044132a2dd586b9 Mon Sep 17 00:00:00 2001 From: Jannik Pulfer Date: Fri, 22 Nov 2024 08:38:21 +0100 Subject: [PATCH 2/4] Add translations for person relation new buttons to remaining languages --- config/locales/en.yml | 12 ++++++++++++ config/locales/fr.yml | 12 ++++++++++++ config/locales/it.yml | 12 ++++++++++++ 3 files changed, 36 insertions(+) diff --git a/config/locales/en.yml b/config/locales/en.yml index ac2c9c21e..25bd98c4f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -212,6 +212,18 @@ en: search: new_profile: New profile updated_at: Last edited + educations: + link: + add: New education + activities: + link: + add: New activity + advanced_trainings: + link: + add: New advanced training + projects: + link: + add: New project people/people_skills: edit_form: rate: Rate diff --git a/config/locales/fr.yml b/config/locales/fr.yml index ae83fa505..972d862fe 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -212,6 +212,18 @@ fr: search: new_profile: Nouveau profil updated_at: Dernièrement édité + educations: + link: + add: Nouvelle formation + activities: + link: + add: Nouvelle station + advanced_trainings: + link: + add: Nouvelle formation continue + projects: + link: + add: Nouveau projet people/people_skills: edit_form: rate: Évaluer diff --git a/config/locales/it.yml b/config/locales/it.yml index 808322a7e..122fa5a38 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -212,6 +212,18 @@ it: search: new_profile: Nuovo profilo updated_at: Ultima modifica + educations: + link: + add: Nuova formazione + activities: + link: + add: Nuova stazione + advanced_trainings: + link: + add: Nuova formazione continua + projects: + link: + add: Nuovo progetto people/people_skills: edit_form: rate: Tasso From 89a5ff3679fb1b8e2cc21420820b14d70879889c Mon Sep 17 00:00:00 2001 From: Jannik Pulfer Date: Fri, 22 Nov 2024 08:50:43 +0100 Subject: [PATCH 3/4] Make translations for new buttons match their category name --- config/locales/en.yml | 4 ++-- config/locales/it.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 25bd98c4f..0415a65f6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -217,10 +217,10 @@ en: add: New education activities: link: - add: New activity + add: New station advanced_trainings: link: - add: New advanced training + add: New further training projects: link: add: New project diff --git a/config/locales/it.yml b/config/locales/it.yml index 122fa5a38..fb06ec057 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -214,10 +214,10 @@ it: updated_at: Ultima modifica educations: link: - add: Nuova formazione + add: Nuovo programma di formazione activities: link: - add: Nuova stazione + add: Nuova Stazione advanced_trainings: link: add: Nuova formazione continua From 99cf6be68ce8016d35ba22e3b04170e4161b6fde Mon Sep 17 00:00:00 2001 From: Jannik Pulfer Date: Fri, 22 Nov 2024 08:56:03 +0100 Subject: [PATCH 4/4] Normalize i18n files --- config/locales/de.yml | 24 ++++++++++++------------ config/locales/en.yml | 24 ++++++++++++------------ config/locales/fr.yml | 24 ++++++++++++------------ config/locales/it.yml | 24 ++++++++++++------------ 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index bfe358e4d..73c635b95 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -176,8 +176,17 @@ de: single: ledig widowed: verwitwet people: + activities: + link: + add: Neue Station + advanced_trainings: + link: + add: Neue Weiterbildung cv: no_skills_rated_msg: Dieses Profil hat noch keine bewerteten Skills. Gehe zum Skills Tab und bewerte die für dich relevanten Skills. + educations: + link: + add: Neue Ausbildung export_cv: export_form: anonymised_cv: Anonymisierter CV @@ -206,6 +215,9 @@ de: core_competences: Kernkompetenzen personals: Personalien upload_image: Bild hochladen + projects: + link: + add: Neues Projekt scroll_to_menu: activities: Station advanced-trainings: Weiterbildungen @@ -216,18 +228,6 @@ de: search: new_profile: Neues Profil updated_at: Zuletzt bearbeitet - educations: - link: - add: Neue Ausbildung - activities: - link: - add: Neue Station - advanced_trainings: - link: - add: Neue Weiterbildung - projects: - link: - add: Neues Projekt people/people_skills: edit_form: rate: Bewerten diff --git a/config/locales/en.yml b/config/locales/en.yml index 0415a65f6..b9e20f3f1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -172,8 +172,17 @@ en: single: single widowed: widowed people: + activities: + link: + add: New station + advanced_trainings: + link: + add: New further training cv: no_skills_rated_msg: This profile has no rated skills yet. Go to the Skills tab and rate the skills relevant to you. + educations: + link: + add: New education export_cv: export_form: anonymised_cv: Anonymized CV @@ -202,6 +211,9 @@ en: core_competences: Core competencies personals: Personal details upload_image: Upload image + projects: + link: + add: New project scroll_to_menu: activities: Station advanced-trainings: Further training @@ -212,18 +224,6 @@ en: search: new_profile: New profile updated_at: Last edited - educations: - link: - add: New education - activities: - link: - add: New station - advanced_trainings: - link: - add: New further training - projects: - link: - add: New project people/people_skills: edit_form: rate: Rate diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 972d862fe..ce0cfe673 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -172,8 +172,17 @@ fr: single: célibataire widowed: veuf/veuve people: + activities: + link: + add: Nouvelle station + advanced_trainings: + link: + add: Nouvelle formation continue cv: no_skills_rated_msg: Ce profil n'a pas encore de skills évalués. Va dans l'onglet Skills et évalue les skills qui te concernent. + educations: + link: + add: Nouvelle formation export_cv: export_form: anonymised_cv: CV anonyme @@ -202,6 +211,9 @@ fr: core_competences: Compétences clés personals: Données personnelles upload_image: Télécharger une image + projects: + link: + add: Nouveau projet scroll_to_menu: activities: Station advanced-trainings: Formations continues @@ -212,18 +224,6 @@ fr: search: new_profile: Nouveau profil updated_at: Dernièrement édité - educations: - link: - add: Nouvelle formation - activities: - link: - add: Nouvelle station - advanced_trainings: - link: - add: Nouvelle formation continue - projects: - link: - add: Nouveau projet people/people_skills: edit_form: rate: Évaluer diff --git a/config/locales/it.yml b/config/locales/it.yml index fb06ec057..25235a13f 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -172,8 +172,17 @@ it: single: singolo widowed: vedova people: + activities: + link: + add: Nuova Stazione + advanced_trainings: + link: + add: Nuova formazione continua cv: no_skills_rated_msg: Questo profilo non ha ancora competenze valutate. Andate alla scheda Competenze e valutate le competenze che vi interessano. + educations: + link: + add: Nuovo programma di formazione export_cv: export_form: anonymised_cv: CV anonimo @@ -202,6 +211,9 @@ it: core_competences: Competenze di base personals: Dati personali upload_image: Carica immagine + projects: + link: + add: Nuovo progetto scroll_to_menu: activities: Stazione advanced-trainings: Formazione continua @@ -212,18 +224,6 @@ it: search: new_profile: Nuovo profilo updated_at: Ultima modifica - educations: - link: - add: Nuovo programma di formazione - activities: - link: - add: Nuova Stazione - advanced_trainings: - link: - add: Nuova formazione continua - projects: - link: - add: Nuovo progetto people/people_skills: edit_form: rate: Tasso