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

76 lines
2.4 KiB
Plaintext
Raw Normal View History

- set_event_meta
%h2
2014-07-07 22:32:26 +02:00
%em.city= @event.city
= title @event.title
2014-07-18 23:20:30 +02:00
- 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=t '.lug-list'
- if @event.related_region
%ul
- @event.related_region.lugs.order(department: :asc).each do |lug|
%li
= link_to lug.name, lug.url
(#{lug.department})
%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
2014-07-01 15:50:39 +02:00
= link_to edit_moderation_path @event do
%em.fa.fa-lg.fa-pencil
2014-07-01 15:50:39 +02:00
=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
2014-07-01 15:50:39 +02:00
=t '.cancel'
2013-12-29 23:25:38 +01:00
%h3=t '.dateAndPlace'
2014-08-23 16:59:42 +02:00
2013-12-28 23:45:13 +01:00
%p
2013-12-29 23:25:38 +01:00
- if @event.same_day?
Le #{l @event.start_time.to_date, format: :long},
de #{l @event.start_time, format: :hours} à #{l @event.end_time, format: :hours}.
2013-12-29 23:25:38 +01:00
- else
Du
=l @event.start_time, format: :at
au
#{l @event.end_time, format: :at}.
2013-12-28 23:45:13 +01:00
%p
2014-08-23 16:59:42 +02:00
= raw [@event.address.present? ? @event.address : nil,
link_to(@event.city, "http://fr.wikipedia.org/wiki/#{url_encode @event.city}"),
link_to(@event.related_region.try(:name),
"http://fr.wikipedia.org/wiki/#{url_encode @event.related_region.name}")].compact.join(', ')
- if @event.latitude && @event.longitude
#map(latitude="#{@event.latitude}" longitude="#{@event.longitude}")
2013-12-29 23:25:38 +01:00
%h3=t '.description'
.description
- markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true)
= description sanitize markdown.render(@event.description),
2014-07-18 17:01:51 +02:00
tags: %w(p br table tr th td ul ol li a strong b em i img),
attributes: %w(href src width height)
2013-12-29 23:25:38 +01:00
%h3=t '.infos'
2013-12-28 23:45:13 +01:00
%p
%span.label= Event.human_attribute_name :url
2013-12-29 23:25:38 +01:00
= link_to @event.url, @event.url
2013-12-28 23:45:13 +01:00
%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 '
2013-12-28 23:45:13 +01:00
2014-07-01 15:50:39 +02:00
- if @event.tags && @event.tags.present?
%p.tags
%span.label= Event.human_attribute_name :tags
- @event.tags.split.each do |tag|
= link_to tag, events_url(tag: tag)