sutty/app/views/posts/attributes/_event.haml

33 lines
1.3 KiB
Plaintext

-#
El evento tiene dos grupos, comienzo y final del evento, cada uno con
fecha, hora y zona horaria
%fieldset.event
%legend= post_label_t(attribute, post: post)
= render 'posts/attribute_feedback',
post: post, attribute: attribute, metadata: metadata
- %i[dtstart dtend].each do |dt|
.row{ class: dt }
.col
.date.form-group
= label_tag "#{base}_#{attribute}_#{dt}_date",
post_label_t(attribute, :date, post: post)
= date_field_tag(*field_name_for(base, attribute, dt, :date),
value: metadata.value.dig(dt.to_s, 'date'),
**field_options(attribute, metadata, required: true))
.col
.time.form-group
= label_tag "#{base}_#{attribute}_#{dt}_time",
post_label_t(attribute, :time, post: post)
= time_field_tag(*field_name_for(base, attribute, dt, :time),
value: metadata.value.dig(dt.to_s, 'time'),
**field_options(attribute, metadata))
.col
.zone.form-group
= label_tag "#{base}_#{attribute}_#{dt}_zone",
post_label_t(attribute, :zone, post: post)
= select_tag(plain_field_name_for(base, attribute, dt, :zone),
options_for_select(MetadataEvent::TIMEZONES, metadata.value.dig(dt.to_s, 'zone') || '00:00'),
**field_options(attribute, metadata))