Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 15
- Log:
Attempt to update Typo to a Typo SVN HEAD release from around the
time the prototype installation was set up on the RISC OS Open Limited
web site. Timestamps place this at 04-Jul so a revision from 05-Jul or
earlier was pulled and copied over the 2.6.0 tarball stable code.
- Author:
- adh
- Date:
- Sat Jul 22 23:27:35 +0100 2006
- Size:
- 1747 Bytes
1 | require_dependency 'spam_protection' |
2 | |
3 | class Comment < Content |
4 | include TypoGuid |
5 | |
6 | content_fields :body |
7 | |
8 | belongs_to :article, :counter_cache => true |
9 | belongs_to :user |
10 | |
11 | validates_presence_of :author, :body |
12 | validates_against_spamdb :body, :url, :ip |
13 | validates_age_of :article_id |
14 | validate_on_create :check_article_is_open_to_comments |
15 | |
16 | def self.default_order |
17 | 'created_at ASC' |
18 | end |
19 | |
20 | def notify_user_via_email(controller, user) |
21 | if user.notify_via_email? |
22 | EmailNotify.send_comment(controller, self, user) |
23 | end |
24 | end |
25 | |
26 | def notify_user_via_jabber(controller, user) |
27 | if user.notify_via_jabber? |
28 | JabberNotify.send_message(user, "New comment", "A new comment was posted to '#{article.title}' on #{blog.blog_name} by #{author}: #{body}", self.body_html) |
29 | end |
30 | end |
31 | |
32 | def interested_users |
33 | users = User.find_boolean(:all, :notify_on_comments) |
34 | self.notify_users = users |
35 | users |
36 | end |
37 | |
38 | def location(anchor=:ignored, only_path=true) |
39 | blog.url_for(article, "comment-#{id}", only_path) |
40 | end |
41 | |
42 | protected |
43 | |
44 | def check_article_is_open_to_comments |
45 | return unless article |
46 | unless article.allow_comments? |
47 | errors.add(:article, "Article is not open to comments") |
48 | end |
49 | end |
50 | |
51 | |
52 | |
53 | def body_html_postprocess(value, controller) |
54 | controller.send(:sanitize, controller.send(:auto_link, value)) |
55 | end |
56 | |
57 | def default_text_filter_config_key |
58 | 'comment_text_filter' |
59 | end |
60 | |
61 | before_create :create_guid |
62 | before_save :correct_url, :make_nofollow |
63 | |
64 | def correct_url |
65 | unless url.to_s.empty? |
66 | unless url =~ /^http\:\/\// |
67 | self.url = "http://#{url}" |
68 | end |
69 | end |
70 | end |
71 | |
72 | def make_nofollow |
73 | self.author = author.nofollowify |
74 | self.body_html = body_html.to_s.nofollowify |
75 | end |
76 | end |