tkh_content 0.1.9.2 → 0.1.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +10 -0
- data/app/controllers/pages_controller.rb +7 -0
- data/app/helpers/pages_helper.rb +1 -1
- data/app/models/page.rb +1 -0
- data/app/views/blog/index.html.erb +7 -10
- data/app/views/contacts/_form.html.erb +3 -3
- data/app/views/pages/_blog_post_meta.html.erb +4 -0
- data/app/views/pages/_individual_blog_post_in_list.html.erb +5 -0
- data/app/views/pages/show.html.erb +9 -4
- data/config/routes.rb +3 -0
- data/lib/generators/tkh_content/create_or_update_locales/templates/de.yml +6 -0
- data/lib/generators/tkh_content/create_or_update_locales/templates/en.yml +6 -0
- data/lib/generators/tkh_content/create_or_update_locales/templates/es.yml +6 -0
- data/lib/generators/tkh_content/create_or_update_locales/templates/fr.yml +6 -0
- data/lib/generators/tkh_content/create_or_update_migrations/create_or_update_migrations_generator.rb +1 -0
- data/lib/generators/tkh_content/create_or_update_migrations/templates/add_various_indices_to_pages.rb +14 -0
- data/lib/tkh_content/version.rb +1 -1
- metadata +7 -4
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,16 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
## 0.1.9.3
|
6
|
+
|
7
|
+
* Modified labels in contact_us form partial
|
8
|
+
* Improved styling and display for the show view of content pages and blog posts
|
9
|
+
* Added a new datetime locale format
|
10
|
+
* Administrators get an 'edit' button in the meta info of blog posts
|
11
|
+
* Added indices to page model
|
12
|
+
* Pages have a menu_position attribute and can easily be reordered in combination with the tkh_menus gem
|
13
|
+
|
14
|
+
|
5
15
|
## 0.1.9.1 & 0.1.9.2
|
6
16
|
|
7
17
|
* Debugging
|
@@ -74,4 +74,11 @@ class PagesController < ApplicationController
|
|
74
74
|
redirect_to pages_path notice: "The blog status of the page has been changed"
|
75
75
|
end
|
76
76
|
|
77
|
+
def sort
|
78
|
+
params[:page].each_with_index do |id, index|
|
79
|
+
Page.update_all({ menu_position: index+1 }, { id: id })
|
80
|
+
end
|
81
|
+
render nothing: true
|
82
|
+
end
|
83
|
+
|
77
84
|
end
|
data/app/helpers/pages_helper.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module PagesHelper
|
2
2
|
def tkhed(content)
|
3
|
-
content = content.gsub /\(-: contact_us_form :-\)/, render('contacts/form') if content.match(
|
3
|
+
content = content.gsub /\(-: contact_us_form :-\)/, render('contacts/form') if content.match(/\(-: contact_us_form :-\)/)
|
4
4
|
content
|
5
5
|
end
|
6
6
|
end
|
data/app/models/page.rb
CHANGED
@@ -32,6 +32,7 @@ class Page < ActiveRecord::Base
|
|
32
32
|
scope :orphans, where('parent_id IS ?', nil)
|
33
33
|
scope :with_parent_id, lambda { |id| where('parent_id = ?', id) }
|
34
34
|
scope :by_title, order('title')
|
35
|
+
scope :by_menu_position, order('menu_position')
|
35
36
|
|
36
37
|
def nickname
|
37
38
|
short_title || title
|
@@ -1,13 +1,10 @@
|
|
1
|
-
<% content_for :meta_title,
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<p class="meta-info">by <%= post.author.name %> on <%= l post.published_at, format: :default %> | <%= link_to 'Permalink.', post %></p>
|
8
|
-
<%= raw post.body %>
|
9
|
-
</div>
|
10
|
-
<% end %>
|
1
|
+
<% content_for :meta_title, Setting.first.blog_name %>
|
2
|
+
<%= content_for :meta_description, "#{Setting.first.blog_tagline} - #{Setting.first.company_name}: the official blog" %>
|
3
|
+
|
4
|
+
|
5
|
+
<% for post in @posts %>
|
6
|
+
<%= render '/pages/individual_blog_post_in_list', post: post %>
|
11
7
|
<% end %>
|
12
8
|
|
9
|
+
|
13
10
|
<%= will_paginate @posts %>
|
@@ -2,9 +2,9 @@
|
|
2
2
|
<%= f.error_notification %>
|
3
3
|
|
4
4
|
<div class="form-inputs">
|
5
|
-
<%= f.input :sender_name %>
|
6
|
-
<%= f.input :sender_email %>
|
7
|
-
<%= f.input :body, :input_html => { :rows => 10 } %>
|
5
|
+
<%= f.input :sender_name, label: 'your name' %>
|
6
|
+
<%= f.input :sender_email, label: 'your email' %>
|
7
|
+
<%= f.input :body, label: 'your message', :input_html => { :rows => 10 } %>
|
8
8
|
</div>
|
9
9
|
|
10
10
|
<div class="form-actions">
|
@@ -1,12 +1,17 @@
|
|
1
1
|
<% content_for :meta_title, @page.title %>
|
2
2
|
<% content_for :meta_description, @page.description %>
|
3
3
|
|
4
|
-
|
4
|
+
<% unless @page.for_blog? %>
|
5
5
|
|
6
|
-
<%= raw tkhed(@page.body) %>
|
6
|
+
<%= raw tkhed(@page.body) %>
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
<% else %>
|
9
|
+
|
10
|
+
<%= content_tag(:h1, @page.title) %>
|
11
|
+
<%= render '/pages/blog_post_meta', post: @page %>
|
12
|
+
<%= raw tkhed(@page.body) %>
|
13
|
+
|
14
|
+
<% end -%>
|
10
15
|
|
11
16
|
<%# partial in tkh_menus gem or has to be added in host app %>
|
12
17
|
<%= render './shared/menus' %>
|
data/config/routes.rb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
de:
|
2
2
|
|
3
|
+
time:
|
4
|
+
formats:
|
5
|
+
# eventually this should be abstracted to a tkh_utilities gem together with all
|
6
|
+
# standard helpers and functionality
|
7
|
+
tkh_default: '%A, %d. %B %Y, %H:%M Uhr'
|
8
|
+
|
3
9
|
are_you_sure: 'Bist Du sicher?'
|
4
10
|
delete: 'löschen'
|
5
11
|
edit: 'bearbeiten'
|
data/lib/generators/tkh_content/create_or_update_migrations/create_or_update_migrations_generator.rb
CHANGED
@@ -23,6 +23,7 @@ module TkhContent
|
|
23
23
|
migration_template "create_tags.rb", "db/migrate/create_tags.rb"
|
24
24
|
migration_template "create_taggings.rb", "db/migrate/create_taggings.rb"
|
25
25
|
migration_template "create_contacts.rb", "db/migrate/create_contacts.rb"
|
26
|
+
migration_template "add_various_indices_to_pages.rb", "db/migrate/add_various_indices_to_pages.rb"
|
26
27
|
end
|
27
28
|
|
28
29
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class AddVariousIndicesToPages < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def self.up
|
4
|
+
add_index :pages, :updated_at
|
5
|
+
add_index :pages, :for_blog
|
6
|
+
add_index :pages, :title
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.down
|
10
|
+
remove_index :pages, :updated_at
|
11
|
+
remove_index :pages, :for_blog
|
12
|
+
remove_index :pages, :title
|
13
|
+
end
|
14
|
+
end
|
data/lib/tkh_content/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tkh_content
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.9.
|
4
|
+
version: 0.1.9.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -161,7 +161,9 @@ files:
|
|
161
161
|
- app/views/contact_mailer/message_from_contact_form.text.erb
|
162
162
|
- app/views/contacts/_form.html.erb
|
163
163
|
- app/views/contacts/index.html.erb
|
164
|
+
- app/views/pages/_blog_post_meta.html.erb
|
164
165
|
- app/views/pages/_form.html.erb
|
166
|
+
- app/views/pages/_individual_blog_post_in_list.html.erb
|
165
167
|
- app/views/pages/edit.html.erb
|
166
168
|
- app/views/pages/index.html.erb
|
167
169
|
- app/views/pages/new.html.erb
|
@@ -178,6 +180,7 @@ files:
|
|
178
180
|
- lib/generators/tkh_content/create_or_update_migrations/create_or_update_migrations_generator.rb
|
179
181
|
- lib/generators/tkh_content/create_or_update_migrations/templates/add_author_to_pages.rb
|
180
182
|
- lib/generators/tkh_content/create_or_update_migrations/templates/add_parent_id_to_pages.rb
|
183
|
+
- lib/generators/tkh_content/create_or_update_migrations/templates/add_various_indices_to_pages.rb
|
181
184
|
- lib/generators/tkh_content/create_or_update_migrations/templates/create_contacts.rb
|
182
185
|
- lib/generators/tkh_content/create_or_update_migrations/templates/create_pages.rb
|
183
186
|
- lib/generators/tkh_content/create_or_update_migrations/templates/create_taggings.rb
|
@@ -233,7 +236,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
233
236
|
version: '0'
|
234
237
|
segments:
|
235
238
|
- 0
|
236
|
-
hash: -
|
239
|
+
hash: -3837185877085223117
|
237
240
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
238
241
|
none: false
|
239
242
|
requirements:
|
@@ -242,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
242
245
|
version: '0'
|
243
246
|
segments:
|
244
247
|
- 0
|
245
|
-
hash: -
|
248
|
+
hash: -3837185877085223117
|
246
249
|
requirements: []
|
247
250
|
rubyforge_project:
|
248
251
|
rubygems_version: 1.8.23
|