5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 20:46:22 +00:00
panel/app/views/posts/attributes/_event.haml

33 lines
1.3 KiB
Text
Raw Normal View History

2020-06-28 00:42:15 +00:00
-#
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",
2020-06-28 00:42:15 +00:00
post_label_t(attribute, :date, post: post)
= date_field_tag(*field_name_for(base, attribute, dt, :date),
2020-06-28 00:42:15 +00:00
value: metadata.value.dig(dt.to_s, 'date'),
**field_options(attribute, metadata, required: true))
.col
.time.form-group
= label_tag "#{base}_#{attribute}_#{dt}_time",
2020-06-28 00:42:15 +00:00
post_label_t(attribute, :time, post: post)
= time_field_tag(*field_name_for(base, attribute, dt, :time),
2020-06-28 00:42:15 +00:00
value: metadata.value.dig(dt.to_s, 'time'),
**field_options(attribute, metadata))
.col
.zone.form-group
= label_tag "#{base}_#{attribute}_#{dt}_zone",
2020-06-28 00:42:15 +00:00
post_label_t(attribute, :zone, post: post)
= select_tag(plain_field_name_for(base, attribute, dt, :zone),
2020-06-28 00:42:15 +00:00
options_for_select(MetadataEvent::TIMEZONES, metadata.value.dig(dt.to_s, 'zone') || '00:00'),
**field_options(attribute, metadata))