refinerycms-blog 2.0.5 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -1
- data/.travis.yml +3 -9
- data/Gemfile +10 -11
- data/app/assets/images/refinery/blog/icons/add.png +0 -0
- data/app/assets/stylesheets/refinery/blog/backend.css.scss +25 -25
- data/app/assets/stylesheets/refinery/blog/frontend.css.scss +87 -76
- data/app/controllers/refinery/blog/admin/comments_controller.rb +19 -19
- data/app/controllers/refinery/blog/admin/posts_controller.rb +9 -4
- data/app/controllers/refinery/blog/categories_controller.rb +1 -1
- data/app/controllers/refinery/blog/posts_controller.rb +12 -11
- data/app/helpers/refinery/blog/controller_helper.rb +7 -7
- data/app/helpers/refinery/blog/posts_helper.rb +5 -0
- data/app/models/refinery/blog/categorization.rb +12 -0
- data/app/models/refinery/blog/category.rb +14 -4
- data/app/models/refinery/blog/comment.rb +0 -9
- data/app/models/refinery/blog/post.rb +55 -13
- data/app/views/refinery/blog/admin/_submenu.html.erb +1 -4
- data/app/views/refinery/blog/admin/categories/_category.html.erb +11 -3
- data/app/views/refinery/blog/admin/categories/_form.html.erb +10 -11
- data/app/views/refinery/blog/admin/categories/_sortable_list.html.erb +2 -4
- data/app/views/refinery/blog/admin/categories/edit.html.erb +1 -1
- data/app/views/refinery/blog/admin/categories/index.html.erb +9 -15
- data/app/views/refinery/blog/admin/categories/new.html.erb +1 -1
- data/app/views/refinery/blog/admin/comments/_comment.html.erb +4 -2
- data/app/views/refinery/blog/admin/comments/_sortable_list.html.erb +2 -4
- data/app/views/refinery/blog/admin/comments/index.html.erb +14 -23
- data/app/views/refinery/blog/admin/comments/show.html.erb +6 -4
- data/app/views/refinery/blog/admin/posts/_form.html.erb +18 -26
- data/app/views/refinery/blog/admin/posts/_post.html.erb +14 -1
- data/app/views/refinery/blog/admin/posts/_sortable_list.html.erb +2 -4
- data/app/views/refinery/blog/admin/posts/edit.html.erb +1 -1
- data/app/views/refinery/blog/admin/posts/index.html.erb +9 -15
- data/app/views/refinery/blog/admin/posts/new.html.erb +1 -1
- data/app/views/refinery/blog/admin/posts/uncategorized.html.erb +2 -2
- data/app/views/refinery/blog/admin/settings/notification_recipients.html.erb +5 -7
- data/app/views/refinery/blog/categories/show.html.erb +2 -2
- data/app/views/refinery/blog/comment_mailer/notification.html.erb +5 -0
- data/app/views/refinery/blog/posts/_comment.html.erb +1 -1
- data/app/views/refinery/blog/posts/_comments.html.erb +28 -31
- data/app/views/refinery/blog/posts/_post.html.erb +3 -3
- data/app/views/refinery/blog/posts/archive.html.erb +6 -5
- data/app/views/refinery/blog/posts/index.html.erb +3 -3
- data/app/views/refinery/blog/posts/show.html.erb +4 -6
- data/app/views/refinery/blog/posts/tagged.html.erb +4 -4
- data/app/views/refinery/blog/shared/_body_content_right.html.erb +6 -6
- data/app/views/refinery/blog/shared/_post.html.erb +11 -13
- data/app/views/refinery/blog/shared/_rss_feed.html.erb +2 -0
- data/config/initializers/url_validator.rb +15 -11
- data/config/locales/bg.yml +2 -4
- data/config/locales/cs.yml +6 -8
- data/config/locales/de.yml +27 -8
- data/config/locales/en.yml +9 -6
- data/config/locales/es.yml +2 -4
- data/config/locales/fr.yml +23 -7
- data/config/locales/it.yml +2 -4
- data/config/locales/ja.yml +16 -5
- data/config/locales/nb.yml +0 -2
- data/config/locales/nl.yml +21 -7
- data/config/locales/pl.yml +3 -5
- data/config/locales/pt-BR.yml +38 -7
- data/config/locales/ru.yml +35 -2
- data/config/locales/sk.yml +4 -6
- data/config/locales/sv.yml +2 -4
- data/config/locales/zh-CN.yml +2 -4
- data/config/routes.rb +3 -3
- data/db/migrate/20110803223522_create_blog_structure.rb +15 -14
- data/db/migrate/20110803223523_add_user_id_to_blog_posts.rb +2 -2
- data/db/migrate/20110803223526_add_cached_slugs.rb +2 -2
- data/db/migrate/20110803223527_add_custom_url_field_to_blog_posts.rb +1 -1
- data/db/migrate/20110803223528_add_custom_teaser_field_to_blog_posts.rb +1 -1
- data/db/migrate/20110803223529_add_primary_key_to_categorizations.rb +4 -4
- data/db/migrate/20120530102901_create_blog_translations.rb +17 -0
- data/db/migrate/20120531113632_delete_cached_slugs.rb +6 -0
- data/db/migrate/20120601151114_create_category_translations.rb +14 -0
- data/db/seeds.rb +2 -2
- data/lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb +3 -0
- data/lib/refinery/blog.rb +1 -0
- data/lib/refinery/blog/configuration.rb +23 -0
- data/readme.md +3 -3
- data/refinerycms-blog.gemspec +8 -14
- data/spec/controllers/refinery/blog/admin/comments_controller_spec.rb +84 -0
- data/spec/controllers/refinery/blog/posts_controller_spec.rb +0 -2
- data/spec/factories/blog_posts.rb +2 -2
- data/spec/features/refinery/blog/admin/categories_spec.rb +119 -0
- data/spec/{requests → features}/refinery/blog/admin/comments_spec.rb +9 -9
- data/spec/{requests → features}/refinery/blog/admin/menu_spec.rb +2 -2
- data/spec/features/refinery/blog/admin/posts_spec.rb +338 -0
- data/spec/features/refinery/blog/categories_spec.rb +28 -0
- data/spec/{requests → features}/refinery/blog/posts_spec.rb +62 -42
- data/spec/helpers/refinery/blog/controller_helper_spec.rb +27 -0
- data/spec/helpers/refinery/blog/posts_helper_spec.rb +12 -0
- data/spec/models/refinery/blog/category_spec.rb +10 -2
- data/spec/models/refinery/blog/post_spec.rb +21 -17
- data/spec/spec_helper.rb +20 -46
- metadata +41 -38
- data/Guardfile +0 -20
- data/app/assets/images/refinerycms-blog/.gitkeep +0 -0
- data/app/assets/javascripts/refinerycms-blog/.gitkeep +0 -0
- data/app/assets/stylesheets/refinerycms-blog/.gitkeep +0 -0
- data/app/models/refinery/categorization.rb +0 -10
- data/app/views/refinery/blog/admin/comments/approve.html.erb +0 -0
- data/lib/refinery/blog/version.rb +0 -17
- data/spec/requests/refinery/blog/admin/categories_spec.rb +0 -20
- data/spec/requests/refinery/blog/admin/posts_spec.rb +0 -175
- data/spec/requests/refinery/blog/categories_spec.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 474d4fdc2f9ad359bd9255e60b9ca70b80a5ec62
|
4
|
+
data.tar.gz: acb4c9dbd5960f3f873ade37e2257c551f999c37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5f19a55c12dd44d8eee1e97b5ebb96bc16dbd3d56f23d5499e794df091afea8cd1800249db1ea221fa80d8b472b17c58ff2f39cb26ef0043e48a6790e4b7df1
|
7
|
+
data.tar.gz: aad373a5e0c9052fc338f379ef74a49ab31ebe9b32357f38e4bff98ef4dab01c905ddf95f55b851b6a14dbbfe31fe53a2adeb23fda386573bc3b34c9f9459242
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
language: ruby
|
2
|
-
|
3
|
-
- 'if [[ "$TRAVIS_RUBY_VERSION" =~ "jruby" ]] ; then gem update --system ; fi'
|
2
|
+
bundler_args: --without development
|
4
3
|
before_script:
|
5
4
|
- "sh -e /etc/init.d/xvfb start"
|
6
|
-
- "bundle exec rake refinery:testing:dummy_app
|
5
|
+
- "bundle exec rake refinery:testing:dummy_app"
|
7
6
|
script:
|
8
7
|
- "DISPLAY=:99.0 bundle exec rspec spec"
|
9
8
|
notifications:
|
@@ -23,14 +22,9 @@ env:
|
|
23
22
|
- DB=mysql
|
24
23
|
matrix:
|
25
24
|
allow_failures:
|
26
|
-
- rvm: rbx-18mode
|
27
25
|
- rvm: rbx-19mode
|
28
|
-
- rvm: jruby-19mode
|
29
|
-
- rvm: jruby-18mode
|
30
26
|
rvm:
|
27
|
+
- 2.0.0
|
31
28
|
- 1.9.3
|
32
|
-
- 1.8.7
|
33
29
|
- rbx-19mode
|
34
30
|
- jruby-19mode
|
35
|
-
- rbx-18mode
|
36
|
-
- jruby-18mode
|
data/Gemfile
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
source "
|
1
|
+
source "https://rubygems.org"
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem 'refinerycms', '~> 2.0
|
5
|
+
gem 'refinerycms', '~> 2.1.0'
|
6
|
+
gem 'refinerycms-testing', :github => 'refinery/refinerycms', :branch => '2-1-stable', :group => :test
|
7
|
+
gem 'refinerycms-settings', '~> 2.1.0'
|
8
|
+
gem 'refinerycms-acts-as-indexed', :github => 'refinery/refinerycms-acts-as-indexed', :branch => '1-0-stable'
|
6
9
|
|
7
|
-
gem 'quiet_assets', :group => :development
|
8
10
|
|
9
11
|
# Database Configuration
|
10
12
|
unless ENV['TRAVIS']
|
@@ -25,17 +27,14 @@ end
|
|
25
27
|
|
26
28
|
gem 'jruby-openssl', :platform => :jruby
|
27
29
|
|
28
|
-
|
29
|
-
gem 'refinerycms-testing', '~> 2.0.3'
|
30
|
-
gem 'generator_spec', '~> 0.8.7'
|
31
|
-
end
|
32
|
-
|
33
|
-
# Gems used only for assets and not required
|
34
|
-
# in production environments by default.
|
30
|
+
# Refinery/rails should pull in the proper versions of these
|
35
31
|
group :assets do
|
36
32
|
gem 'sass-rails'
|
37
33
|
gem 'coffee-rails'
|
38
34
|
gem 'uglifier'
|
39
35
|
end
|
40
36
|
|
41
|
-
|
37
|
+
# Load local gems according to Refinery developer preference.
|
38
|
+
if File.exist? local_gemfile = File.expand_path('../.gemfile', __FILE__)
|
39
|
+
eval File.read(local_gemfile)
|
40
|
+
end
|
Binary file
|
@@ -33,35 +33,35 @@
|
|
33
33
|
}
|
34
34
|
ul.collapsible_menu li {
|
35
35
|
position: relative;
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
}
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
}
|
56
|
-
ul.blog_categories{
|
36
|
+
span.arrow {
|
37
|
+
background-repeat: no-repeat;
|
38
|
+
position: absolute;
|
39
|
+
right: 10px;
|
40
|
+
top: 13px;
|
41
|
+
width: 11px;
|
42
|
+
height: 7px;
|
43
|
+
cursor: pointer;
|
44
|
+
background-image: image_url('refinery/blog/icons/up.gif');
|
45
|
+
}
|
46
|
+
&.closed {
|
47
|
+
span.arrow {
|
48
|
+
background-image: image_url('refinery/blog/icons/down.gif');
|
49
|
+
}
|
50
|
+
}
|
51
|
+
> div {
|
52
|
+
width: 93%;
|
53
|
+
margin: 0px auto;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
ul.blog_categories {
|
57
57
|
height:200px;
|
58
58
|
overflow:auto;
|
59
59
|
border:1px solid #ccc;
|
60
60
|
padding:5px;
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
61
|
+
&, li {
|
62
|
+
list-style: none;
|
63
|
+
margin:5px 0;
|
64
|
+
}
|
65
65
|
}
|
66
66
|
a#copy_body_link {
|
67
67
|
background: image_url('refinery/icons/add.png') no-repeat scroll 0 6px transparent;
|
@@ -1,20 +1,22 @@
|
|
1
|
-
.blog_post
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
}
|
6
|
-
.post_categories
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
1
|
+
.blog_post {
|
2
|
+
header, footer {
|
3
|
+
width: auto;
|
4
|
+
}
|
5
|
+
}
|
6
|
+
.post_categories {
|
7
|
+
.filled_in {
|
8
|
+
display: inline;
|
9
|
+
}
|
10
|
+
ul {
|
11
|
+
margin: 0px 0px 0px 6px;
|
12
|
+
padding: 0px;
|
13
|
+
display: inline;
|
14
|
+
li {
|
15
|
+
margin: 0px;
|
16
|
+
padding: 0px;
|
17
|
+
display: inline;
|
18
|
+
}
|
19
|
+
}
|
18
20
|
}
|
19
21
|
.field.message_field label {
|
20
22
|
vertical-align: top;
|
@@ -25,69 +27,78 @@
|
|
25
27
|
background: image_url('refinery/blog/rss-feed.png') no-repeat;
|
26
28
|
}
|
27
29
|
#next_prev_article{
|
28
|
-
overflow:hidden;
|
29
|
-
margin:10px 0;
|
30
|
-
position:relative;
|
31
|
-
height:30px;
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
30
|
+
overflow: hidden;
|
31
|
+
margin: 10px 0;
|
32
|
+
position: relative;
|
33
|
+
height: 30px;
|
34
|
+
a {
|
35
|
+
display: block;
|
36
|
+
width: 33%;
|
37
|
+
height: 30px;
|
38
|
+
line-height: 30px;
|
39
|
+
position: absolute;
|
40
|
+
top:0;
|
41
|
+
&.prev {
|
42
|
+
left:0;
|
43
|
+
}
|
44
|
+
&.home {
|
45
|
+
left: 33%;
|
46
|
+
text-align: center;
|
47
|
+
}
|
48
|
+
&.next {
|
49
|
+
text-align: right;
|
50
|
+
right:0;
|
51
|
+
}
|
52
|
+
}
|
51
53
|
}
|
52
|
-
|
53
54
|
#message, .flash {
|
54
55
|
padding: 8px 8px 8px 30px;
|
55
56
|
margin-bottom: 15px;
|
56
57
|
position: relative;
|
57
58
|
}
|
58
|
-
.
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
}
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
}
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
}
|
87
|
-
|
88
|
-
|
89
|
-
|
59
|
+
.flash {
|
60
|
+
&.flash_notice {
|
61
|
+
&, * {
|
62
|
+
color: #00A017;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
&.flash_notice, &.flash_message {
|
66
|
+
border: 1px solid #00A017;
|
67
|
+
color: #00A017;
|
68
|
+
background: 7px 7px no-repeat image_url('refinery/blog/icons/accept.png') #E0F5E0;
|
69
|
+
}
|
70
|
+
&.flash_notice #flash_close, &.flash_error #flash_close {
|
71
|
+
text-transform: lowercase;
|
72
|
+
}
|
73
|
+
&.flash_message {
|
74
|
+
background: #E0F5E0;
|
75
|
+
padding: 9px;
|
76
|
+
position: relative;
|
77
|
+
margin-bottom: 32px;
|
78
|
+
h2 {
|
79
|
+
margin-top: 12px;
|
80
|
+
}
|
81
|
+
}
|
82
|
+
a {
|
83
|
+
&, &:hover {
|
84
|
+
color: #e20003;
|
85
|
+
border-bottom-color: #e20003;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
&.flash_error {
|
89
|
+
border: 1px solid #A00027;
|
90
|
+
color: #A00027;
|
91
|
+
background: 7px 7px no-repeat image_url('refinery/blog/icons/cancel.png') #FFB1B1;
|
92
|
+
a {
|
93
|
+
&, &:hover {
|
94
|
+
display: none;
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}
|
98
|
+
&.flash_message {
|
99
|
+
&, & * {
|
100
|
+
color: #262719;
|
101
|
+
font-size: 14px;
|
102
|
+
}
|
103
|
+
}
|
90
104
|
}
|
91
|
-
.flash.flash_error a, .flash.flash_error a:hover {
|
92
|
-
display: none;
|
93
|
-
} /* FLASH MESSAGES */
|
@@ -10,35 +10,35 @@ module Refinery
|
|
10
10
|
def index
|
11
11
|
@comments = Refinery::Blog::Comment.unmoderated.page(params[:page])
|
12
12
|
|
13
|
-
render :
|
13
|
+
render :index
|
14
14
|
end
|
15
15
|
|
16
16
|
def approved
|
17
|
-
|
18
|
-
@comments = Refinery::Blog::Comment.approved.page(params[:page])
|
17
|
+
@comments = Refinery::Blog::Comment.approved.page(params[:page])
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
render :index
|
20
|
+
end
|
21
|
+
|
22
|
+
def approve
|
23
|
+
@comment = Refinery::Blog::Comment.find(params[:id])
|
24
|
+
@comment.approve!
|
25
|
+
flash[:notice] = t('approved', :scope => 'refinery.blog.admin.comments', :author => @comment.name)
|
25
26
|
|
26
|
-
|
27
|
-
end
|
27
|
+
redirect_to refinery.blog_admin_comments_path
|
28
28
|
end
|
29
29
|
|
30
30
|
def rejected
|
31
|
-
|
32
|
-
|
31
|
+
@comments = Refinery::Blog::Comment.rejected.page(params[:page])
|
32
|
+
|
33
|
+
render :index
|
34
|
+
end
|
33
35
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
flash[:notice] = t('rejected', :scope => 'refinery.blog.admin.comments', :author => @comment.name)
|
36
|
+
def reject
|
37
|
+
@comment = Refinery::Blog::Comment.find(params[:id])
|
38
|
+
@comment.reject!
|
39
|
+
flash[:notice] = t('rejected', :scope => 'refinery.blog.admin.comments', :author => @comment.name)
|
39
40
|
|
40
|
-
|
41
|
-
end
|
41
|
+
redirect_to refinery.blog_admin_comments_path
|
42
42
|
end
|
43
43
|
|
44
44
|
end
|
@@ -4,7 +4,8 @@ module Refinery
|
|
4
4
|
class PostsController < ::Refinery::AdminController
|
5
5
|
|
6
6
|
crudify :'refinery/blog/post',
|
7
|
-
:order => 'published_at DESC'
|
7
|
+
:order => 'published_at DESC',
|
8
|
+
:include => [:translations, :author]
|
8
9
|
|
9
10
|
before_filter :find_all_categories,
|
10
11
|
:only => [:new, :edit, :create, :update]
|
@@ -55,7 +56,7 @@ module Refinery
|
|
55
56
|
unless request.xhr?
|
56
57
|
redirect_to :back
|
57
58
|
else
|
58
|
-
render
|
59
|
+
render "/shared/message"
|
59
60
|
end
|
60
61
|
end
|
61
62
|
else
|
@@ -63,7 +64,7 @@ module Refinery
|
|
63
64
|
end
|
64
65
|
else
|
65
66
|
unless request.xhr?
|
66
|
-
render :
|
67
|
+
render :new
|
67
68
|
else
|
68
69
|
render :partial => "/refinery/admin/error_messages",
|
69
70
|
:locals => {
|
@@ -75,8 +76,12 @@ module Refinery
|
|
75
76
|
end
|
76
77
|
|
77
78
|
protected
|
79
|
+
def find_post
|
80
|
+
@post = Refinery::Blog::Post.find_by_slug_or_id(params[:id])
|
81
|
+
end
|
82
|
+
|
78
83
|
def find_all_categories
|
79
|
-
@categories = Refinery::Blog::Category.
|
84
|
+
@categories = Refinery::Blog::Category.all
|
80
85
|
end
|
81
86
|
|
82
87
|
def check_category_ids
|
@@ -4,7 +4,7 @@ module Refinery
|
|
4
4
|
|
5
5
|
def show
|
6
6
|
@category = Refinery::Blog::Category.find(params[:id])
|
7
|
-
@posts = @category.posts.live.includes(:comments, :categories).page(params[:page])
|
7
|
+
@posts = @category.posts.live.includes(:comments, :categories).with_globalize.page(params[:page])
|
8
8
|
end
|
9
9
|
|
10
10
|
end
|
@@ -16,14 +16,14 @@ module Refinery
|
|
16
16
|
end
|
17
17
|
respond_with (@posts) do |format|
|
18
18
|
format.html
|
19
|
-
format.rss
|
19
|
+
format.rss { render :layout => false }
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
def show
|
24
24
|
@comment = Comment.new
|
25
25
|
|
26
|
-
@canonical = url_for(:locale =>
|
26
|
+
@canonical = refinery.url_for(:locale => Refinery::I18n.current_frontend_locale) if canonical?
|
27
27
|
|
28
28
|
@post.increment!(:access_count, 1)
|
29
29
|
|
@@ -52,21 +52,21 @@ module Refinery
|
|
52
52
|
:anchor => "comment-#{@comment.to_param}")
|
53
53
|
end
|
54
54
|
else
|
55
|
-
render :
|
55
|
+
render :show
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
59
|
def archive
|
60
60
|
if params[:month].present?
|
61
61
|
date = "#{params[:month]}/#{params[:year]}"
|
62
|
-
|
63
|
-
@date_title =
|
64
|
-
@posts = Post.live.
|
62
|
+
archive_date = Time.parse(date)
|
63
|
+
@date_title = ::I18n.l(archive_date, :format => '%B %Y')
|
64
|
+
@posts = Post.live.by_month(archive_date).page(params[:page])
|
65
65
|
else
|
66
66
|
date = "01/#{params[:year]}"
|
67
|
-
|
68
|
-
@date_title =
|
69
|
-
@posts = Post.live.by_year(
|
67
|
+
archive_date = Time.parse(date)
|
68
|
+
@date_title = ::I18n.l(archive_date, :format => '%Y')
|
69
|
+
@posts = Post.live.by_year(archive_date).page(params[:page])
|
70
70
|
end
|
71
71
|
respond_with (@posts)
|
72
72
|
end
|
@@ -74,11 +74,12 @@ module Refinery
|
|
74
74
|
def tagged
|
75
75
|
@tag = ActsAsTaggableOn::Tag.find(params[:tag_id])
|
76
76
|
@tag_name = @tag.name
|
77
|
-
@posts = Post.tagged_with(@tag_name).page(params[:page])
|
77
|
+
@posts = Post.live.tagged_with(@tag_name).page(params[:page])
|
78
78
|
end
|
79
79
|
|
80
|
+
protected
|
80
81
|
def canonical?
|
81
|
-
|
82
|
+
Refinery::I18n.default_frontend_locale != Refinery::I18n.current_frontend_locale
|
82
83
|
end
|
83
84
|
end
|
84
85
|
end
|