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.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -1
  3. data/.travis.yml +3 -9
  4. data/Gemfile +10 -11
  5. data/app/assets/images/refinery/blog/icons/add.png +0 -0
  6. data/app/assets/stylesheets/refinery/blog/backend.css.scss +25 -25
  7. data/app/assets/stylesheets/refinery/blog/frontend.css.scss +87 -76
  8. data/app/controllers/refinery/blog/admin/comments_controller.rb +19 -19
  9. data/app/controllers/refinery/blog/admin/posts_controller.rb +9 -4
  10. data/app/controllers/refinery/blog/categories_controller.rb +1 -1
  11. data/app/controllers/refinery/blog/posts_controller.rb +12 -11
  12. data/app/helpers/refinery/blog/controller_helper.rb +7 -7
  13. data/app/helpers/refinery/blog/posts_helper.rb +5 -0
  14. data/app/models/refinery/blog/categorization.rb +12 -0
  15. data/app/models/refinery/blog/category.rb +14 -4
  16. data/app/models/refinery/blog/comment.rb +0 -9
  17. data/app/models/refinery/blog/post.rb +55 -13
  18. data/app/views/refinery/blog/admin/_submenu.html.erb +1 -4
  19. data/app/views/refinery/blog/admin/categories/_category.html.erb +11 -3
  20. data/app/views/refinery/blog/admin/categories/_form.html.erb +10 -11
  21. data/app/views/refinery/blog/admin/categories/_sortable_list.html.erb +2 -4
  22. data/app/views/refinery/blog/admin/categories/edit.html.erb +1 -1
  23. data/app/views/refinery/blog/admin/categories/index.html.erb +9 -15
  24. data/app/views/refinery/blog/admin/categories/new.html.erb +1 -1
  25. data/app/views/refinery/blog/admin/comments/_comment.html.erb +4 -2
  26. data/app/views/refinery/blog/admin/comments/_sortable_list.html.erb +2 -4
  27. data/app/views/refinery/blog/admin/comments/index.html.erb +14 -23
  28. data/app/views/refinery/blog/admin/comments/show.html.erb +6 -4
  29. data/app/views/refinery/blog/admin/posts/_form.html.erb +18 -26
  30. data/app/views/refinery/blog/admin/posts/_post.html.erb +14 -1
  31. data/app/views/refinery/blog/admin/posts/_sortable_list.html.erb +2 -4
  32. data/app/views/refinery/blog/admin/posts/edit.html.erb +1 -1
  33. data/app/views/refinery/blog/admin/posts/index.html.erb +9 -15
  34. data/app/views/refinery/blog/admin/posts/new.html.erb +1 -1
  35. data/app/views/refinery/blog/admin/posts/uncategorized.html.erb +2 -2
  36. data/app/views/refinery/blog/admin/settings/notification_recipients.html.erb +5 -7
  37. data/app/views/refinery/blog/categories/show.html.erb +2 -2
  38. data/app/views/refinery/blog/comment_mailer/notification.html.erb +5 -0
  39. data/app/views/refinery/blog/posts/_comment.html.erb +1 -1
  40. data/app/views/refinery/blog/posts/_comments.html.erb +28 -31
  41. data/app/views/refinery/blog/posts/_post.html.erb +3 -3
  42. data/app/views/refinery/blog/posts/archive.html.erb +6 -5
  43. data/app/views/refinery/blog/posts/index.html.erb +3 -3
  44. data/app/views/refinery/blog/posts/show.html.erb +4 -6
  45. data/app/views/refinery/blog/posts/tagged.html.erb +4 -4
  46. data/app/views/refinery/blog/shared/_body_content_right.html.erb +6 -6
  47. data/app/views/refinery/blog/shared/_post.html.erb +11 -13
  48. data/app/views/refinery/blog/shared/_rss_feed.html.erb +2 -0
  49. data/config/initializers/url_validator.rb +15 -11
  50. data/config/locales/bg.yml +2 -4
  51. data/config/locales/cs.yml +6 -8
  52. data/config/locales/de.yml +27 -8
  53. data/config/locales/en.yml +9 -6
  54. data/config/locales/es.yml +2 -4
  55. data/config/locales/fr.yml +23 -7
  56. data/config/locales/it.yml +2 -4
  57. data/config/locales/ja.yml +16 -5
  58. data/config/locales/nb.yml +0 -2
  59. data/config/locales/nl.yml +21 -7
  60. data/config/locales/pl.yml +3 -5
  61. data/config/locales/pt-BR.yml +38 -7
  62. data/config/locales/ru.yml +35 -2
  63. data/config/locales/sk.yml +4 -6
  64. data/config/locales/sv.yml +2 -4
  65. data/config/locales/zh-CN.yml +2 -4
  66. data/config/routes.rb +3 -3
  67. data/db/migrate/20110803223522_create_blog_structure.rb +15 -14
  68. data/db/migrate/20110803223523_add_user_id_to_blog_posts.rb +2 -2
  69. data/db/migrate/20110803223526_add_cached_slugs.rb +2 -2
  70. data/db/migrate/20110803223527_add_custom_url_field_to_blog_posts.rb +1 -1
  71. data/db/migrate/20110803223528_add_custom_teaser_field_to_blog_posts.rb +1 -1
  72. data/db/migrate/20110803223529_add_primary_key_to_categorizations.rb +4 -4
  73. data/db/migrate/20120530102901_create_blog_translations.rb +17 -0
  74. data/db/migrate/20120531113632_delete_cached_slugs.rb +6 -0
  75. data/db/migrate/20120601151114_create_category_translations.rb +14 -0
  76. data/db/seeds.rb +2 -2
  77. data/lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb +3 -0
  78. data/lib/refinery/blog.rb +1 -0
  79. data/lib/refinery/blog/configuration.rb +23 -0
  80. data/readme.md +3 -3
  81. data/refinerycms-blog.gemspec +8 -14
  82. data/spec/controllers/refinery/blog/admin/comments_controller_spec.rb +84 -0
  83. data/spec/controllers/refinery/blog/posts_controller_spec.rb +0 -2
  84. data/spec/factories/blog_posts.rb +2 -2
  85. data/spec/features/refinery/blog/admin/categories_spec.rb +119 -0
  86. data/spec/{requests → features}/refinery/blog/admin/comments_spec.rb +9 -9
  87. data/spec/{requests → features}/refinery/blog/admin/menu_spec.rb +2 -2
  88. data/spec/features/refinery/blog/admin/posts_spec.rb +338 -0
  89. data/spec/features/refinery/blog/categories_spec.rb +28 -0
  90. data/spec/{requests → features}/refinery/blog/posts_spec.rb +62 -42
  91. data/spec/helpers/refinery/blog/controller_helper_spec.rb +27 -0
  92. data/spec/helpers/refinery/blog/posts_helper_spec.rb +12 -0
  93. data/spec/models/refinery/blog/category_spec.rb +10 -2
  94. data/spec/models/refinery/blog/post_spec.rb +21 -17
  95. data/spec/spec_helper.rb +20 -46
  96. metadata +41 -38
  97. data/Guardfile +0 -20
  98. data/app/assets/images/refinerycms-blog/.gitkeep +0 -0
  99. data/app/assets/javascripts/refinerycms-blog/.gitkeep +0 -0
  100. data/app/assets/stylesheets/refinerycms-blog/.gitkeep +0 -0
  101. data/app/models/refinery/categorization.rb +0 -10
  102. data/app/views/refinery/blog/admin/comments/approve.html.erb +0 -0
  103. data/lib/refinery/blog/version.rb +0 -17
  104. data/spec/requests/refinery/blog/admin/categories_spec.rb +0 -20
  105. data/spec/requests/refinery/blog/admin/posts_spec.rb +0 -175
  106. 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: a3112353a79633fd20a81d13c11c85bad6db5c9c
