tkh_content 0.1.9.3 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
 
4
4
 
5
+ ## 0.1.10
6
+
7
+ * Added an admin section in sidebar of non-blog pages
8
+
9
+
5
10
  ## 0.1.9.3
6
11
 
7
12
  * Modified labels in contact_us form partial
data/app/models/page.rb CHANGED
@@ -35,7 +35,7 @@ class Page < ActiveRecord::Base
35
35
  scope :by_menu_position, order('menu_position')
36
36
 
37
37
  def nickname
38
- short_title || title
38
+ @nickname ||= short_title || title
39
39
  end
40
40
 
41
41
  ### menu related instance methods
@@ -0,0 +1,15 @@
1
+ <% content_for :admin_context_menu do %>
2
+ <h2>Admin Section</h2>
3
+ <%= link_to 'edit this page', edit_page_path(page), class: 'btn' %>
4
+ <% if Page.not_for_blog.orphans.published.any? %>
5
+ <h4>Reorder Root Page Menu Items</h4>
6
+ <ul class="draggable" data-update-url="<%= sort_pages_path %>">
7
+ <% for page in Page.not_for_blog.orphans.published.by_menu_position %>
8
+ <%= content_tag :li, page, class: 'page', id: "page_#{page.id}" do %>
9
+ <%= image_tag 'drag-handle.gif', :class => 'handle silhouette' %> <%= page.nickname -%>
10
+ <% end -%>
11
+ <% end %>
12
+ </ul>
13
+ <% end %>
14
+
15
+ <% end -%>
@@ -4,6 +4,7 @@
4
4
  <% unless @page.for_blog? %>
5
5
 
6
6
  <%= raw tkhed(@page.body) %>
7
+ <%= render( 'admin_context_menu', page: @page) if administrator? %>
7
8
 
8
9
  <% else %>
9
10
 
@@ -14,4 +15,4 @@
14
15
  <% end -%>
15
16
 
16
17
  <%# partial in tkh_menus gem or has to be added in host app %>
17
- <%= render './shared/menus' %>
18
+ <%= render './shared/menus' %>
@@ -1,3 +1,3 @@
1
1
  module TkhContent
2
- VERSION = "0.1.9.3"
2
+ VERSION = "0.1.10"
3
3
  end
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.3
4
+ version: 0.1.10
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-08 00:00:00.000000000 Z
12
+ date: 2013-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -161,6 +161,7 @@ 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/_admin_context_menu.html.erb
164
165
  - app/views/pages/_blog_post_meta.html.erb
165
166
  - app/views/pages/_form.html.erb
166
167
  - app/views/pages/_individual_blog_post_in_list.html.erb
@@ -236,7 +237,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
236
237
  version: '0'
237
238
  segments:
238
239
  - 0
239
- hash: -3837185877085223117
240
+ hash: 4395062461440943694
240
241
  required_rubygems_version: !ruby/object:Gem::Requirement
241
242
  none: false
242
243
  requirements:
@@ -245,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
245
246
  version: '0'
246
247
  segments:
247
248
  - 0
248
- hash: -3837185877085223117
249
+ hash: 4395062461440943694
249
250
  requirements: []
250
251
  rubyforge_project:
251
252
  rubygems_version: 1.8.23