From 80b4610396080946c62301aa48ed0d0931c812be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20J=C3=A4ggi?= Date: Thu, 10 Oct 2024 15:48:52 +0200 Subject: [PATCH] Use helper instead of view to define table attrs --- app/helpers/pbs/event_participations_helper.rb | 8 +++++++- app/views/event/participations/_list_pbs.html.haml | 2 -- 2 files changed, 7 insertions(+), 3 deletions(-) delete mode 100644 app/views/event/participations/_list_pbs.html.haml diff --git a/app/helpers/pbs/event_participations_helper.rb b/app/helpers/pbs/event_participations_helper.rb index 3bb3cb0a3..757abaa4e 100644 --- a/app/helpers/pbs/event_participations_helper.rb +++ b/app/helpers/pbs/event_participations_helper.rb @@ -1,4 +1,4 @@ -# Copyright (c) 2012-2023, Pfadibewegung Schweiz. This file is part of +# Copyright (c) 2012-2024, Pfadibewegung Schweiz. This file is part of # hitobito_pbs and licensed under the Affero General Public License version 3 # or later. See the COPYING file at the top-level directory or at # https://github.com/hitobito/hitobito_pbs. @@ -19,5 +19,11 @@ def js_data_sharing_help_text(participation, for_someone_else) CustomContent.get(content_key).body end + + def event_participation_table_options(t, event) + if @event.is_a?(Event::Camp) + table.col(Event::Participation.human_attribute_name(:state)) { |p| t("activerecord.attributes.event/camp.participation_states.#{p.state}") } + end + end end end diff --git a/app/views/event/participations/_list_pbs.html.haml b/app/views/event/participations/_list_pbs.html.haml deleted file mode 100644 index 847edc3bd..000000000 --- a/app/views/event/participations/_list_pbs.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -- if @event.is_a?(Event::Camp) - - table.col(Event::Participation.human_attribute_name(:state)) { |p| t("activerecord.attributes.event/camp.participation_states.#{p.state}") }