95 lines
3.0 KiB
Plaintext
95 lines
3.0 KiB
Plaintext
= form_for @event,
|
|
url: { action: @event.new_record? ? :create : :update } do |f|
|
|
- if @event.persisted?
|
|
= f.hidden_field :lock_version
|
|
- unless @moderation
|
|
= hidden_field_tag :secret, params[:secret]
|
|
|
|
- if @event.errors.any?
|
|
#flash-messages
|
|
- @event.errors.full_messages.each do |msg|
|
|
%p.flash.alert= msg
|
|
|
|
.field.title.required
|
|
= f.label :title
|
|
= f.text_field :title, required: true, placeholder: t('.title_helper')
|
|
.field.start_time.required
|
|
= f.label :start_time
|
|
= f.datetime_select :start_time, default: 1.day.from_now
|
|
.field.end_time.required
|
|
= f.label :end_time
|
|
= f.datetime_select :end_time, default: 1.day.from_now
|
|
|
|
.field.place_name
|
|
= f.label :place_name
|
|
= f.text_field :place_name
|
|
.helper
|
|
:markdown
|
|
#{t '.address_helper_html'}
|
|
.field.address
|
|
= f.label :address
|
|
= f.text_field :address, list: :addresses
|
|
%datalist#addresses
|
|
- Event.where('address is not null').group(:address).order('1 desc').count.each do |r|
|
|
%option= r[0]
|
|
.field.city.required
|
|
= f.label :city
|
|
= f.text_field :city, required: true, list: :cities
|
|
%datalist#cities
|
|
- Event.group(:city).order('1 desc').count.each do |r|
|
|
%option= r[0]
|
|
.field.region.required
|
|
= f.label :region
|
|
= render partial: '/regions/selector', locals: { f: f }
|
|
.field.locality
|
|
= f.label :locality
|
|
%span.radios
|
|
= f.radio_button :locality, 0
|
|
= f.label 'locality_0' do
|
|
%em.fa.fa-shield-alt
|
|
= t 'attributes.locality_0'
|
|
= f.radio_button :locality, 1
|
|
= f.label 'locality_1' do
|
|
%em.fa.fa-globe
|
|
= t 'attributes.locality_1'
|
|
|
|
.field.description.required{ title: t('.description_helper') }
|
|
= f.label :description
|
|
/= f.text_area :description, rows: 25, class: :description
|
|
= f.text_field :description, class: :description
|
|
|
|
.field.url{ title: t('.url_helper') }
|
|
= f.label :url
|
|
= f.url_field :url, placeholder: 'Ex: https://april.org'
|
|
.field.contact{ title: t('.contact_helper') }
|
|
= f.label :contact
|
|
= f.email_field :contact
|
|
.field.submitter.required{ title: t('.submitter_helper') }
|
|
= f.label :submitter
|
|
= f.email_field :submitter, required: true
|
|
|
|
.field.tags{ title: t('.tags_helper') }
|
|
= f.label :tags, for: 'event_tag_list_tag'
|
|
= f.text_field :tag_list, value: f.object.tag_list.to_s
|
|
|
|
- unless @event.moderated?
|
|
.field.repeat{ title: t('.repeat_helper') }
|
|
= f.label :repeat
|
|
= f.number_field :repeat, in: 0..40
|
|
.field.rule.required{ title: 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')
|
|
|
|
.actions
|
|
= f.button formaction: url_for(action: @event.new_record? ? :preview_create : :preview) do
|
|
%em.fa.fa-eye
|
|
= t '.visualise'
|
|
|
|
= f.button do
|
|
%em.fa.fa-check
|
|
= t '.save'
|