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

Combine events/new and events/edit forms #2009

Merged
merged 1 commit into from
Jan 31, 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
9 changes: 5 additions & 4 deletions app/views/admin/events/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
= f.input :schedule, input_html: { rows: 3 },
hint: raw(t('admin.shared.markdown_hint', link: link_to(t('admin.shared.markdown'), 'https://commonmark.org/help/')))
.col-12
= f.association :venue, input_html: { data: { placeholder: 'Select sponsors' }}
= f.association :venue, input_html: { data: { placeholder: 'Select a venue' }}
.col-12
= f.input :virtual, label: t('events.virtual')

Expand All @@ -40,13 +40,14 @@
.col-12.col-md-6.col-lg-4
= f.association :silver_sponsors, input_html: { data: { placeholder: 'Select silver sponsors' }}, collection: Sponsor.all
.col-12.col-md-6.col-lg-4
= f.association :gold_sponsors, input_html: { data: { placeholder: 'Select sponsors' }}, collection: Sponsor.all
= f.association :gold_sponsors, input_html: { data: { placeholder: 'Select gold sponsors' }}, collection: Sponsor.all
.col-12
= f.input :organisers, collection: Member.all, value_methid: :id, label_method: :full_name, selected: @event.organisers.map(&:id), input_html: { multiple: true }
= f.input :organisers, collection: Member.all, value_method: :id, label_method: :full_name, selected: @event.organisers.map(&:id), input_html: { multiple: true }
.col-12
= f.input :announce_only, as: :boolean, hint: 'Events where invitations are not handled via our application'
.col-12
= f.input :external_url, label: 'External Registration URL', placeholder: 'include protocol, e.g. https://codebar.io'

.col-12
%h3 Invitation details
.card.bg-light.border-info.mb-3
Expand All @@ -66,7 +67,7 @@
= f.association :chapters, hint: 'Which chapters do you want to invite to this event? Only one invitation will be emailed out to members with multiple subscriptions when you click Invite from the event page.'
.col-12
= f.input :audience, collection: @event.permitted_audience_values,
hint: 'Optionally, specify if invitations should only be sent to students or coaches (ex. a CV workshop targeted toward students may not need invites sent to the entire coach listserv) If left blank, all subscribers to a chapter will be invited via email'
hint: 'Optionally, specify if invitations should only be sent to students or coaches (ex. a CV workshop targeted toward students may not need invites sent to the entire coach listserv). If left blank, all subscribers to a chapter will be invited via email.'
.col-12
= f.input :invitable, as: :boolean, hint: 'Allow members to RSVP'
.col-12
Expand Down
85 changes: 1 addition & 84 deletions app/views/admin/events/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,87 +5,4 @@

.row
.col.col-md-10.col-lg-8
= simple_form_for [:admin, @event] do |f|
.row
.col-12
= f.input :name, label: 'Event name'
.col-12.col-md-6
= f.input :email, as: :email, label: 'Contact email'
.col-12.col-md-6
= f.input :slug
.col-12
= f.input :local_date, label: 'Date', as: :string, required: true, input_html: { data: { value: @event.date_and_time.try(:strftime, '%d/%m/%Y') } }
.col-12.col-md-6
= f.input :local_time, label: 'Starts at', as: :string, required: true, input_html: { data: { value: @event.time.try(:strftime, '%H:%M') } }
.col-12.col-md-6
= f.input :local_end_time, label: 'Ends at', as: :string, required: true, input_html: { data: { value: @event.ends_at.try(:strftime, '%H:%M') } }
.col-12
.mb-3
%label.form-label{ for: "event_timezone" } Time zone
= f.time_zone_select :time_zone, nil, {}, { class: 'form-control'}
.col-12
= f.input :description, as: :text, input_html: { rows: 3 },
hint: 'Use this space to write an invitation message and description of the event. This copy will also be used in the email invitation. You can use HTML here!'
.col-12
= f.input :info, label: 'RSVP instructions'
.col-12
= f.input :schedule, input_html: { rows: 3 },
hint: raw(t('admin.shared.markdown_hint', link: link_to(t('admin.shared.markdown'), 'https://commonmark.org/help/')))
.col-12
= f.association :venue, input_html: { data: { placeholder: 'Select sponsors' }}
.col-12
= f.input :virtual, label: t('events.virtual')
.col-12
%h3 Sponsors
%p
%strong Please add sponsors only to either Standard level OR Gold/Silver/Bronze levels.
.col-12
= f.association :sponsors, input_html: { data: { placeholder: 'Select standard sponsors' }}, collection: Sponsor.all
.col-12.col-md-6.col-lg-4
= f.association :bronze_sponsors, input_html: { data: { placeholder: 'Select bronze sponsors' }}, collection: Sponsor.all
.col-12.col-md-6.col-lg-4
= f.association :silver_sponsors, input_html: { data: { placeholder: 'Select silver sponsors' }}, collection: Sponsor.all
.col-12.col-md-6.col-lg-4
= f.association :gold_sponsors, input_html: { data: { placeholder: 'Select sponsors' }}, collection: Sponsor.all
.col-12
= f.input :organisers, collection: Member.all, value_method: :id, label_method: :full_name, selected: @event.organisers.map(&:id), input_html: { multiple: true }
.col-12
= f.input :announce_only, as: :boolean, hint: 'Events where invitations are not handled via our application'
.col-12
= f.input :external_url, label: 'External Registration URL', placeholder: 'include protocol, e.g. https://codebar.io'

.col
%h3 Invitation details
.card.bg-light.border-info.mb-3
.card-body
.row
.col-12
= f.input :tito_url, as: :url, hint: 'Only used for student tickets'
.col-12.col-md-6
= f.input :coach_spaces
.col-12.col-md-6
= f.input :student_spaces
.col-12
= f.input :coach_questionnaire
.col-12
= f.input :student_questionnaire
.col-12
= f.association :chapters, hint: 'Which chapters do you want to invite to this event? Only one invitation will be emailed out to members with multiple subscriptions.'
.col-12
= f.input :audience, collection: @event.permitted_audience_values,
hint: 'Optionally, specify if invitations should only be sent to students or coaches (ex. a CV workshop targeted toward students may not need invites sent to the entire coach listserv) If left blank, all subscribers to a chapter will be invited via email'
.col-12
= f.input :invitable, as: :boolean, hint: 'Allow members to RSVP'
.col-12
= f.input :show_faq, as: :boolean, hint: 'Display FAQ section?'
.col-12
= f.input :display_coaches, as: :boolean
.col-12
= f.input :display_students, as: :boolean
.col-12
= f.input :confirmation_required, as: :boolean, hint: 'Will we be confirming members\' attendance?'
.col-12
= f.input :surveys_required, as: :boolean, hint: 'Do we need to collect extra info?'

.text-right
= f.button :button, 'Save', class: 'btn btn-primary'
= render partial: 'form'
Loading