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,13 +2,13 @@
%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
@ -28,6 +28,22 @@
= 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,
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
@ -45,22 +61,22 @@
%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')
%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

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.