4
- data.tar.gz: b8864564da5a0c75a0c037a4c93eadcf8a648227
3
+ metadata.gz: 474d4fdc2f9ad359bd9255e60b9ca70b80a5ec62
4
+ data.tar.gz: acb4c9dbd5960f3f873ade37e2257c551f999c37
5
5
  SHA512:
6
- metadata.gz: 3cabbaae668655f98c6ea62758ffe821d17b741cc9ac4152bc1ca33f8f70ee575dd80e0c7d850e0c8ac7488631e554d6bc6e38e0fe11245731de734f7ff56b6b
7
- data.tar.gz: b0f32d1805116b613b0f0c4a1b358e7d95e857ad3244b786d7956109af5aef007bed8bd8ffe88648c34ba107eed047eaf0d92b93d1443f0619cf2f8a14a5a0f0
6
+ metadata.gz: d5f19a55c12dd44d8eee1e97b5ebb96bc16dbd3d56f23d5499e794df091afea8cd1800249db1ea221fa80d8b472b17c58ff2f39cb26ef0043e48a6790e4b7df1
7
+ data.tar.gz: aad373a5e0c9052fc338f379ef74a49ab31ebe9b32357f38e4bff98ef4dab01c905ddf95f55b851b6a14dbbfe31fe53a2adeb23fda386573bc3b34c9f9459242
data/.gitignore CHANGED
@@ -51,4 +51,7 @@ capybara-*html
51
51
  .rbenv-version
52
52
 
53
53
  Gemfile.lock
54
- .rbx
54
+ .rbx
55
+
56
+ # Local Gemfile for developing without sharing dependencies
57
+ .gemfile
@@ -1,9 +1,8 @@
1
1
  language: ruby
2
- before_install:
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 > /dev/null"
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 "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'refinerycms', '~> 2.0.10'
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
- group :test do
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
- gem 'jquery-rails'
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
@@ -33,35 +33,35 @@
33
33
  }
