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