From abb881405dbff2ad36cdfca8733f7fd9f85b4dc9 Mon Sep 17 00:00:00 2001 From: echarp Date: Sat, 13 Dec 2014 00:28:44 +0100 Subject: [PATCH] =?UTF-8?q?Il=20est=20maintenant=20possible=20de=20dupliqu?= =?UTF-8?q?er=20un=20=C3=A9v=C3=A9nement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/stylesheets/stats.css.sass | 3 ++ app/views/events/show.html.haml | 60 +++++++++++++++++---------- config/locales/views/en.yml | 1 + config/locales/views/fr.yml | 1 + 4 files changed, 43 insertions(+), 22 deletions(-) create mode 100644 app/assets/stylesheets/stats.css.sass diff --git a/app/assets/stylesheets/stats.css.sass b/app/assets/stylesheets/stats.css.sass new file mode 100644 index 00000000..4688207f --- /dev/null +++ b/app/assets/stylesheets/stats.css.sass @@ -0,0 +1,3 @@ +table tfoot td canvas + width: 100% !important + background-color: white diff --git a/app/views/events/show.html.haml b/app/views/events/show.html.haml index d80f0349..f87f2758 100644 --- a/app/views/events/show.html.haml +++ b/app/views/events/show.html.haml @@ -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 diff --git a/config/locales/views/en.yml b/config/locales/views/en.yml index 9c128bc4..f41e6a58 100644 --- a/config/locales/views/en.yml +++ b/config/locales/views/en.yml @@ -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 diff --git a/config/locales/views/fr.yml b/config/locales/views/fr.yml index bf878a1b..dfe81899 100644 --- a/config/locales/views/fr.yml +++ b/config/locales/views/fr.yml @@ -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.