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
|
2016-06-25 16:03:08 +02: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
|
2016-12-17 16:59:11 +01:00
|
|
|
= f.datetime_select :start_time, default: 1.day.from_now
|
2014-07-20 23:33:26 +02:00
|
|
|
.field.end_time
|
2014-07-12 13:58:54 +02:00
|
|
|
= f.label :end_time
|
2016-12-17 16:59:11 +01:00
|
|
|
= f.datetime_select :end_time, default: 1.day.from_now
|
2016-09-11 17:40:49 +02:00
|
|
|
|
|
|
|
- unless @event.moderated?
|
|
|
|
.field.repeat
|
|
|
|
= f.label :repeat
|
|
|
|
= f.number_field :repeat, in: 0..40, maxlength: 2, size: 2
|
|
|
|
|
|
|
|
.field.rule
|
|
|
|
.helper
|
|
|
|
:markdown
|
|
|
|
#{t '.rule_helper'}
|
|
|
|
= f.label :rule
|
|
|
|
%span.radios
|
|
|
|
- Event::RULES.each do |rule|
|
|
|
|
= f.radio_button :rule, rule
|
|
|
|
= f.label "rule_#{rule}",
|
|
|
|
t(rule, scope: 'activerecord.attributes.event.rule_values')
|
2016-06-25 16:03:08 +02:00
|
|
|
|
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
|
2015-12-26 23:32:04 +01:00
|
|
|
= f.text_area :description, rows: 25, class: :description
|
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
|
2016-06-25 16:03:08 +02:00
|
|
|
= f.collection_select :region_id, Region.all, :id, :name,
|
|
|
|
include_blank: true
|
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
|
2016-12-17 16:59:11 +01:00
|
|
|
= f.text_field :tag_list, value: f.object.tag_list.to_s
|
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'
|