Commit 9d33b5cb873b62fc33ac77365cca3aa645f591dd
1 parent
a6822542
Exists in
master
and in
22 other branches
ActionItem870: some fixes to comments-by-email
* better wording and organization of checkboxes in article edition. * Correcting formatting of the e-mail text sent.
Showing
3 changed files
with
22 additions
and
12 deletions
Show diff stats
app/helpers/article_helper.rb
| @@ -4,13 +4,23 @@ module ArticleHelper | @@ -4,13 +4,23 @@ module ArticleHelper | ||
| 4 | @article = article | 4 | @article = article |
| 5 | content_tag('h4', _('Options')) + | 5 | content_tag('h4', _('Options')) + |
| 6 | content_tag('div', | 6 | content_tag('div', |
| 7 | - check_box(:article, :published) + | ||
| 8 | - content_tag('label', _('Published'), :for => 'article_published') + | ||
| 9 | - check_box(:article, :accept_comments) + | ||
| 10 | - content_tag('label', _('Accept Comments'), :for => 'article_accept_comments') + | ||
| 11 | - check_box(:article, :notify_comments) + | ||
| 12 | - content_tag('label', _('Notify Comments'), :for => 'article_notify_comments') | ||
| 13 | - ) + observe_field(:article_accept_comments, :function => "$('article_notify_comments').disabled = ! $('article_accept_comments').checked") | 7 | + content_tag( |
| 8 | + 'div', | ||
| 9 | + check_box(:article, :published) + | ||
| 10 | + content_tag('label', _('This article must be published (visible to other people)'), :for => 'article_published') | ||
| 11 | + ) + | ||
| 12 | + content_tag( | ||
| 13 | + 'div', | ||
| 14 | + check_box(:article, :accept_comments) + | ||
| 15 | + content_tag('label', _('I want to receive comments about this article'), :for => 'article_accept_comments') | ||
| 16 | + ) + | ||
| 17 | + content_tag( | ||
| 18 | + 'div', | ||
| 19 | + check_box(:article, :notify_comments) + | ||
| 20 | + content_tag('label', _('I want to receive a notification of each comment written by e-mail'), :for => 'article_notify_comments') + | ||
| 21 | + observe_field(:article_accept_comments, :function => "$('article_notify_comments').disabled = ! $('article_accept_comments').checked") | ||
| 22 | + ) | ||
| 23 | + ) | ||
| 14 | end | 24 | end |
| 15 | 25 | ||
| 16 | def cms_label_for_new_children | 26 | def cms_label_for_new_children |
app/models/comment.rb
| @@ -61,9 +61,9 @@ class Comment < ActiveRecord::Base | @@ -61,9 +61,9 @@ class Comment < ActiveRecord::Base | ||
| 61 | :email => (comment.author.nil? ? comment.email : comment.author.email), | 61 | :email => (comment.author.nil? ? comment.email : comment.author.email), |
| 62 | :title => comment.title, | 62 | :title => comment.title, |
| 63 | :body => comment.body, | 63 | :body => comment.body, |
| 64 | - :article_url => comment.article.url, | 64 | + :article_url => comment.url, |
| 65 | :environment => profile.environment.name, | 65 | :environment => profile.environment.name, |
| 66 | - :url => url_for(:host => profile.environment.default_hostname, :controller => 'home') | 66 | + :url => profile.environment.top_url |
| 67 | end | 67 | end |
| 68 | end | 68 | end |
| 69 | 69 |
app/views/comment/notifier/mail.rhtml
| 1 | <%= _('Name: %s') % @name %> | 1 | <%= _('Name: %s') % @name %> |
| 2 | <%= _('e-Mail: %s') % @email %> | 2 | <%= _('e-Mail: %s') % @email %> |
| 3 | -<%= _('Title') % @title %> | 3 | +<%= _('Title: %s') % @title %> |
| 4 | <%= _('Comment:') %> | 4 | <%= _('Comment:') %> |
| 5 | -- | 5 | -- |
| 6 | 6 | ||
| 7 | <%= @body %> | 7 | <%= @body %> |
| 8 | 8 | ||
| 9 | -- | 9 | -- |
| 10 | -<%= @article_url %> | 10 | +<%= url_for @article_url %> |
| 11 | 11 | ||
| 12 | -- | 12 | -- |
| 13 | <%= _('%s environment system') % @environment %> | 13 | <%= _('%s environment system') % @environment %> |
| 14 | -<%= @url %> | 14 | +<%= url_for @url %> |