Skip to content

Commit

Permalink
Introduce link_external_site as course attribute (#1555)
Browse files Browse the repository at this point in the history
  • Loading branch information
njaeggi authored and TheWalkingLeek committed Feb 13, 2025
1 parent 151df12 commit e4d789c
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/sac_cas/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# hidden_contact_attrs :text(65535)
# language :string(255)
# link_leaders :string(255)
# link_external_site :string(255)
# link_participants :string(255)
# link_survey :string(255)
# location :text(65535)
Expand Down
2 changes: 2 additions & 0 deletions app/models/sac_cas/event/course.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# hidden_contact_attrs :text(65535)
# language :string(255)
# link_leaders :string(255)
# link_external_site :string(255)
# link_participants :string(255)
# link_survey :string(255)
# location :text(65535)
Expand Down Expand Up @@ -112,6 +113,7 @@ module SacCas::Event::Course
:cost_center_id,
:cost_unit_id,
:annual,
:link_external_site,
:link_participants,
:link_leaders,
:link_survey,
Expand Down
1 change: 1 addition & 0 deletions app/resources/sac_cas/event/course_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module SacCas::Event::CourseResource
attribute :specialities, :string
attribute :similar_tours, :string
attribute :program, :string
attribute :link_external_site, :string

attribute :price_member, :float
attribute :price_regular, :float
Expand Down
2 changes: 2 additions & 0 deletions app/views/events/_form_tab_pane_communication.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
= f.labeled_input_field(:program)

= field_set_tag do
- entry.used?(:link_external_site) do
= f.labeled_input_field(:link_external_site)
- entry.used?(:link_participants) do
= f.labeled_input_field(:link_participants)
- entry.used?(:link_leaders) do
Expand Down
3 changes: 3 additions & 0 deletions app/views/events/_show_left_communication.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@
- if entry.program?
= labeled(Event::Course.human_attribute_name(:program)) do
%p.multiline= safe_auto_link(entry.program, html: { target: '_blank' })
- if entry.link_external_site?
= labeled(Event::Course.human_attribute_name(:link_external_site)) do
%p.multiline= safe_auto_link(entry.link_external_site, html: { target: '_blank' })
1 change: 1 addition & 0 deletions config/locales/wagon.de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ de:
fr: Französisch
it: Italienisch
link_leaders: Link Kurskader
link_external_site: Link Externe Seite
link_participants: Link Teilnehmer
link_survey: Link Umfrage
meals: Verpflegung
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20250211080006_add_link_external_site_to_event.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddLinkExternalSiteToEvent < ActiveRecord::Migration[7.0]
def change
add_column :events, :link_external_site, :string
end
end
1 change: 1 addition & 0 deletions spec/models/event/course_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
:cost_center_id,
:cost_unit_id,
:language,
:link_external_site,
:link_leaders,
:link_participants,
:link_survey,
Expand Down
1 change: 1 addition & 0 deletions spec/resources/sac_cas/event/course_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
:season,
:start_point_of_time,
:minimum_age,
:link_external_site,

:brief_description,
:specialities,
Expand Down
8 changes: 8 additions & 0 deletions spec/support/graphiti/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,12 @@
"writable": false,
"description": null
},
"link_external_site": {
"type": "string",
"readable": true,
"writable": false,
"description": null
},
"price_member": {
"type": "float",
"readable": true,
Expand Down Expand Up @@ -421,6 +427,8 @@
},
"program": {
},
"link_external_site": {
},
"price_member": {
},
"price_regular": {
Expand Down

0 comments on commit e4d789c

Please sign in to comment.