From 9d33b5cb873b62fc33ac77365cca3aa645f591dd Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Fri, 12 Dec 2008 18:59:55 -0300 Subject: [PATCH] ActionItem870: some fixes to comments-by-email --- app/helpers/article_helper.rb | 24 +++++++++++++++++------- app/models/comment.rb | 4 ++-- app/views/comment/notifier/mail.rhtml | 6 +++--- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/app/helpers/article_helper.rb b/app/helpers/article_helper.rb index da2da4a..9dc2823 100644 --- a/app/helpers/article_helper.rb +++ b/app/helpers/article_helper.rb @@ -4,13 +4,23 @@ module ArticleHelper @article = article content_tag('h4', _('Options')) + content_tag('div', - check_box(:article, :published) + - content_tag('label', _('Published'), :for => 'article_published') + - check_box(:article, :accept_comments) + - content_tag('label', _('Accept Comments'), :for => 'article_accept_comments') + - check_box(:article, :notify_comments) + - content_tag('label', _('Notify Comments'), :for => 'article_notify_comments') - ) + observe_field(:article_accept_comments, :function => "$('article_notify_comments').disabled = ! $('article_accept_comments').checked") + content_tag( + 'div', + check_box(:article, :published) + + content_tag('label', _('This article must be published (visible to other people)'), :for => 'article_published') + ) + + content_tag( + 'div', + check_box(:article, :accept_comments) + + content_tag('label', _('I want to receive comments about this article'), :for => 'article_accept_comments') + ) + + content_tag( + 'div', + check_box(:article, :notify_comments) + + content_tag('label', _('I want to receive a notification of each comment written by e-mail'), :for => 'article_notify_comments') + + observe_field(:article_accept_comments, :function => "$('article_notify_comments').disabled = ! $('article_accept_comments').checked") + ) + ) end def cms_label_for_new_children diff --git a/app/models/comment.rb b/app/models/comment.rb index 23e6349..339cb31 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -61,9 +61,9 @@ class Comment < ActiveRecord::Base :email => (comment.author.nil? ? comment.email : comment.author.email), :title => comment.title, :body => comment.body, - :article_url => comment.article.url, + :article_url => comment.url, :environment => profile.environment.name, - :url => url_for(:host => profile.environment.default_hostname, :controller => 'home') + :url => profile.environment.top_url end end diff --git a/app/views/comment/notifier/mail.rhtml b/app/views/comment/notifier/mail.rhtml index cef4b55..a71de11 100644 --- a/app/views/comment/notifier/mail.rhtml +++ b/app/views/comment/notifier/mail.rhtml @@ -1,14 +1,14 @@ <%= _('Name: %s') % @name %> <%= _('e-Mail: %s') % @email %> -<%= _('Title') % @title %> +<%= _('Title: %s') % @title %> <%= _('Comment:') %> -- <%= @body %> -- -<%= @article_url %> +<%= url_for @article_url %> -- <%= _('%s environment system') % @environment %> -<%= @url %> +<%= url_for @url %> -- libgit2 0.21.2