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.

37 lines
2.3 KiB

- unless @location.present?
- if @locations.present?
%table.locations.admin-edit
%tr
%th=_'forms.labels.generic.title'
%th=_'forms.labels.generic.address'
%th=_'articles.workshops.headings.space'
%th=_'articles.admin.locations.headings.amenities'
%th.form
- @locations.each do | location |
%tr
%th=_!(location.title || '')
%td=location_link location
%td=location.space.present? ? (_"workshop.options.space.#{location.space}") : ''
%td
- amenities = location.amenities.present? ? JSON.parse(location.amenities) : []
=_!(amenities.collect { |amenity| _"workshop.options.needs.#{amenity}" }).join(', ')
%td.form
= form_tag administration_update_path(@this_conference.slug, :locations) do
= hidden_field_tag :id, location.id
= button_tag :edit, value: :edit, class: :small
= button_with_confirmation :delete, (_'modals.admin.generic.delete.confirm', :p, vars: { title: location.title }), value: :delete, class: [:delete, :small]
%h4=_"articles.admin.locations.headings.#{@location.present? ? 'edit' : 'add'}_location", :t
= form_tag administration_update_path(@this_conference.slug, :locations) do
= hidden_field_tag :id, @location.id if @location.present?
= textfield :title, @location.present? ? @location.title : nil, required: true, big: true, help: 'articles.admin.locations.paragraphs.title'
= textfield :address, @location.present? ? @location.address : nil, required: true, help: 'articles.admin.locations.paragraphs.address'
= columns(medium: 6) do
= radiobuttons :space, EventLocation.all_spaces, @location.present? ? @location.space : nil, 'workshop.options.space', vertical: true, heading: 'articles.workshops.headings.space', required: true, help: 'articles.admin.locations.paragraphs.space'
= columns(medium: 6) do
= checkboxes :needs, EventLocation.all_amenities, @location.present? ? JSON.parse(@location.amenities) : [], 'workshop.options.needs', vertical: true, heading: 'articles.admin.locations.headings.amenities', help: 'articles.admin.locations.paragraphs.amenities'
.actions.next-prev
- if @location.present?
= button_tag :save, value: :save
= button_tag :cancel, value: :cancel, class: :subdued, formnovalidate: true
- else
= button_tag :create, value: :create