-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support adding external_trainings for multiple people (#524)
- Loading branch information
1 parent
0e98e4a
commit aaf4dfd
Showing
10 changed files
with
179 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
app/controllers/person/query_external_training_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright (c) 2012-2024, Schweizer Alpen-Club. This file is part of | ||
# hitobito_sac_cas 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_sac_cas. | ||
|
||
|
||
class Person::QueryExternalTrainingController < Person::QueryController | ||
|
||
private | ||
|
||
def scope | ||
Person | ||
.accessible_by(PersonWritables.new(current_user)) | ||
.distinct.joins(roles: :group) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,20 @@ | ||
- # Copyright (c) 2024, Schweizer Alpen-Club. This file is part of | ||
- # hitobito_sac_cas 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_sac_cas | ||
|
||
= entry_form(cancel_url: history_group_person_path(@group, @person), data: { controller: :forwarder }) do |f| | ||
= f.labeled_input_fields :name, :provider | ||
= f.labeled_input_field :start_at | ||
= f.labeled_input_field :finish_at | ||
= render 'event_kind_field_with_info', f: f | ||
= f.labeled_input_fields :training_days, :link, :remarks | ||
= field_set_tag do | ||
= f.labeled(:other_people_ids, '') do | ||
= f.collection_select(:other_people_ids, @other_people.to_a, :id, :to_s, {}, | ||
{ multiple: true, placeholder: I18n.t('global.search.placeholder_person'), | ||
data: { controller: 'tom-select', | ||
tom_select_url_value: query_external_training_path, | ||
tom_select_no_results_value: I18n.t('global.no_list_entries'), | ||
tom_select_label_value: 'label' } }) | ||
= f.help_inline(t('.help_other_people')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
= f.input_field :person_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters