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;
padding: 0.5em;
margin: 0;
background-color: lighten($colour-3, 33%);
border: 2px solid #DDD;
white-space: nowrap;
border-bottom: 1px solid #DDD;
//white-space: nowrap;
&:nth-child(odd) {
margin-right: -3px;
float: left;
clear: left;
}
&:nth-child(even) {
background-color: lighten($colour-5 , 33%);
ins {
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',
"The #{@locale_name} translation for #{@workshop.title} has been modified",
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

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

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

Loading…
Cancel
Save