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

86 lines
2.7 KiB
Plaintext

- set_event_meta
%h2
- if @event.locality?
%em.locality.fa.fa-globe(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_1'}")
- else
%em.locality.fa.fa-shield(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_0'}")
%em.city(title="#{@event.full_address}")= @event.city
= title @event.title
- if @event.persisted? && request.format == 'text/html' && controller.controller_name == 'events' && controller.action_name == 'show'
%aside#lug-list
- if @event.related_region.lugs.present?
%h1
%em.fa.fa-users
=t '.lug-list'
- if @event.related_region
%ul
- @event.related_region.lugs.order(department: :asc).each do |lug|
%li
= link_to lug.name, lug
(#{lug.department})
= link_to lug.url do
= image_tag lug.url+'/favicon.ico', alt: '', class: :favicon
%h1=t '.actions'
%h2
= link_to event_path @event, protocol: :webcal, format: :ics do
%em.fa.fa-lg.fa-calendar
=t '.add_to_calendar'
- if user_signed_in?
%h2
= link_to edit_moderation_path @event do
%em.fa.fa-lg.fa-pencil
=t '.edit'
%h2
= link_to cancel_event_path @event, secret: @event.secret do
%em.fa.fa-lg.fa-thumbs-down
=t '.cancel'
%h3=t '.dateAndPlace'
%p= display_date
%p.full_address
- if @event.address.present?
%span= @event.address
%span= link_to @event.city, "http://fr.wikipedia.org/wiki/#{url_encode @event.city}"
%span= link_to @event.related_region.try(:name),
"http://fr.wikipedia.org/wiki/#{url_encode @event.related_region.try(:name)}"
- if @event.latitude && @event.longitude
#map.event{ data: { |
url: "#{maps_path format: :json}", |
latitude: "#{@event.latitude}", |
longitude: "#{@event.longitude}" } } |
- elsif controller.action_name != 'show'
%em.fa.fa-compress
%em
=raw t '.noMap'
%a(href="http://osm.org/search?query=#{@event.full_address}")
%img(src='http://www.openstreetmap.org/assets/osm_logo.png' alt='OSM logo' width='22px')
%h3=t '.description'
.description
= description sanitize @event.description,
tags: %w(p br table tr th td ul ol li a strong b em i img),
attributes: %w(href src width height style)
%h3=t '.infos'
%p
%span.label= Event.human_attribute_name :url
= link_to @event.url, @event.url
%p
%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 && @event.tags.present?
%p.tags
%span.label= Event.human_attribute_name :tags
- @event.tags.split.each do |tag|
= link_to tag, tag_path(tag)