yodel_blog 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/models/blog.rb +26 -1
  2. data/lib/yodel_blog.rb +1 -1
  3. metadata +2 -2
@@ -2,6 +2,11 @@ class Blog < Page
2
2
  attr_reader :number_of_pages, :page_params, :tag, :total_articles, :month, :year
3
3
 
4
4
  respond_to :get do
5
+ with :html do
6
+ articles
7
+ super()
8
+ end
9
+
5
10
  with :atom do |xml|
6
11
  @xml = xml
7
12
  layout('atom').render(self)
@@ -44,7 +49,7 @@ class Blog < Page
44
49
  end
45
50
 
46
51
  def last_page?
47
- page_number == @number_of_pages - 1
52
+ page_number == (@number_of_pages - 1)
48
53
  end
49
54
 
50
55
  def page_number
@@ -55,6 +60,26 @@ class Blog < Page
55
60
  "#{path}?tag=#{CGI::escape(tag || '')}"
56
61
  end
57
62
 
63
+ def page_path(page_number)
64
+ "#{path}?page=#{page_number}"
65
+ end
66
+
67
+ def previous_page_path
68
+ if first_page?
69
+ path
70
+ else
71
+ "#{path}?page=#{page_number - 1}"
72
+ end
73
+ end
74
+
75
+ def next_page_path
76
+ if last_page?
77
+ path
78
+ else
79
+ "#{path}?page=#{page_number + 1}"
80
+ end
81
+ end
82
+
58
83
  def month_path(month, year)
59
84
  "#{path}?month=#{month}&year=#{year}"
60
85
  end
@@ -1,3 +1,3 @@
1
1
  module YodelBlog
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yodel_blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-12 00:00:00.000000000Z
12
+ date: 2011-12-18 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Yodel CMS Blog Extension
15
15
  email: