-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reload trainings form when event kind changes (#262)
- Loading branch information
1 parent
4a6b9be
commit c08b885
Showing
5 changed files
with
38 additions
and
3 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
11 changes: 11 additions & 0 deletions
11
app/views/external_trainings/_event_kind_field_with_info.html.haml
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,11 @@ | ||
- id = :event_kind_turbo_frame | ||
- form_action = new_group_person_external_training_path(@group, @person) | ||
- prolonging_qualis = entry.kind&.qualification_kinds(%w(qualification prolongation), 'participant') | ||
|
||
= turbo_frame_tag(id) do | ||
= f.labeled_input_fields :event_kind_id, data: { action: 'forwarder#click' } | ||
- if entry.kind && entry.qualification_date && prolonging_qualis.present? | ||
%p.col-md-9.offset-md-3.offset-xl-2.mb-2 | ||
= entry.kind.decorate.issued_qualifications_info_for_participants(entry.qualification_date) | ||
|
||
= render 'shared/hidden_submit', label: 'Load qualification info', formaction: form_action, turbo_frame: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
= entry_form(cancel_url: history_group_person_path(@group, @person)) do |f| | ||
= f.labeled_input_fields :event_kind_id, :name, :provider, :start_at, :finish_at, :training_days, :link, :remarks | ||
= 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 |
Empty file.
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