2014-12-13 15:53:32 +01:00
|
|
|
= form_for @event,
|
|
|
|
url: { action: @event.new_record? ? :create : :update } do |f|
|
|
|
|
- if @event.persisted?
|
2014-10-11 16:12:07 +02:00
|
|
|
= f.hidden_field :lock_version
|
|
|
|
- unless @moderation
|
|
|
|
= hidden_field_tag :secret, params[:secret]
|
|
|
|
|
2013-12-28 23:45:13 +01:00
|
|
|
- if @event.errors.any?
|
2014-09-23 17:50:35 +02:00
|
|
|
#flash_messages
|
2014-05-31 23:13:43 +02:00
|
|
|
- @event.errors.full_messages.each do |msg|
|
2014-09-23 17:50:35 +02:00
|
|
|
%p.flash.alert= msg
|
2013-12-28 23:45:13 +01:00
|
|
|
|
2014-07-20 23:33:26 +02:00
|
|
|
.field.title
|
2013-12-28 23:45:13 +01:00
|
|
|
= f.label :title
|
2014-11-09 15:23:04 +01:00
|
|
|
= f.text_field :title, required: true, placeholder: "#{t '.title_helper'}"
|
2014-07-20 23:33:26 +02:00
|
|
|
.field.start_time
|
2014-07-12 13:58:54 +02:00
|
|
|
= f.label :start_time
|
2014-07-16 22:29:07 +02:00
|
|
|
= f.datetime_local_field :start_time, required: true
|
2014-07-20 23:33:26 +02:00
|
|
|
.field.end_time
|
2014-07-12 13:58:54 +02:00
|
|
|
= f.label :end_time
|
2014-07-16 22:29:07 +02:00
|
|
|
= f.datetime_local_field :end_time, required: true
|
2014-09-26 01:26:33 +02:00
|
|
|
.field.description
|
2014-06-09 20:36:53 +02:00
|
|
|
.helper
|
|
|
|
:markdown
|
|
|
|
#{t '.description_helper'}
|
2014-07-12 13:58:54 +02:00
|
|
|
= f.label :description
|
2014-11-09 15:23:04 +01:00
|
|
|
= f.text_area :description, rows: 25
|
2014-01-01 21:26:35 +01:00
|
|
|
|
2015-03-08 23:41:52 +01:00
|
|
|
.field.place_name
|
|
|
|
= f.label :place_name
|
|
|
|
= f.text_field :place_name
|
2014-09-26 01:26:33 +02:00
|
|
|
.field.address
|
2014-09-21 14:32:59 +02:00
|
|
|
.helper
|
|
|
|
:markdown
|
|
|
|
#{t '.address_helper'}
|
2014-08-23 16:59:42 +02:00
|
|
|
= f.label :address
|
2014-12-13 15:53:32 +01:00
|
|
|
= f.text_field :address, list: :addresses
|
|
|
|
%datalist#addresses
|
2014-12-14 22:08:35 +01:00
|
|
|
- Event.where('address is not null').group(:address).order('count(address) desc').pluck(:address).each do |address|
|
2014-12-13 15:53:32 +01:00
|
|
|
%option= address
|
2014-09-26 01:26:33 +02:00
|
|
|
.field.city
|
2014-07-12 13:58:54 +02:00
|
|
|
= f.label :city
|
2014-11-09 15:23:04 +01:00
|
|
|
= f.text_field :city, required: true, list: :cities
|
2014-07-01 21:25:48 +02:00
|
|
|
%datalist#cities
|
2014-09-26 01:26:33 +02:00
|
|
|
- Event.group(:city).order('count(city) desc').pluck(:city).each do |city|
|
|
|
|
%option= city
|
|
|
|
.field.region
|
2014-07-12 13:58:54 +02:00
|
|
|
= f.label :region
|
2015-02-28 17:28:05 +01:00
|
|
|
= f.collection_select :region_id, Region.all, :id, :name
|
2014-09-26 01:26:33 +02:00
|
|
|
.field.locality
|
2014-07-12 13:58:54 +02:00
|
|
|
= f.label :locality
|
2015-02-28 17:28:05 +01:00
|
|
|
%span.radios
|
|
|
|
= f.radio_button :locality, 0
|
|
|
|
= f.label 'locality_0' do
|
|
|
|
%em.fa.fa-shield
|
|
|
|
= t 'attributes.locality_0'
|
|
|
|
= f.radio_button :locality, 1
|
|
|
|
= f.label 'locality_1' do
|
|
|
|
%em.fa.fa-globe
|
|
|
|
= t 'attributes.locality_1'
|
2014-08-23 16:59:42 +02:00
|
|
|
|
2014-09-26 01:26:33 +02:00
|
|
|
.field.url
|
2014-06-09 20:36:53 +02:00
|
|
|
.helper
|
|
|
|
:markdown
|
|
|
|
#{t '.url_helper'}
|
2014-07-12 13:58:54 +02:00
|
|
|
= f.label :url
|
2014-11-09 15:23:04 +01:00
|
|
|
= f.url_field :url, required: true, placeholder: 'Ex: http://april.org'
|
2014-09-26 01:26:33 +02:00
|
|
|
.field.contact
|
2014-06-09 20:36:53 +02:00
|
|
|
.helper
|
|
|
|
:markdown
|
|
|
|
#{t '.contact_helper'}
|
2014-07-12 13:58:54 +02:00
|
|
|
= f.label :contact
|
2014-11-09 15:23:04 +01:00
|
|
|
= f.email_field :contact, required: true
|
2014-09-26 01:26:33 +02:00
|
|
|
.field.submitter
|
2014-06-09 20:36:53 +02:00
|
|
|
.helper
|
|
|
|
:markdown
|
|
|
|
#{t '.submitter_helper'}
|
2013-12-28 23:45:13 +01:00
|
|
|
= f.label :submitter
|
2014-11-09 15:23:04 +01:00
|
|
|
= f.email_field :submitter
|
2014-09-26 01:26:33 +02:00
|
|
|
.field.tags
|
2014-06-09 20:36:53 +02:00
|
|
|
.helper
|
|
|
|
:markdown
|
|
|
|
#{t '.tags_helper'}
|
2014-12-23 18:56:49 +01:00
|
|
|
= f.label :tags
|
2014-11-09 15:23:04 +01:00
|
|
|
= f.text_field :tags
|
2014-01-01 21:26:35 +01:00
|
|
|
|
2013-12-28 23:45:13 +01:00
|
|
|
.actions
|
2014-08-25 23:38:09 +02:00
|
|
|
= f.button formaction: :preview do
|
|
|
|
%em.fa.fa-eye
|
2014-12-13 15:53:32 +01:00
|
|
|
= t '.visualise'
|
2014-10-15 01:09:42 +02:00
|
|
|
|
2014-08-25 23:38:09 +02:00
|
|
|
= f.button do
|
|
|
|
%em.fa.fa-check
|
2014-12-13 15:53:32 +01:00
|
|
|
= t '.save'
|