Bike!Bike! Website!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
2.4 KiB

- if @this_conference.event_locations.blank?
.warning-info=_'articles.admin.events.no_locations_warning'
- else
- if @events.present?
%table.events.admin-edit
%tr
%th=_'forms.labels.generic.title'
%th=_'forms.labels.generic.event_location'
%th=_'forms.labels.generic.day'
%th=_'forms.labels.generic.time'
%th=_'forms.labels.generic.time_span'
%th.form
- @events.each do | event |
%tr
%th=event.title
%td=_!(event.event_location.present? ? event.event_location.title : '')
%td=date(event.start_time.to_date, :weekday)
%td=time(event.start_time, :short)
%td=hours(event.start_time, event.end_time)
%td.form
= form_tag administration_update_path(@this_conference.slug, :events) do
= hidden_field_tag :id, event.id
= button_tag :edit, value: :edit, class: :small
= button_with_confirmation :delete, (_'modals.admin.generic.delete.confirm', :p, vars: { title: event.title }), value: :delete, class: [:delete, :small]
%h4=_"articles.admin.locations.headings.#{@event.id.present? ? 'edit' : 'add'}_event", :t
= form_tag administration_update_path(@this_conference.slug, :events) do
= hidden_field_tag :id, @event.id if @event.id.present?
= textfield :title, @event.title!, required: true, big: true, lang: @event.locale
= textarea :info, @event.info!, heading: 'articles.conference_registration.headings.admin.edit.info', help: 'articles.conference_registration.paragraphs.admin.events.info', lang: @event.locale, edit_on: :focus
.flex-inputs
= location_select @event.event_location_id, small: true, stretch: true
= day_select @day, small: true, format: :weekday
= time_select @time, small: true
= length_select @length, small: true
- I18n.backend.enabled_locales.each do | locale |
- if locale.to_s != @event.locale.to_s
= textfield "title_translations[#{locale.to_s}]", @event._title(locale), big: true, heading: 'translate.pages.Locale_Translation', vars: { language: _("languages.#{locale}") }, label: 'forms.labels.generic.title', lang: locale
= textarea "info_translations[#{locale.to_s}]", @event._info(locale), lang: locale, label: 'forms.labels.generic.info', edit_on: :focus
.actions.next-prev
= button_tag :save, value: :save
= button_tag :cancel, value: :cancel, class: :subdued, formnovalidate: true if @event.id.present?