Il est maintenant possible de dupliquer un événement

This commit is contained in:
echarp 2014-12-13 00:28:44 +01:00
parent 42b80e3583
commit abb881405d
4 changed files with 43 additions and 22 deletions

View File

@ -0,0 +1,3 @@
table tfoot td canvas
width: 100% !important
background-color: white

View File

@ -2,18 +2,18 @@
%h2
- if @event.locality?
%em.locality.fa.fa-globe(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_1'}")
%em.locality.fa.fa-globe{ title: 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
%em.locality.fa.fa-shield{ title: 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'
- if 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'
= t '.lug-list'
- if @event.related_region
%ul
- @event.related_region.lugs.order(department: :asc).each do |lug|
@ -21,54 +21,70 @@
= link_to lug.name, lug
(#{lug.department})
= link_to lug.url do
= image_tag lug.url+'/favicon.ico', alt: '', class: :favicon
= image_tag lug.url + '/favicon.ico', alt: '', class: :favicon
%h1=t '.actions'
%h1= t '.actions'
%h2
= link_to event_path @event, protocol: :webcal, format: :ics do
%em.fa.fa-lg.fa-calendar
=t '.add_to_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,
address: @event.address,
city: @event.city,
region: @event.region,
locality: @event.locality,
url: @event.url,
contact: @event.contact,
submitter: @event.submitter,
tags: @event.tags }),
method: :post do
%em.fa.fa-copy
= t '.copy'
- if user_signed_in?
%h2
= link_to edit_moderation_path @event do
%em.fa.fa-lg.fa-pencil
=t '.edit'
= t '.edit'
%h2
= link_to cancel_event_path @event, secret: @event.secret do
%em.fa.fa-lg.fa-thumbs-down
=t '.cancel'
= t '.cancel'
%h3=t '.dateAndPlace'
%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.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)}"
"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}" } } |
.event#map{ 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')
= 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'
%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'
%h3= t '.infos'
%p
%span.label= Event.human_attribute_name :url
= link_to @event.url, @event.url

View File

@ -44,6 +44,7 @@ en:
show:
lug-list: Region's associations
add_to_calendar: Add to my calendar
copy: Duplicate event
at: At
dateAndPlace: Date and place
noMap: No OpenStreetMap map could be associated to this address. You can

View File

@ -44,6 +44,7 @@ fr:
show:
lug-list: Asso de la région
add_to_calendar: Ajouter à mon calendrier
copy: Dupliquer événement
at: À
dateAndPlace: Date et lieu
noMap: Aucune carte OpenStreetMap n'a pu être associée à cette adresse.