publinator 0.0.18 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,28 +11,6 @@ module Publinator
11
11
  RDiscount.new(markdown_text).to_html.html_safe
12
12
  end
13
13
 
14
- def menu_section(title, path = "", collection)
15
- if path.blank?
16
- ct = "
17
- <li id=\"#{title.underscore}\">#{title}<br>\n"
18
- else
19
- ct = "
20
- <li id=\"#{title.underscore}\"><a href='#{path}'>#{title}</a><br>\n"
21
- end
22
- if collection && collection.length && collection.length > 0
23
- ct += "<div class='submenu'>
24
- <ul>"
25
- collection.each do |c|
26
- ct += menu_section(c.title, c.path, c.menu_collection)
27
- end
28
- ct += "</ul>
29
- </div>"
30
- end
31
- ct += "</li>"
32
- ct.html_safe
33
- end
34
-
35
-
36
14
  def menu_item(object)
37
15
  if object.respond_to?(:is_publishable?)
38
16
  li_tag(object)
@@ -42,6 +20,7 @@ module Publinator
42
20
  end
43
21
 
44
22
  def collection_li_tag(object, li_collection_title = nil, li_collection_path = nil)
23
+ return if object.respond_to?(:hide_in_submenu) && object.hide_in_submenu
45
24
  collection_title = li_collection_title.present? ? li_collection_title : object.first.collection_name
46
25
  collection_slug = object.first.class.to_s.tableize.humanize
47
26
  collection_path = li_collection_path.present? ? li_collection_path : "/#{object.first.class.to_s.tableize}"
@@ -90,7 +69,7 @@ module Publinator
90
69
  div_content = ""
91
70
  ul_content = ""
92
71
  div_content += content_tag(:ul) do
93
- object.menu_collection.each{ |mco| ul_content += li_tag(mco) }
72
+ object.menu_collection.each{ |mco| ul_content += li_tag(mco) unless mco.respond_to?(:hide_in_submenu) && mco.hide_in_submenu }
94
73
  ul_content.html_safe
95
74
  end
96
75
  div_content.html_safe
@@ -1,3 +1,3 @@
1
1
  module Publinator
2
- VERSION = "0.0.18"
2
+ VERSION = "0.0.19"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: publinator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.0.19
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -352,7 +352,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
352
352
  version: '0'
353
353
  segments:
354
354
  - 0
355
- hash: -3428793437559641373
355
+ hash: 2863941966361980414
356
356
  required_rubygems_version: !ruby/object:Gem::Requirement
357
357
  none: false
358
358
  requirements:
@@ -361,7 +361,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
361
361
  version: '0'
362
362
  segments:
363
363
  - 0
364
- hash: -3428793437559641373
364
+ hash: 2863941966361980414
365
365
  requirements: []
366
366
  rubyforge_project:
367
367
  rubygems_version: 1.8.24