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

80 lines
2.3 KiB
Plaintext

- 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]
%p= display_date @event
%p.full_address
- if @event.place_name.present?
%span.place_name= @event.place_name
- if @event.address.present?
%span.address= @event.address
%span.city= @event.city
%span.region
= t @event.region.code.presence || @event.region.name, scope: :countries,
default: @event.region.name
- if @event.latitude && @event.longitude
.event#map{ data: { url: maps_path(format: :json),
latitude: @event.latitude, longitude: @event.longitude } }
- elsif controller.action_name != 'show'
%em.fa.fa-compress
%em
= t '.noMap'
%a{ target: '_blank',
href: "https://osm.org/search?query=#{@event.full_address}" }
= image_tag 'osm_logo.svg', alt: 'OSM logo', width: '32px'
.description
= description sanitize @event.description,
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
- 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-redo-alt
= @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