tkh_content 0.10.6 → 0.10.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d951dd93ce0701b8f607b73cafe41969914202c
4
- data.tar.gz: de8a4b6e98b7d0da145ede1686ed8efa57352b24
3
+ metadata.gz: 55391869340e129ff0ab0c1c0da3d4edf682240d
4
+ data.tar.gz: bab8e99e206689e2fe6ab863a6cef46ed72c1b25
5
5
  SHA512:
6
- metadata.gz: 4c911b617d4d1667d68cd0ab6e4f6cb41dc02c3b757fc44178a964ba2d80dbf5b520d1ce355bee6021092489685789387f4cc3ad3ada99910307db89cc79540e
7
- data.tar.gz: 0020551ba14ddb59c5bc356e1a0794b2a1ad7e9e9f09c5ab2c951675e60d511bc9f5f4048810796c016ef60cd87f379d5a3b106ac05a75e8e75c6953f1c006d2
6
+ metadata.gz: 1a241b5f3496fe18c4b585119059ad05d3127ed3111fc8c708c3593e5a404fd71a514f59cf976cf11c5a583bc4273752575dd6a71e671bbf0068aa49ced55958
7
+ data.tar.gz: bb2fc414805a838d3971055efd899ac0028bbbb76873fd46f0fddae1731db487a4f2660d3f49e60aba41eb2ba077c99c1e8abec89302fdbda6171e5a8d063e98
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
 
4
4
 
5
+ ## 0.10.7
6
+
7
+ * Debugged blog#by_tag method and view when there were no posts for a specific tag. Can happen with a non-translated bi-lingual post.
8
+
9
+
5
10
  ## 0.10.6
6
11
 
7
12
  * Added translation for comments admin digest list.
@@ -9,11 +9,17 @@ class BlogController < ApplicationController
9
9
  end
10
10
 
11
11
  def by_tag
12
+ # this is necessary to deal with instances when no posts are present for that tag
13
+ @tag_name = params[:id]
12
14
  # this little hack is necessary because globalize won't let me access the tag directly by name
13
- tag_id = Tag::Translation.find_by( locale: I18n.locale.to_s, name: params[:id] ).tag_id
14
- @tag = Tag.find(tag_id)
15
- @posts = @tag.pages.published.order('published_at desc').paginate(:page => params[:page], :per_page => 20)
16
- render :layout => 'blog'
15
+ tag = Tag::Translation.find_by( locale: I18n.locale.to_s, name: @tag_name )
16
+ if tag.present?
17
+ @tag = Tag.find(tag.tag_id)
18
+ @posts = @tag.pages.published.order('published_at desc').paginate(:page => params[:page], :per_page => 20)
19
+ render :layout => 'blog'
20
+ else
21
+ @posts = nil
22
+ end
17
23
  end
18
24
 
19
25
  end
@@ -1,24 +1,24 @@
1
1
  <% content_for :meta_title, Setting.first.try(:company_name) %>
2
- <% content_for :meta_description, "Blog posts with the '#{@tag.name}' tag." %>
2
+ <% content_for :meta_description, "Blog posts with the '#{@tag_name}' tag." %>
3
3
  <% content_for :canonical_link, link_to('', blog_path, rel: 'canonical') %>
4
4
 
5
5
  <div class="panel panel-info">
6
6
  <div class="panel-heading">
7
- <h3 class="panel-title"><%= "#{@tag.name} (#{@tag.taggings.count})" %></h3>
7
+ <h3 class="panel-title"><%= "#{@tag_name} (#{@tag.present? ? @tag.taggings.count : '0'})" %></h3>
8
8
  </div>
9
9
  <div class="panel-body">
10
- Liste des articles avec cette étiquette
10
+ <%= @posts.nil? ? t('tags.no_posts_to_show') : t('tags.list_of_posts') %>
11
11
  </div>
12
12
  </div>
13
13
 
14
- <%= will_paginate @posts, inner_window: 2 %>
15
-
16
- <% for post in @posts %>
17
- <%= render '/pages/individual_blog_post_in_list', post: post %>
14
+ <% unless @posts.nil? %>
15
+ <%= will_paginate @posts, inner_window: 2 %>
16
+ <% for post in @posts %>
17
+ <%= render '/pages/individual_blog_post_in_list', post: post %>
18
+ <% end %>
19
+ <%= will_paginate @posts, inner_window: 2 %>
18
20
  <% end %>
19
21
 
20
- <%= will_paginate @posts, inner_window: 2 %>
21
-
22
22
  <%= render 'all_tags_list' %>
23
23
  <%= render( 'admin_context_menu', page: @page) %>
24
24
  <%# partial in tkh_menus gem or has to be added in host app %>
@@ -66,6 +66,9 @@ de:
66
66
  hint:
67
67
  name: 'Lower case only. Multiple words should be joined by a dash (-) and NOT spaces'
68
68
 
69
+ list_of_posts: List of blog posts with this tag
70
+ no_posts_to_show: There are no posts with this tag
71
+
69
72
 
70
73
  comments:
71
74
  digest_intro: 'List of non-moderated comments from users:'
@@ -66,6 +66,9 @@ en:
66
66
  hint:
67
67
  name: 'Lower case only. Multiple words should be joined by a dash (-) and NOT spaces'
68
68
 
69
+ list_of_posts: List of blog posts with this tag
70
+ no_posts_to_show: There are no posts with this tag
71
+
69
72
  comments:
70
73
  digest_intro: 'List of non-moderated comments from users:'
71
74
  login_needed: 'You need to be logged in to leave a comment'
@@ -66,6 +66,9 @@ es:
66
66
  hint:
67
67
  name: 'Lower case only. Multiple words should be joined by a dash (-) and NOT spaces'
68
68
 
69
+ list_of_posts: List of blog posts with this tag
70
+ no_posts_to_show: There are no posts with this tag
71
+
69
72
  comments:
70
73
  digest_intro: 'List of non-moderated comments from users:'
71
74
  login_needed: 'You need to be logged in to leave a comment'
@@ -66,6 +66,9 @@ fr:
66
66
  hint:
67
67
  name: 'Pas de majuscules, que des minuscules. Entre les mots multiples, utilisez un tiret ( - ), pas avec un espace.'
68
68
 
69
+ list_of_posts: Liste des articles avec cette étiquette
70
+ no_posts_to_show: Il n'y a pas d'articles avec cette étiquette
71
+
69
72
 
70
73
  comments:
71
74
  digest_intro: 'Liste des commentaires en attente de revue :'
@@ -1,3 +1,3 @@
1
1
  module TkhContent
2
- VERSION = "0.10.6"
2
+ VERSION = "0.10.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_content
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.6
4
+ version: 0.10.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swami Atma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-19 00:00:00.000000000 Z
11
+ date: 2015-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -278,7 +278,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
278
278
  version: '0'
279
279
  requirements: []
280
280
  rubyforge_project:
281
- rubygems_version: 2.4.4
281
+ rubygems_version: 2.2.2
282
282
  signing_key:
283
283
  specification_version: 4
284
284
  summary: Rails engine running pages and blog posts.