2014-04-05 01:21:09 +02:00
|
|
|
- markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true)
|
|
|
|
|
2014-01-10 16:35:58 +01:00
|
|
|
= form_for @event do |f|
|
2013-12-28 23:45:13 +01:00
|
|
|
- if @event.errors.any?
|
2014-05-31 23:13:43 +02:00
|
|
|
#error_explanation.error.flash
|
2013-12-28 23:45:13 +01:00
|
|
|
%h2= "#{pluralize(@event.errors.count, "error")} prohibited this event from being saved:"
|
2014-05-31 23:13:43 +02:00
|
|
|
- @event.errors.full_messages.each do |msg|
|
|
|
|
%p= msg
|
2013-12-28 23:45:13 +01:00
|
|
|
|
2014-01-06 11:22:39 +01:00
|
|
|
- unless @event.id
|
2014-04-05 01:21:09 +02:00
|
|
|
= raw markdown.render t '.subtitle'
|
2014-01-01 21:26:35 +01:00
|
|
|
|
2014-04-05 01:21:09 +02:00
|
|
|
#advises= raw markdown.render t '.advises'
|
2014-01-01 21:26:35 +01:00
|
|
|
|
2014-05-25 23:59:03 +02:00
|
|
|
- else
|
|
|
|
= hidden_field_tag :secret, params[:secret]
|
|
|
|
|
2013-12-28 23:45:13 +01:00
|
|
|
.field
|
2014-04-05 01:21:09 +02:00
|
|
|
.helper= raw markdown.render t '.title_helper'
|
2013-12-28 23:45:13 +01:00
|
|
|
= f.label :title
|
2014-05-26 01:06:43 +02:00
|
|
|
= f.text_field :title, required: true, size: 70
|
2013-12-28 23:45:13 +01:00
|
|
|
.field
|
2014-01-01 21:26:35 +01:00
|
|
|
= f.label Event.human_attribute_name :start_time
|
2014-05-26 01:06:43 +02:00
|
|
|
= f.datetime_select :start_time, required: true
|
2013-12-28 23:45:13 +01:00
|
|
|
.field
|
2014-01-01 21:26:35 +01:00
|
|
|
= f.label Event.human_attribute_name :end_time
|
2014-05-26 01:06:43 +02:00
|
|
|
= f.datetime_select :end_time, required: true
|
2013-12-28 23:45:13 +01:00
|
|
|
.field
|
2014-04-05 01:21:09 +02:00
|
|
|
.helper= raw markdown.render t '.description_helper'
|
2014-01-01 21:26:35 +01:00
|
|
|
= f.label Event.human_attribute_name :description
|
2014-05-26 01:06:43 +02:00
|
|
|
= f.text_area :description, required: true, rows: 29, cols: 80
|
2014-01-01 21:26:35 +01:00
|
|
|
|
2013-12-28 23:45:13 +01:00
|
|
|
.field
|
2014-01-01 21:26:35 +01:00
|
|
|
= f.label Event.human_attribute_name :city
|
2014-05-26 01:06:43 +02:00
|
|
|
= f.text_field :city, required: true, size: 70
|
2013-12-28 23:45:13 +01:00
|
|
|
.field
|
2014-01-01 21:26:35 +01:00
|
|
|
= f.label Event.human_attribute_name :region
|
|
|
|
= f.select :region,
|
2014-01-10 16:35:58 +01:00
|
|
|
options_from_collection_for_select(Region.all, 'id', 'name', @event.region && @event.region.id)
|
2013-12-28 23:45:13 +01:00
|
|
|
.field
|
2014-01-01 21:26:35 +01:00
|
|
|
= f.label Event.human_attribute_name :locality
|
|
|
|
= 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)
|
2013-12-28 23:45:13 +01:00
|
|
|
.field
|
2014-04-05 01:21:09 +02:00
|
|
|
.helper= raw markdown.render t '.url_helper'
|
2014-01-01 21:26:35 +01:00
|
|
|
= f.label Event.human_attribute_name :url
|
2014-05-26 01:06:43 +02:00
|
|
|
= f.text_field :url, required: true, size: 70
|
2013-12-28 23:45:13 +01:00
|
|
|
.field
|
2014-04-05 01:21:09 +02:00
|
|
|
.helper= raw markdown.render t '.contact_helper'
|
2014-01-01 21:26:35 +01:00
|
|
|
= f.label Event.human_attribute_name :contact
|
2014-05-26 01:06:43 +02:00
|
|
|
= f.text_field :contact, required: true, size: 70
|
2013-12-28 23:45:13 +01:00
|
|
|
.field
|
2014-04-05 01:21:09 +02:00
|
|
|
.helper= raw markdown.render t '.submitter_helper'
|
2013-12-28 23:45:13 +01:00
|
|
|
= f.label :submitter
|
2014-05-26 01:06:43 +02:00
|
|
|
= f.text_field :submitter, required: true, size: 70
|
2013-12-28 23:45:13 +01:00
|
|
|
.field
|
2014-04-05 01:21:09 +02:00
|
|
|
.helper= raw markdown.render 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-01-01 21:26:35 +01:00
|
|
|
= f.submit t('.visualise'), name: :visu
|
|
|
|
= f.submit t('.save')
|