diff --git a/app/helpers/jubla/event_participations_helper.rb b/app/helpers/jubla/event_participations_helper.rb new file mode 100644 index 00000000..3a77993e --- /dev/null +++ b/app/helpers/jubla/event_participations_helper.rb @@ -0,0 +1,13 @@ +# Copyright (c) 2012-2024, Jungwacht Blauring Schweiz. This file is part of +# hitobito_jubla 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_jubla. + +module Jubla::EventParticipationsHelper + def event_participation_table_options(t, event:, group:) + if can?(:index_participations_details, event) + t.col(t.sort_header(:originating_state, Person.human_attribute_name(:originating_state))) { |p| p.model.person.originating_state.to_s } + t.col(t.sort_header(:originating_flock, Person.human_attribute_name(:originating_flock))) { |p| p.model.person.originating_flock.to_s } + end + end +end diff --git a/app/views/event/participations/_list_jubla.html.haml b/app/views/event/participations/_list_jubla.html.haml deleted file mode 100644 index 099f433d..00000000 --- a/app/views/event/participations/_list_jubla.html.haml +++ /dev/null @@ -1,9 +0,0 @@ --# encoding: utf-8 --# Copyright (c) 2012-2013, Jungwacht Blauring Schweiz. This file is part of --# hitobito_jubla 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_jubla. - -- if can?(:index_participations_details, @event) - - table.col(table.sort_header(:originating_state, Person.human_attribute_name(:originating_state))) { |p| p.model.person.originating_state.to_s } - - table.col(table.sort_header(:originating_flock, Person.human_attribute_name(:originating_flock))) { |p| p.model.person.originating_flock.to_s } diff --git a/lib/hitobito_jubla/wagon.rb b/lib/hitobito_jubla/wagon.rb index 27ef0a11..bf4478e4 100644 --- a/lib/hitobito_jubla/wagon.rb +++ b/lib/hitobito_jubla/wagon.rb @@ -108,6 +108,8 @@ class Wagon < Rails::Engine PersonDecorator.include Jubla::PersonDecorator ### helpers + EventParticipationsHelper.prepend Jubla::EventParticipationsHelper + # add more active_for urls to main navigation admin = NavigationHelper::MAIN.find { |opts| opts[:label] == :admin } admin[:active_for] << "event_camp_kinds"