beef-articles 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/controllers/admin/articles_controller.rb +2 -1
- data/app/controllers/admin/categories_controller.rb +1 -0
- data/app/controllers/admin/comments_controller.rb +1 -0
- data/app/controllers/articles_controller.rb +3 -2
- data/app/controllers/comments_controller.rb +1 -0
- data/app/helpers/articles_helper.rb +7 -6
- data/articles.gemspec +2 -2
- metadata +4 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.4
|
@@ -1,10 +1,11 @@
|
|
1
1
|
class Admin::ArticlesController < Admin::BaseController
|
2
|
+
unloadable
|
2
3
|
sortable_attributes :title, :permalink, :published_at, :published_to, :body, :description, :allow_comments
|
3
4
|
|
4
5
|
# GET /articles
|
5
6
|
# GET /articles.xml
|
6
7
|
def index
|
7
|
-
@articles = Article.paginate :page => params[:page], :order => sort_order
|
8
|
+
@articles = Article.paginate :page => params[:page], :order => sort_order(:default => 'publised_at DESC')
|
8
9
|
|
9
10
|
respond_to do |format|
|
10
11
|
format.html # index.html.erb
|
@@ -1,5 +1,6 @@
|
|
1
1
|
class ArticlesController < ApplicationController
|
2
|
-
|
2
|
+
unloadable
|
3
|
+
|
3
4
|
def index
|
4
5
|
@page_title = 'Articles'
|
5
6
|
if params[:category_id]
|
@@ -19,7 +20,7 @@ class ArticlesController < ApplicationController
|
|
19
20
|
|
20
21
|
@articles = Article.in_time_delta( params[:year], params[:month], params[:day] ).published.tagged_with(params[:tag], :on => :tags).authored_by(@user).categorised(@category).paginate( :page => params[:page], :per_page => params[:per_page] || 6, :order => 'published_at DESC', :include => [:created_by] )
|
21
22
|
|
22
|
-
@tags = Article.published.authored_by(
|
23
|
+
@tags = Article.published.authored_by(@user).categorised(@category).tag_counts
|
23
24
|
|
24
25
|
respond_to do |format|
|
25
26
|
format.html # index.html.erb
|
@@ -62,11 +62,10 @@ module ArticlesHelper
|
|
62
62
|
escape ? escape_once(url) : url
|
63
63
|
end
|
64
64
|
|
65
|
-
def archive(
|
65
|
+
def archive(conditions = nil, html_options = {})
|
66
66
|
this_year = params[:year] || Time.now.year
|
67
67
|
html = ''
|
68
|
-
|
69
|
-
all_articles = Article.find(:all, :select => 'published_at', :order => "published_at DESC", :conditions => ['published_at <= ?', Time.now ])
|
68
|
+
all_articles = Article.published.all(:conditions => conditions, :select => 'published_at')
|
70
69
|
grouped_by_year = all_articles.group_by{ |a| a.published_at.year }.sort.reverse
|
71
70
|
grouped_by_year.each do |year, articles|
|
72
71
|
html << '<li>'
|
@@ -85,7 +84,7 @@ module ArticlesHelper
|
|
85
84
|
end
|
86
85
|
html << '</li>'
|
87
86
|
end
|
88
|
-
content_tag :ul, html,
|
87
|
+
content_tag :ul, html, html_options.reverse_merge!( :class => 'archive' ) unless html.empty?
|
89
88
|
end
|
90
89
|
|
91
90
|
def related_articles(content_node, &block)
|
@@ -97,8 +96,10 @@ module ArticlesHelper
|
|
97
96
|
end
|
98
97
|
end
|
99
98
|
|
100
|
-
def recent_articles(
|
101
|
-
|
99
|
+
def recent_articles(options = {}, &block)
|
100
|
+
options.merge!(:order => 'published_at DESC')
|
101
|
+
options.reverse_merge!(:limit => 3)
|
102
|
+
articles = Article.published.all(options)
|
102
103
|
if block_given?
|
103
104
|
yield(articles)
|
104
105
|
else
|
data/articles.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{articles}
|
5
|
-
s.version = "0.3.
|
5
|
+
s.version = "0.3.4"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Steve England"]
|
9
|
-
s.date = %q{2009-07-
|
9
|
+
s.date = %q{2009-07-29}
|
10
10
|
s.email = %q{steve@wearebeef.co.uk}
|
11
11
|
s.extra_rdoc_files = [
|
12
12
|
"LICENSE",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beef-articles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve England
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-29 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -81,6 +81,7 @@ files:
|
|
81
81
|
- test/test_helper.rb
|
82
82
|
has_rdoc: false
|
83
83
|
homepage: http://github.com/beef/articles
|
84
|
+
licenses:
|
84
85
|
post_install_message:
|
85
86
|
rdoc_options:
|
86
87
|
- --charset=UTF-8
|
@@ -101,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
102
|
requirements: []
|
102
103
|
|
103
104
|
rubyforge_project:
|
104
|
-
rubygems_version: 1.
|
105
|
+
rubygems_version: 1.3.5
|
105
106
|
signing_key:
|
106
107
|
specification_version: 3
|
107
108
|
summary: Article/Blogging engine
|