public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
add vars for articles and comments

git-svn-id: http://svn.techno-weenie.net/projects/mephisto@602 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Sun Jan 08 21:52:35 -0800 2006
commit  c58ffca30c4dbf4fa6437575785a7e18a2b871f5
tree    c528418b40ee27196f948ef36843a65cc68489b7
parent  cf986c4951f8c4058a5da9434a542b834549d33e
...
59
60
61
62
 
 
63
64
65
...
59
60
61
 
62
63
64
65
66
0
@@ -59,7 +59,8 @@ class Article < ActiveRecord::Base
0
   end
0
 
0
   def to_liquid(mode = :list)
0
- { 'title' => title,
0
+ { 'id' => id,
0
+ 'title' => title,
0
       'permalink' => permalink,
0
       'url' => full_permalink,
0
       'body' => body_for_mode(mode),
...
3
4
5
6
7
8
9
10
11
 
 
 
 
12
13
14
15
 
 
 
 
 
 
16
...
3
4
5
 
 
 
 
 
 
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
0
@@ -3,14 +3,18 @@ class Comment < Article
0
   before_save :cache_redcloth
0
 
0
   def to_liquid
0
- { 'author' => author,
0
- 'author_url' => author_url,
0
- 'author_email' => author_email,
0
- 'author_ip' => author_ip,
0
- 'body' => description_html,
0
- 'created_at' => created_at }
0
+ { 'id' => id,
0
+ 'author' => author_link,
0
+ 'body' => description_html,
0
+ 'created_at' => created_at }
0
   end
0
 
0
   protected
0
   validates_presence_of :description, :author, :author_ip
0
+
0
+ def author_link
0
+ return author if author_url.blank?
0
+ author_url = "http://" + author_url if author_url !~ /^https?:\/\//
0
+ %Q{<a href="#{author_url}">#{author}</a>}
0
+ end
0
 end

Comments

    No one has commented yet.