Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use helper instead of view #134

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions app/helpers/jubla/event_participations_helper.rb
Original file line number Diff line number Diff line change
@@ -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
9 changes: 0 additions & 9 deletions app/views/event/participations/_list_jubla.html.haml

This file was deleted.

2 changes: 2 additions & 0 deletions lib/hitobito_jubla/wagon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading