Browse Source

Event's meta data presented as a dictionnary list

remotes/origin/master
echarp 2 years ago
parent
commit
8ab5b615d9
  1. 6
      app/assets/stylesheets/list.sass
  2. 11
      app/assets/stylesheets/stats.sass
  3. 2
      app/views/events/_event.haml
  4. 45
      app/views/events/show.html.haml
  5. 2
      app/views/moderations/validate.html.haml
  6. 11
      app/views/orgas/show.html.haml

6
app/assets/stylesheets/list.sass

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

11
app/assets/stylesheets/stats.sass

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

2
app/views/events/_event.haml

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

45
app/views/events/show.html.haml

@ -33,7 +33,7 @@
%em
= t '.noMap'
%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'
.description
@ -44,29 +44,32 @@
%h3
%em.fa.fa-info-circle
= t '.infos'
- if @event.url.present?
%p
%em.fa.fa-external-link-alt
%span.label= Event.human_attribute_name :url
= link_to @event.url, @event.url
- if @event.contact.present?
%p
%em.fa.fa-envelope
%span.label= Event.human_attribute_name :contact
= mail_to @event.contact, nil,
encode: (request.format == 'text/html' ? :javascript : nil),
replace_at: ' CHEZ ', replace_dot: ' POINT '
- if @event.tags&.present?
%p.tags
%em.fa.fa-tags
%span.label= Event.human_attribute_name :tags
- @event.tags.each do |tag|
= link_to tag, tag_path(tag.name), rel: :tag
%dl
- if @event.url.present?
%dt.url
%em.fa.fa-external-link-alt
= Event.human_attribute_name :url
%dd
= link_to @event.url, @event.url
- if @event.contact.present?
%dt.contact
%em.fa.fa-envelope
= Event.human_attribute_name :contact
%dd
= mail_to @event.contact, nil,
encode: (request.format == 'text/html' ? :javascript : nil),
replace_at: ' CHEZ ', replace_dot: ' POINT '
- if @event.tags&.any?
%dt.tags
%em.fa.fa-tags
= 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
%h3
%em.fa.fa-repeat
%em.fa.fa-redo-alt
= @event.schedule
- if @event.moderated?

2
app/views/moderations/validate.html.haml

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

11
app/views/orgas/show.html.haml

@ -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],
attributes: %w[href src width height style title]
%h3
%em.fa.fa-info-circle
= t '.infos'
%dl
%dd
%h3
%em.fa.fa-info-circle
= t '.infos'
- if @orga.department.present?
%dt.department
%em.fa.fa-puzzle-piece
@ -61,7 +60,7 @@
%dd= mail_to @orga.contact, nil,
encode: (request.format == 'text/html' ? :javascript : nil),
replace_at: ' CHEZ ', replace_dot: ' POINT '
- if @orga.tags.any?
- if @orga.tags&.any?
%dt.tags
%em.fa.fa-tags
= Event.human_attribute_name :tags
@ -78,7 +77,7 @@
= Orga.human_attribute_name :updated_at
%dd= l @orga.updated_at.to_date, format: :long
- if @events_future && @events_future.any?
- if @events_future&.any?
%dt.future
%em.fa.fa-forward
= t '.future'

Loading…
Cancel
Save