A calendar management project, for events and activities related to communities fighting for freedoms.
This can be related to software, art, data, hardware, content, commons, internet.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
3.0 KiB

= 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?
- @event.errors.full_messages.each do |msg|
%p.flash.alert= msg
= f.label :title
= f.text_field :title, required: true, placeholder: t('.title_helper')
= f.label :start_time
= f.datetime_select :start_time, default: 1.day.from_now
= f.label :end_time
= f.datetime_select :end_time, default: 1.day.from_now
- unless @event.moderated?
= f.label :repeat
= f.number_field :repeat, in: 0..40, maxlength: 2, size: 2
#{t '.rule_helper'}
= f.label :rule
- Event::RULES.each do |rule|
= f.radio_button :rule, rule
= f.label "rule_#{rule}",
t(rule, scope: 'activerecord.attributes.event.rule_values')
#{t '.description_helper'}
= f.label :description
= f.text_area :description, rows: 25, class: :description
= f.label :place_name
= f.text_field :place_name
#{t '.address_helper'}
= f.label :address
= f.text_field :address, list: :addresses
- Event.where('address is not null').group(:address).order('count(address) desc').pluck(:address).each do |address|
%option= address
= f.label :city
= f.text_field :city, required: true, list: :cities
- Event.group(:city).order('count(city) desc').pluck(:city).each do |city|
%option= city
= f.label :region
= f.collection_select :region_id, Region.all, :id, :name,
include_blank: true
= f.label :locality
= f.radio_button :locality, 0
= f.label 'locality_0' do
= t 'attributes.locality_0'
= f.radio_button :locality, 1
= f.label 'locality_1' do
= t 'attributes.locality_1'
#{t '.url_helper'}
= f.label :url
= f.url_field :url, required: true, placeholder: 'Ex: http://april.org'
#{t '.contact_helper'}
= f.label :contact
= f.email_field :contact, required: true
#{t '.submitter_helper'}
= f.label :submitter
= f.email_field :submitter
#{t '.tags_helper'}
= f.label :tags
= f.text_field :tag_list, value: f.object.tag_list.to_s
= f.button formaction: :preview do
= t '.visualise'
= f.button do
= t '.save'