34
34
  ul.collapsible_menu li {
35
35
  position: relative;
36
- }
37
- ul.collapsible_menu li span.arrow {
38
- background-repeat: no-repeat;
39
- position: absolute;
40
- right: 10px;
41
- top: 13px;
42
- width: 11px;
43
- height: 7px;
44
- cursor: pointer;
45
- }
46
- ul.collapsible_menu li span.arrow {
47
- background-image: image_url('refinery/blog/icons/up.gif');
48
- }
49
- ul.collapsible_menu li.closed span.arrow {
50
- background-image: image_url('refinery/blog/icons/down.gif');
51
- }
52
- ul.collapsible_menu > div {
53
- width: 93%;
54
- margin: 0px auto;
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
- ul.blog_categories, ul.blog_categories li {
63
- list-style: none;
64
- margin:5px 0;
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 header, .blog_post footer {
2
- width: auto;
3
- }
4
- .blog_post .posted_at{
5
- }
6
- .post_categories .filed_in {
7
- display: inline;
8
- }
9
- .post_categories ul {
10
- margin: 0px 0px 0px 6px;
11
- padding: 0px;
12
- display: inline;
13
- }
14
- .post_categories ul li {
15
- margin: 0px;
16
- padding: 0px;
17
- display: inline;
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
- #next_prev_article a{
34
- display:block;
35
- width:33%;
36
- height:30px;
37
- line-height:30px;
38
- position:absolute;
39
- top:0;
40
- }
41
- #next_prev_article a.prev{
42
- left:0;
43
- }
44
- #next_prev_article a.home{
45
- left:33%;
46
- text-align:center;
47
- }
48
- #next_prev_article a.next{
49
- text-align:right;
50
- right:0;
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
- .flash_notice, .flash_message {
59
- border: 1px solid #00A017;
60
- color: #00A017;
61
- background: 7px 7px no-repeat image_url('refinery/blog/icons/accept.png') #E0F5E0;
62
- }
63
- .flash_notice, .flash_notice * {
64
- color: #00A017;
65
- }
66
- .flash_error {
67
- border: 1px solid #A00027;
68
- color: #A00027;
69
- background: 7px 7px no-repeat image_url('refinery/blog/icons/cancel.png') #FFB1B1;
70
- }
71
- .flash.flash_notice #flash_close, .flash.flash_error #flash_close {
72
- text-transform: lowercase;
73
- }
74
- .flash.flash_message {
75
- background: #E0F5E0;
76
- padding: 9px;
77
- position: relative;
78
- margin-bottom: 32px;
79
- }
80
- .flash.flash_message h2 {
81
- margin-top: 12px;
82
- }
83
- .flash_message, .flash_message * {
84
- color: #262719;
85
- font-size: 14px;
86
- }
87
- .flash a, .flash a:hover {
88
- color: #e20003;
89
- border-bottom-color: #e20003;
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 :action => 'index'
13
+ render :index
14
14
  end
15
15
 
16
16
  def approved
17
- unless params[:id].present?
18
- @comments = Refinery::Blog::Comment.approved.page(params[:page])
17
+ @comments = Refinery::Blog::Comment.approved.page(params[:page])
19
18
 
20
- render :action => 'index'
21
- else
22
- @comment = Refinery::Blog::Comment.find(params[:id])
23
- @comment.approve!
24
- flash[:notice] = t('approved', :scope => 'refinery.blog.admin.comments', :author => @comment.name)
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
- redirect_to refinery.url_for(:action => params[:return_to] || 'index', :id => nil)
27
- end
27
+ redirect_to refinery.blog_admin_comments_path
28
28
  end
29
29
 
30
30
  def rejected
31
- unless params[:id].present?
32
- @comments = Refinery::Blog::Comment.rejected.page(params[:page])
31
+ @comments = Refinery::Blog::Comment.rejected.page(params[:page])
32
+
33
+ render :index
34
+ end
33
35
 
34
- render :action => 'index'
35
- else
36
- @comment = Refinery::Blog::Comment.find(params[:id])
37
- @comment.reject!
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
- redirect_to refinery.url_for(:action => params[:return_to] || 'index', :id => nil)
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 :partial => "/shared/message"
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 :action => 'new'
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.find(:all)
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 => ::Refinery::I18n.default_frontend_locale) if canonical?
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 :action => 'show'
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
- @archive_date = Time.parse(date)
63
- @date_title = @archive_date.strftime('%B %Y')
64
- @posts = Post.live.by_archive(@archive_date).page(params[:page])
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
- @archive_date = Time.parse(date)
68
- @date_title = @archive_date.strftime('%Y')
69
- @posts = Post.live.by_year(@archive_date).page(params[:page])
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
- ::Refinery.i18n_enabled? && ::Refinery::I18n.default_frontend_locale != ::Refinery::I18n.current_frontend_locale
82
+ Refinery::I18n.default_frontend_locale != Refinery::I18n.current_frontend_locale
82
83
  end
83
84
  end
84
85
  end