Les changements d'un evt sont maintenant mieux affichés dans les mails

This commit is contained in:
echarp 2014-07-20 02:42:46 +02:00
parent 0b7e3d3116
commit a1e70d9a29
7 changed files with 35 additions and 63 deletions

View File

@ -9,17 +9,6 @@
=t '.delete_link' =t '.delete_link'
= cancel_event_url @event, secret: @event.secret = cancel_event_url @event, secret: @event.secret
\ \
===================================================== = render file: '/events/show'
#{Event.human_attribute_name :title}: #{@event.title}
#{Event.human_attribute_name :start_time}: #{l @event.start_time, format: :at}
#{Event.human_attribute_name :end_time}: #{l @event.end_time, format: :at}
#{Event.human_attribute_name :region}: #{@event.region}
#{Event.human_attribute_name :city}: #{@event.city}
#{Event.human_attribute_name :url}: #{@event.url}
#{Event.human_attribute_name :contact}: #{@event.contact}
#{Event.human_attribute_name :submitter}: #{@event.submitter}
#{Event.human_attribute_name :tags}: #{@event.tags}
#{Event.human_attribute_name :description}: #{raw @event.description}
=====================================================
\ \
=t '.signature' =t '.signature'

View File

@ -7,17 +7,6 @@
=t '.reclamation' =t '.reclamation'
\ \
=t '.reminder' =t '.reminder'
===================================================== = render file: '/events/show'
#{Event.human_attribute_name :title}: #{@event.title}
#{Event.human_attribute_name :start_time}: #{l @event.start_time, format: :at}
#{Event.human_attribute_name :end_time}: #{l @event.end_time, format: :at}
#{Event.human_attribute_name :region}: #{@event.region}
#{Event.human_attribute_name :city}: #{@event.city}
#{Event.human_attribute_name :url}: #{@event.url}
#{Event.human_attribute_name :contact}: #{@event.contact}
#{Event.human_attribute_name :submitter}: #{@event.submitter}
#{Event.human_attribute_name :tags}: #{@event.tags}
#{Event.human_attribute_name :description}: #{raw @event.description}
=====================================================
\ \
=t '.signature' =t '.signature'

View File

@ -0,0 +1,12 @@
=====================================================
#{Event.human_attribute_name :title}: #{@event.title}
#{Event.human_attribute_name :start_time}: #{l @event.start_time, format: :at}
#{Event.human_attribute_name :end_time}: #{l @event.end_time, format: :at}
#{Event.human_attribute_name :region}: #{@event.region}
#{Event.human_attribute_name :city}: #{@event.city}
#{Event.human_attribute_name :url}: #{@event.url}
#{Event.human_attribute_name :contact}: #{@event.contact}
#{Event.human_attribute_name :submitter}: #{@event.submitter}
#{Event.human_attribute_name :tags}: #{@event.tags}
#{Event.human_attribute_name :description}: #{raw @event.description}
=====================================================

View File

@ -2,17 +2,6 @@
\ \
=t '.body', author: @current_user =t '.body', author: @current_user
\ \
===================================================== = render file: '/events/show'
#{Event.human_attribute_name :title}: #{@event.title}
#{Event.human_attribute_name :start_time}: #{l @event.start_time, format: :at}
#{Event.human_attribute_name :end_time}: #{l @event.end_time, format: :at}
#{Event.human_attribute_name :region}: #{@event.region}
#{Event.human_attribute_name :city}: #{@event.city}
#{Event.human_attribute_name :url}: #{@event.url}
#{Event.human_attribute_name :contact}: #{@event.contact}
#{Event.human_attribute_name :submitter}: #{@event.submitter}
#{Event.human_attribute_name :tags}: #{@event.tags}
#{Event.human_attribute_name :description}: #{raw @event.description}
=====================================================
\ \
=t '.signature' =t '.signature'

View File

@ -3,15 +3,6 @@
=t '.body', subject: @event.title, start_time: l(@event.start_time, format: :at) =t '.body', subject: @event.title, start_time: l(@event.start_time, format: :at)
= moderations_url = moderations_url
\ \
#{Event.human_attribute_name :title}: #{@event.title} = render file: '/events/show'
#{Event.human_attribute_name :start_time}: #{l @event.start_time, format: :at}
#{Event.human_attribute_name :end_time}: #{l @event.end_time, format: :at}
#{Event.human_attribute_name :region}: #{@event.region}
#{Event.human_attribute_name :city}: #{@event.city}
#{Event.human_attribute_name :url}: #{@event.url}
#{Event.human_attribute_name :contact}: #{@event.contact}
#{Event.human_attribute_name :submitter}: #{@event.submitter}
#{Event.human_attribute_name :tags}: #{@event.tags}
#{Event.human_attribute_name :description}: #{raw @event.description}
\ \
=t '.signature' =t '.signature'

View File

@ -5,17 +5,6 @@
= @reason = @reason
\ \
=t '.reminder' =t '.reminder'
===================================================== = render file: '/events/show'
#{Event.human_attribute_name :title}: #{@event.title}
#{Event.human_attribute_name :start_time}: #{l @event.start_time, format: :at}
#{Event.human_attribute_name :end_time}: #{l @event.end_time, format: :at}
#{Event.human_attribute_name :region}: #{@event.region}
#{Event.human_attribute_name :city}: #{@event.city}
#{Event.human_attribute_name :url}: #{@event.url}
#{Event.human_attribute_name :contact}: #{@event.contact}
#{Event.human_attribute_name :submitter}: #{@event.submitter}
#{Event.human_attribute_name :tags}: #{@event.tags}
#{Event.human_attribute_name :description}: #{raw @event.description}
=====================================================
\ \
=t '.signature' =t '.signature'

View File

@ -2,11 +2,24 @@
\ \
=t '.body', subject: @event.title, author: @current_user||t('.submitter') =t '.body', subject: @event.title, author: @current_user||t('.submitter')
- Differ.format = :ascii - new = render file: '/events/show'
= raw Differ.diff(@event.description, @event.description_was).to_s |
.gsub(/\[31m/, '') | - former = @event
.gsub(/\[32m/, '') | - @event = Event.new(title: @event.title_was,
.gsub(/\[0m/, '') | start_time: @event.start_time_was,
end_time: @event.end_time_was,
region: @event.region_was,
city: @event.city_was,
url: @event.url_was,
contact: @event.contact_was,
submitter: @event.submitter_was,
tags: @event.tags_was,
description: @event.description_was)
- prev = render file: '/events/show'
- @event = former
= raw Differ.diff new, prev
\ \
- if @current_user - if @current_user
= edit_moderation_url @event = edit_moderation_url @event