agenda-libre-ruby/app/views/events/show.html.haml

80 lines
2.3 KiB
Plaintext
Raw Normal View History

2019-06-25 22:27:24 +02:00
- event_meta @event
= render partial: '/tags/context', locals: { tags: @event.tag_list }
%h2
- if @event.locality?
%em.locality.fa.fa-globe{ title: t('attributes.locality_1') }
- else
%em.locality.fa.fa-shield-alt{ title: t('attributes.locality_0') }
%em.city{ title: @event.full_address }= @event.city
= title @event.title
= render 'aside' if [controller_name, action_name] == %w[events show]
2013-12-29 23:25:38 +01:00
%h3= t '.dateAndPlace'
2014-08-23 16:59:42 +02:00
2019-06-25 22:27:24 +02:00
%p= display_date @event
2013-12-29 23:25:38 +01:00
%p.full_address
- if @event.place_name.present?
2019-04-29 18:29:38 +02:00
%span.place_name= @event.place_name
- if @event.address.present?
2019-04-29 18:29:38 +02:00
%span.address= @event.address
%span.city= @event.city
%span.region
2019-10-06 16:54:37 +02:00
= t @event.region.code.presence || @event.region.name, scope: :countries,
default: @event.region.name
2014-08-23 16:59:42 +02:00
- if @event.latitude && @event.longitude
.event#map{ data: { url: maps_path(format: :json),
latitude: @event.latitude, longitude: @event.longitude } }
2013-12-29 23:25:38 +01:00
- elsif controller.action_name != 'show'
%em.fa.fa-compress
%em
2019-10-06 16:54:37 +02:00
= t '.noMap'
%a{ target: '_blank',
href: 'https://osm.org/search?query=' + @event.full_address }
2019-10-06 16:54:37 +02:00
= image_tag 'osm_logo.svg', alt: 'OSM logo', width: '32px'
%h3= Event.human_attribute_name :description
.description
= description sanitize @event.description,
2018-01-01 17:52:33 +01:00
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]
2013-12-29 23:25:38 +01:00
%h3
%em.fa.fa-info-circle
= t '.infos'
2017-04-22 11:35:37 +02:00
- if @event.url.present?
%p
2018-03-01 20:46:06 +01:00
%em.fa.fa-external-link-alt
2017-04-22 11:35:37 +02:00
%span.label= Event.human_attribute_name :url
2018-09-30 19:02:49 +02:00
= link_to @event.url, @event.url.html_safe
- 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 '
2013-12-28 23:45:13 +01:00
2018-09-23 18:06:52 +02:00
- if @event.tags&.present?
%p.tags
%em.fa.fa-tags
%span.label= Event.human_attribute_name :tags
- @event.tags.each do |tag|
2016-12-17 18:47:05 +01:00
= link_to tag, tag_path(tag.name), rel: :tag
2018-09-23 18:06:52 +02:00
- if @event.repeat&.positive? && @event.rule
%h3
%em.fa.fa-repeat
= @event.schedule
- if @event.moderated?
%ul
%li= link_to_unless_current @event.event || @event, @event.event || @event
- (@event.event || @event).events.each do |e|
%li= link_to_unless_current e, e