Browse Source

Fixed translation notification emails

development
Godwin 8 years ago
parent
commit
e57eba4157
  1. 14
      app/assets/stylesheets/user-mailer.scss
  2. 7
      app/mailers/user_mailer.rb
  3. 5
      app/views/user_mailer/workshop_original_content_changed.html.haml
  4. 5
      app/views/user_mailer/workshop_translated.html.haml

14
app/assets/stylesheets/user-mailer.scss

@ -207,17 +207,21 @@ pre {
display: inline-block; display: inline-block;
padding: 0.5em; padding: 0.5em;
margin: 0; margin: 0;
background-color: lighten($colour-3, 33%); border-bottom: 1px solid #DDD;
border: 2px solid #DDD; //white-space: nowrap;
white-space: nowrap;
&:nth-child(odd) { &:nth-child(odd) {
margin-right: -3px; margin-right: -3px;
float: left; float: left;
clear: left;
} }
&:nth-child(even) { ins {
background-color: lighten($colour-5 , 33%); color: #080;//lighten($colour-3, 33%);
}
del {
color: #800;
} }
} }
} }

7
app/mailers/user_mailer.rb

@ -88,13 +88,6 @@ class UserMailer < ActionMailer::Base
@subject = (_'email.subject.workshop_translated', @subject = (_'email.subject.workshop_translated',
"The #{@locale_name} translation for #{@workshop.title} has been modified", "The #{@locale_name} translation for #{@workshop.title} has been modified",
vars: {language: @language_name, workshop_title: @workshop.title}) vars: {language: @language_name, workshop_title: @workshop.title})
@data.each do |field, values|
diff = Diffy::Diff.new(values[:old], values[:new])
@data[field][:diff] = {
text: diff.to_s(:text),
html: diff.to_s(:html)
}
end
@wrapper_id = :full_width @wrapper_id = :full_width

5
app/views/user_mailer/workshop_original_content_changed.html.haml

@ -5,9 +5,8 @@
%b=_'email.translations.headings.new_value' %b=_'email.translations.headings.new_value'
%blockquote=_!values[:new].html_safe %blockquote=_!values[:new].html_safe
%b=_'email.translations.headings.old_value' %b=_'email.translations.headings.old_value'
%blockquote=_!values[:old].html_safe - if values[:old].present?
%b=_'email.translations.headings.diff' %blockquote=_!values[:old].html_safe
=_!(values[:diff][:html].html_safe)
%p %p
=_'email.workshop.paragraph.view_workshop',"You can view the workshop here: " =_'email.workshop.paragraph.view_workshop',"You can view the workshop here: "

5
app/views/user_mailer/workshop_translated.html.haml

@ -5,9 +5,8 @@
%b=_'email.translations.headings.new_value' %b=_'email.translations.headings.new_value'
%blockquote=_!values[:new].html_safe %blockquote=_!values[:new].html_safe
%b=_'email.translations.headings.old_value' %b=_'email.translations.headings.old_value'
%blockquote=_!values[:old].html_safe - if values[:old].present?
%b=_'email.translations.headings.diff' %blockquote=_!values[:old].html_safe
=_!(values[:diff][:html].html_safe)
%p %p
=_'email.workshop.paragraph.view_workshop',"You can view the workshop here: " =_'email.workshop.paragraph.view_workshop',"You can view the workshop here: "

Loading…
Cancel
Save