Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 193
- Log:
First stage commit of Typo 4.1, modified for the ROOL site.
Includes all local modifications but a final pass needs to be
made to delete any files left over from earlier Typo versions
that shouldn't be here anymore. See the 'tags' section of the
repository for a clean Typo 4.1 tree.Note that symlinks to shared files in the RISC OS Open theme
directory have been deliberately included this time around; I
decided that on balance it was better to leave them in as
placeholders, since unlike symlinks in app/views/shared, the
Typo theme structure is not a standard Rails concept.
- Author:
- rool
- Date:
- Wed Apr 04 18:51:02 +0100 2007
- Size:
- 1473 Bytes
1 | require_dependency 'spam_protection' |
2 | require 'sanitize' |
3 | require 'timeout' |
4 | |
5 | class Comment < Feedback |
6 | belongs_to :article |
7 | belongs_to :user |
8 | content_fields :body |
9 | validates_presence_of :author, :body |
10 | |
11 | attr_accessor :user_agent |
12 | attr_accessor :referrer |
13 | attr_accessor :permalink |
14 | |
15 | def notify_user_via_email(user) |
16 | if user.notify_via_email? |
17 | EmailNotify.send_comment(self, user) |
18 | end |
19 | end |
20 | |
21 | def notify_user_via_jabber(user) |
22 | if user.notify_via_jabber? |
23 | JabberNotify.send_message(user, "New comment", "A new comment was posted to '#{article.title}' on #{blog.blog_name} by #{author}: |
24 | #{body} (#{controller.url_for :anchor => 'comments', :action => 'read', :id => article.id})", self.body_html) |
25 | end |
26 | end |
27 | |
28 | def interested_users |
29 | users = User.find_boolean(:all, :notify_on_comments) |
30 | self.notify_users = users |
31 | users |
32 | end |
33 | |
34 | def default_text_filter |
35 | blog.comment_text_filter.to_text_filter |
36 | end |
37 | |
38 | protected |
39 | |
40 | def article_allows_feedback? |
41 | return true if article.allow_comments? |
42 | errors.add(:article, "Article is not open to comments") |
43 | false |
44 | end |
45 | |
46 | def originator |
47 | author |
48 | end |
49 | |
50 | def additional_akismet_options |
51 | { :user_agent => user_agent, |
52 | :referrer => referrer, |
53 | :permalink => permalink } |
54 | end |
55 | |
56 | def self.html_map(field=nil) |
57 | html_map = { :body => true } |
58 | if field |
59 | html_map[field.to_sym] |
60 | else |
61 | html_map |
62 | end |
63 | end |
64 | |
65 | def content_fields |
66 | [:body] |
67 | end |
68 | end |