Event's meta data presented as a dictionnary list

This commit is contained in:
echarp 2020-01-04 12:42:37 +01:00
parent 25f7f1cc0c
commit 8ab5b615d9
6 changed files with 41 additions and 36 deletions

View File

@ -24,13 +24,11 @@ table
text-align: center text-align: center
dl dl
width: 40em
margin: 1em auto
dt dt
clear: left clear: left
float: left float: left
padding: 0.2em 1em padding: 0.2em 1em
min-width: 50% min-width: 12em
text-align: right text-align: right
dd dd
padding: 0.2em 1em padding: 0.2em 1em
@ -39,8 +37,6 @@ dl
padding-right: 16em padding-right: 16em
h3 h3
display: inline display: inline
dt + dd + dt +dd
border-top: 1px solid #999
ul.counters ul.counters
text-align: center text-align: center

View File

@ -1,5 +1,12 @@
body.stats h3 body.stats
text-align: center h3
text-align: center
dl
width: 40em
dt
min-width: 50%
dt + dd + dt +dd
border-top: 1px solid #999
table.list.dates table.list.dates
width: 100% width: 100%

View File

@ -5,4 +5,4 @@
%strong.city{ title: event.address }= event.city %strong.city{ title: event.address }= event.city
= event.title = event.title
- if event.repeat&.positive? - if event.repeat&.positive?
%em.fa.fa-repeat{ title: event.schedule } %em.fa.fa-redo-alt{ title: event.schedule }

View File

@ -33,7 +33,7 @@
%em %em
= t '.noMap' = t '.noMap'
%a{ target: '_blank', %a{ target: '_blank',
href: 'https://osm.org/search?query=' + @event.full_address } href: "https://osm.org/search?query=#{@event.full_address}" }
= image_tag 'osm_logo.svg', alt: 'OSM logo', width: '32px' = image_tag 'osm_logo.svg', alt: 'OSM logo', width: '32px'
.description .description
@ -44,29 +44,32 @@
%h3 %h3
%em.fa.fa-info-circle %em.fa.fa-info-circle
= t '.infos' = t '.infos'
- if @event.url.present? %dl
%p - if @event.url.present?
%em.fa.fa-external-link-alt %dt.url
%span.label= Event.human_attribute_name :url %em.fa.fa-external-link-alt
= link_to @event.url, @event.url = Event.human_attribute_name :url
- if @event.contact.present? %dd
%p = link_to @event.url, @event.url
%em.fa.fa-envelope - if @event.contact.present?
%span.label= Event.human_attribute_name :contact %dt.contact
= mail_to @event.contact, nil, %em.fa.fa-envelope
encode: (request.format == 'text/html' ? :javascript : nil), = Event.human_attribute_name :contact
replace_at: ' CHEZ ', replace_dot: ' POINT ' %dd
= mail_to @event.contact, nil,
- if @event.tags&.present? encode: (request.format == 'text/html' ? :javascript : nil),
%p.tags replace_at: ' CHEZ ', replace_dot: ' POINT '
%em.fa.fa-tags - if @event.tags&.any?
%span.label= Event.human_attribute_name :tags %dt.tags
- @event.tags.each do |tag| %em.fa.fa-tags
= link_to tag, tag_path(tag.name), rel: :tag = Event.human_attribute_name :tags
%dd
- @event.tags.each do |tag|
= link_to tag, tag_path(tag.name), rel: :tag
- if @event.repeat&.positive? && @event.rule - if @event.repeat&.positive? && @event.rule
%h3 %h3
%em.fa.fa-repeat %em.fa.fa-redo-alt
= @event.schedule = @event.schedule
- if @event.moderated? - if @event.moderated?

View File

@ -28,7 +28,7 @@
- if @event.repeat.positive? - if @event.repeat.positive?
%fieldset %fieldset
%legend %legend
%em.fa.fa-repeat %em.fa.fa-redo-alt
= Event.human_attribute_name :repeat = Event.human_attribute_name :repeat
%h3= t '.repeat_helper', count: @event.repeat %h3= t '.repeat_helper', count: @event.repeat

View File

@ -29,11 +29,10 @@
tags: %w[p h1 h2 h3 h4 br table tr th td ul ol li a strong b em i img sub sup span], tags: %w[p h1 h2 h3 h4 br table tr th td ul ol li a strong b em i img sub sup span],
attributes: %w[href src width height style title] attributes: %w[href src width height style title]
%h3
%em.fa.fa-info-circle
= t '.infos'
%dl %dl
%dd
%h3
%em.fa.fa-info-circle
= t '.infos'
- if @orga.department.present? - if @orga.department.present?
%dt.department %dt.department
%em.fa.fa-puzzle-piece %em.fa.fa-puzzle-piece
@ -61,7 +60,7 @@
%dd= mail_to @orga.contact, nil, %dd= mail_to @orga.contact, nil,
encode: (request.format == 'text/html' ? :javascript : nil), encode: (request.format == 'text/html' ? :javascript : nil),
replace_at: ' CHEZ ', replace_dot: ' POINT ' replace_at: ' CHEZ ', replace_dot: ' POINT '
- if @orga.tags.any? - if @orga.tags&.any?
%dt.tags %dt.tags
%em.fa.fa-tags %em.fa.fa-tags
= Event.human_attribute_name :tags = Event.human_attribute_name :tags
@ -78,7 +77,7 @@
= Orga.human_attribute_name :updated_at = Orga.human_attribute_name :updated_at
%dd= l @orga.updated_at.to_date, format: :long %dd= l @orga.updated_at.to_date, format: :long
- if @events_future && @events_future.any? - if @events_future&.any?
%dt.future %dt.future
%em.fa.fa-forward %em.fa.fa-forward
= t '.future' = t '.future'