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 +4 -4
- data/CHANGELOG.md +5 -0
- data/app/controllers/blog_controller.rb +10 -4
- data/app/views/blog/by_tag.html.erb +9 -9
- data/lib/generators/tkh_content/create_or_update_locales/templates/de.yml +3 -0
- data/lib/generators/tkh_content/create_or_update_locales/templates/en.yml +3 -0
- data/lib/generators/tkh_content/create_or_update_locales/templates/es.yml +3 -0
- data/lib/generators/tkh_content/create_or_update_locales/templates/fr.yml +3 -0
- data/lib/tkh_content/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55391869340e129ff0ab0c1c0da3d4edf682240d
|
4
|
+
data.tar.gz: bab8e99e206689e2fe6ab863a6cef46ed72c1b25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a241b5f3496fe18c4b585119059ad05d3127ed3111fc8c708c3593e5a404fd71a514f59cf976cf11c5a583bc4273752575dd6a71e671bbf0068aa49ced55958
|
7
|
+
data.tar.gz: bb2fc414805a838d3971055efd899ac0028bbbb76873fd46f0fddae1731db487a4f2660d3f49e60aba41eb2ba077c99c1e8abec89302fdbda6171e5a8d063e98
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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 '#{@
|
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"><%= "#{@
|
7
|
+
<h3 class="panel-title"><%= "#{@tag_name} (#{@tag.present? ? @tag.taggings.count : '0'})" %></h3>
|
8
8
|
</div>
|
9
9
|
<div class="panel-body">
|
10
|
-
|
10
|
+
<%= @posts.nil? ? t('tags.no_posts_to_show') : t('tags.list_of_posts') %>
|
11
11
|
</div>
|
12
12
|
</div>
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
<% for post in @posts %>
|
17
|
-
|
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 :'
|
data/lib/tkh_content/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|