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

129 lines
4.0 KiB
Plaintext
Raw Normal View History

- set_event_meta
2017-01-19 14:54:50 +01:00
- if @event.tags.any? { |t| t.name.include? 'libre-en-fete' }
Cet événement s'inscrit dans le cadre de
2017-10-14 21:39:56 +02:00
%a(href='https://www.libre-en-fete.net')
= image_tag 'lef.png', width: '180', height: '60', alt: 'Libre en Fete',
style: 'vertical-align: middle'
%h2
- if @event.locality?
%em.locality.fa.fa-globe{ title: t('attributes.locality_1') }
- else
%em.locality.fa.fa-shield{ title: t('attributes.locality_0') }
%em.city{ title: @event.full_address }= @event.city
= title @event.title
- if controller.controller_name == 'events' && controller.action_name == 'show'
2015-02-15 17:10:17 +01:00
%aside#orga-list
- if @event.region.present? && @event.region.orgas.present?
%h1
%em.fa.fa-users
2015-02-15 17:10:17 +01:00
= t '.orga-list'
%ul.fa-ul
- @event.region.orgas.select(&:active).each do |orga|
%li
= link_to orga do
- if orga.kind
%em.fa.fa-li{ class: "fa-#{orga.kind.icon}",
title: Kind.human_attribute_name("name_#{orga.kind.name}") }
= orga.name
= image_tag orga.url + '/favicon.ico', alt: '', class: :favicon
2014-12-21 00:34:30 +01:00
%h1
%em.fa.fa-wrench
= t '.actions'
%h2
= link_to event_path @event, protocol: :webcal, format: :ics do
%em.fa.fa-lg.fa-calendar
= t '.add_to_calendar'
%h2
= link_to preview_events_path(event: { title: @event.title,
start_time: @event.start_time + 1.month,
end_time: @event.end_time + 1.month,
description: @event.description,
place_name: @event.place_name,
address: @event.address,
city: @event.city,
region_id: @event.region.id,
locality: @event.locality,
url: @event.url,
tag_list: @event.tag_list.to_s }),
method: :post do
%em.fa.fa-copy
= t '.copy'
- if user_signed_in?
%h2
2014-07-01 15:50:39 +02:00
= link_to edit_moderation_path @event do
%em.fa.fa-lg.fa-pencil
= t '.edit'
%h2
2014-07-01 15:50:39 +02:00
= link_to cancel_event_path @event, secret: @event.secret do
%em.fa.fa-lg.fa-thumbs-down
= t '.cancel'
2013-12-29 23:25:38 +01:00
%h3= t '.dateAndPlace'
2014-08-23 16:59:42 +02:00
%p= display_date
2013-12-29 23:25:38 +01:00
%p.full_address
- if @event.place_name.present?
%span= @event.place_name
- if @event.address.present?
%span= @event.address
%span= link_to @event.city,
2017-10-14 21:39:56 +02:00
"https://fr.wikipedia.org/wiki/#{url_encode @event.city}"
%span= link_to @event.region.try(:name),
2017-10-14 21:39:56 +02:00
"https://fr.wikipedia.org/wiki/#{url_encode @event.region.try :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
= raw t '.noMap'
2017-10-14 21:39:56 +02:00
%a{ href: 'https://osm.org/search?query=' + @event.full_address }
%img(src='https://www.openstreetmap.org/assets/osm_logo.png'
alt='OSM logo' width='22px')
%h3= t '.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
%em.fa.fa-external-link
%span.label= Event.human_attribute_name :url
2018-01-01 17:52:33 +01:00
= link_to @event.url, sanitize(@event.url)
2013-12-28 23:45:13 +01:00
%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
2014-07-01 15:50:39 +02:00
- if @event.tags && @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
- if @event.repeat > 0 && @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