spud_cms 0.4.7 → 0.4.8

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.
@@ -74,14 +74,27 @@ module Spud::Cms::ApplicationHelper
74
74
  end
75
75
  content += "</li>"
76
76
  end
77
- # menu.spud_menu_items.order(:menu_order).each do |item|
78
- # content += "<li><a href='#{item.spud_page_id ? page_path(:id => item.spud_page.url_name) : item.url}'>#{item.name}</a>"
79
- # content += sp_list_menu_item(item)
80
- # content += "</li>"
81
- # end
77
+
82
78
  content += "</ul>"
83
79
  return content.html_safe
84
80
  end
81
+
82
+ def sp_menu_with_seperator(options={})
83
+ seperator = "&nbsp;|&nbsp;".html_safe
84
+ if(options.has_key?(:seperator))
85
+ seperator = options[:seperator]
86
+ end
87
+
88
+ menu = SpudMenu.where(:name => options[:name]).first
89
+ menu_items = menu.spud_menu_items_combined.select("spud_menu_items.id as id,spud_menu_items.url as url,spud_menu_items.classes as classes,spud_menu_items.parent_type as parent_type,spud_menu_items.menu_order as menu_order,spud_menu_items.parent_id as parent_id,spud_menu_items.name as name,spud_pages.url_name as url_name").order(:parent_type,:parent_id).joins("LEFT JOIN spud_pages ON (spud_pages.id = spud_menu_items.spud_page_id)").all
90
+
91
+ menu_tags = []
92
+ menu_items.sort_by{|p| p.menu_order}.each do |item|
93
+ menu_tags += ["<a #{"class='#{item.classes}' " if !item.classes.blank?}href='#{!item.url_name.blank? ? page_path(:id => item.url_name) : item.url}'>#{item.name}</a>"]
94
+ end
95
+
96
+ return menu_tags.join(seperator).html_safe
97
+ end
85
98
  private
86
99
  def sp_list_menu_item(items,item_id,depth,max_depth)
87
100
 
@@ -115,20 +128,5 @@ private
115
128
  return content.html_safe
116
129
  end
117
130
 
118
- def sp_menu_with_seperator(options={})
119
- seperator = "&nbsp;|&nbsp;".html_safe
120
- if(options.has_key?(:seperator))
121
- seperator = options[:seperator]
122
- end
123
-
124
- menu = SpudMenu.where(:name => options[:name]).first
125
- menu_items = menu.spud_menu_items_combined.select("spud_menu_items.id as id,spud_menu_items.url as url,spud_menu_items.classes as classes,spud_menu_items.parent_type as parent_type,spud_menu_items.menu_order as menu_order,spud_menu_items.parent_id as parent_id,spud_menu_items.name as name,spud_pages.url_name as url_name").order(:parent_type,:parent_id).joins("LEFT JOIN spud_pages ON (spud_pages.id = spud_menu_items.spud_page_id)").all
126
-
127
- menu_tags = []
128
- menu_items.sort_by{|p| p.menu_order}.each do |item|
129
- menu_tags += ["<a #{"class='#{item.classes}' " if !item.classes.blank?}href='#{!item.url_name.blank? ? page_path(:id => item.url_name) : item.url}'>#{item.name}</a>"]
130
- end
131
-
132
- return menu_tags.join(seperator).html_safe
133
- end
131
+
134
132
  end
@@ -2,7 +2,6 @@ class PageSweeper < ActionController::Caching::Sweeper
2
2
  observe SpudPage,SpudTemplate,SpudMenuItem
3
3
 
4
4
  def after_save(record)
5
- logger.debug("SWEEPING!")
6
5
  expire_cache_for(record)
7
6
  expire_page spud_cms_sitemap_path
8
7
  expire_page spud_sitemap_path
@@ -44,7 +44,6 @@ class SpudPage < ActiveRecord::Base
44
44
 
45
45
 
46
46
  def generate_url_name
47
- # return false if self.name.blank?
48
47
  return true if self.name.blank?
49
48
  if !self.use_custom_url_name || self.url_name.blank?
50
49
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spud_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-26 00:00:00.000000000 Z
12
+ date: 2012-02-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spud_core
16
- requirement: &70103614893400 !ruby/object:Gem::Requirement
16
+ requirement: &70245218817960 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.6.3
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70103614893400
24
+ version_requirements: *70245218817960
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: codemirror-rails
27
- requirement: &70103614892920 !ruby/object:Gem::Requirement
27
+ requirement: &70245218817480 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70103614892920
35
+ version_requirements: *70245218817480
36
36
  description:
37
37
  email: destes@redwindsw.com
38
38
  executables: []
@@ -42,15 +42,9 @@ extra_rdoc_files:
42
42
  files:
43
43
  - app/assets/images/spud/admin/menus_thumb.png
44
44
  - app/assets/images/spud/admin/pages_thumb.png
45
- - app/assets/images/spud/admin/posts_thumb.png
46
45
  - app/assets/images/spud/admin/templates_thumb.png
47
- - app/assets/javascripts/pages.js
48
46
  - app/assets/javascripts/spud/admin/cms/application.js
49
- - app/assets/javascripts/spud/admin/templates.js
50
- - app/assets/javascripts/spud/cms/sitemaps.js
51
- - app/assets/stylesheets/pages.css
52
47
  - app/assets/stylesheets/spud/admin/cms/application.css
53
- - app/assets/stylesheets/spud/cms/sitemaps.css
54
48
  - app/controllers/pages_controller.rb
55
49
  - app/controllers/spud/admin/menu_items_controller.rb
56
50
  - app/controllers/spud/admin/menus_controller.rb
@@ -1,2 +0,0 @@
1
- // Place all the behaviors and hooks related to the matching controller here.
2
- // All this logic will automatically be available in application.js.
@@ -1,2 +0,0 @@
1
- // Place all the behaviors and hooks related to the matching controller here.
2
- // All this logic will automatically be available in application.js.
@@ -1,2 +0,0 @@
1
- // Place all the behaviors and hooks related to the matching controller here.
2
- // All this logic will automatically be available in application.js.
@@ -1,4 +0,0 @@
1
- /*
2
- Place all the styles related to the matching controller here.
3
- They will automatically be included in application.css.
4
- */
@@ -1,4 +0,0 @@
1
- /*
2
- Place all the styles related to the matching controller here.
3
- They will automatically be included in application.css.
4
- */