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 !
paged articles working.  added page navigation liquid block

git-svn-id: http://svn.techno-weenie.net/projects/mephisto@651 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Tue Jan 31 22:25:16 -0800 2006
commit  d1212fecac684af77ae34c3c3e140dcb6870fef2
tree    b778963d192576095d046548da14702b700b7492
parent  605f9fe5a46f73db29dfaecbe6524bb64ba77e1c
...
69
70
71
 
72
73
74
...
69
70
71
72
73
74
75
0
@@ -69,6 +69,7 @@ class MephistoController < ApplicationController
0
 
0
     self.cached_references << @tag << @article
0
     render_liquid_template_for(template_type, 'tag' => @tag.name,
0
+ 'pages' => @tag.articles.collect { |a| a.to_liquid },
0
                                               'article' => @article.to_liquid)
0
   end
0
 
...
1
2
3
 
4
5
6
...
1
2
 
3
4
5
6
0
@@ -1,6 +1,6 @@
0
 class Tag < ActiveRecord::Base
0
   has_many :taggings, :dependent => :delete_all
0
- has_many :articles, :through => :taggings do
0
+ has_many :articles, :order => 'taggings.position', :through => :taggings do
0
     def find_by_date(options = {})
0
       find(:all, { :order => 'articles.published_at desc',
0
                    :conditions => ['published_at <= ? AND articles.type IS NULL AND articles.published_at IS NOT NULL', Time.now.utc] } \
...
61
62
63
64
65
66
 
 
 
 
67
68
69
...
61
62
63
 
 
 
64
65
66
67
68
69
70
0
@@ -61,9 +61,10 @@ end
0
 require 'string_ext'
0
 require 'time_ext'
0
 Liquid::Template.register_filter(Mephisto::Filter)
0
-Liquid::Template.register_block('textile', Mephisto::Textile)
0
-Liquid::Template.register_block('commentform', Mephisto::CommentForm)
0
-Liquid::Template.register_block('head', Mephisto::Head)
0
+Liquid::Template.register_block('textile', Mephisto::Textile)
0
+Liquid::Template.register_block('commentform', Mephisto::CommentForm)
0
+Liquid::Template.register_block('pagenavigation', Mephisto::PageNavigation)
0
+Liquid::Template.register_block('head', Mephisto::Head)
0
 
0
 ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.update \
0
   :standard => '%B %d, %Y @ %I:%M%p'
...
1
2
 
3
4
5
...
1
2
3
4
5
6
0
@@ -1,5 +1,6 @@
0
 module Mephisto
0
   class CommentForm < Liquid::Block
0
+ include Reloadable
0
     include ActionView::Helpers::TagHelper
0
     include ActionView::Helpers::FormTagHelper
0
     
...
1
2
 
3
4
5
...
1
2
3
4
5
6
0
@@ -1,5 +1,6 @@
0
 module Mephisto
0
   module Filter
0
+ include Reloadable
0
     include ActionView::Helpers::TagHelper
0
 
0
     def url_for_article(article)
...
1
2
 
3
4
5
...
1
2
3
4
5
6
0
@@ -1,5 +1,6 @@
0
 module Mephisto
0
   class Head < Liquid::Block
0
+ include Reloadable
0
     include ActionView::Helpers::TagHelper
0
     
0
     def render(context)
...
1
2
 
3
4
5
...
1
2
3
4
5
6
0
@@ -1,5 +1,6 @@
0
 module Mephisto
0
   class Textile < Liquid::Block
0
+ include Reloadable
0
     include Filter
0
     def render(context)
0
       @nodelist.collect do |token|
...
69
70
71
 
 
 
 
 
72
73
74
...
69
70
71
72
73
74
75
76
77
78
79
0
@@ -69,6 +69,11 @@ page:
0
       <h2>{{ article.published_at | format_date: 'standard' }}</h2>
0
       {{ article.body }}
0
     </div>
0
+ <ul>
0
+ {% pagenavigation %}
0
+ <li>{{ page.link }}</li>
0
+ {% endpagenavigation %}
0
+ </ul>
0
 author:
0
   id: 8
0
   name: author

Comments

    No one has commented yet.