2014-07-01 15:50:39 +02:00
|
|
|
= form_for @event, url: (@moderation ? moderation_path(@moderation) : @event.persisted? ? event_path(@event) : nil) do |f|
|
2014-10-11 16:12:07 +02:00
|
|
|
- if @event.persisted?
|
|
|
|
= 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-09-26 01:26:33 +02:00
|
|
|
= f.text_field :title, required: true, size: 70,
|
|
|
|
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-07-18 19:03:33 +02:00
|
|
|
= f.text_area :description, rows: 25, cols: 90
|
2014-01-01 21:26:35 +01:00
|
|
|
|
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
|
|
|
|
= f.text_field :address, size: 70
|
2014-09-26 01:26:33 +02:00
|
|
|
.field.city
|
2014-07-12 13:58:54 +02:00
|
|
|
= f.label :city
|
2014-07-01 21:25:48 +02:00
|
|
|
= f.text_field :city, required: true, size: 70, list: :cities
|
|
|
|
%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
|
2014-01-01 21:26:35 +01:00
|
|
|
= f.select :region,
|
2014-07-01 15:50:39 +02:00
|
|
|
options_from_collection_for_select(Region.all, 'id', 'name', @event.region)
|
2014-09-26 01:26:33 +02:00
|
|
|
.field.locality
|
2014-07-12 13:58:54 +02:00
|
|
|
= f.label :locality
|
2014-01-01 21:26:35 +01:00
|
|
|
= f.select :locality,
|
2014-01-06 11:22:39 +01:00
|
|
|
options_for_select([[t('attributes.locality_0'), 0], [t('attributes.locality_1'), 1]], @event.locality)
|
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-07-18 17:49:59 +02:00
|
|
|
= f.url_field :url, required: true, size: 70, 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-07-18 17:49:59 +02:00
|
|
|
= f.email_field :contact, required: true, size: 70
|
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-07-18 17:49:59 +02:00
|
|
|
= f.email_field :submitter, size: 70
|
2014-09-26 01:26:33 +02:00
|
|
|
.field.tags
|
2014-06-09 20:36:53 +02:00
|
|
|
.helper
|
|
|
|
:markdown
|
|
|
|
#{t '.tags_helper'}
|
2013-12-28 23:45:13 +01:00
|
|
|
= f.label :tags
|
2014-01-01 21:26:35 +01:00
|
|
|
= f.text_field :tags, size: 70
|
|
|
|
|
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
|
|
|
|
=t '.visualise'
|
|
|
|
= f.button do
|
|
|
|
%em.fa.fa-check
|
|
|
|
=t '.save'
|