refinerycms 0.9.5.26 → 0.9.5.27

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/Rakefile CHANGED
@@ -56,5 +56,5 @@ begin
56
56
  end
57
57
  end
58
58
  rescue LoadError
59
- puts "Jeweler not available. Install it with: sudo gem install jeweler"
59
+ #puts "Jeweler not available. Install it with: sudo gem install jeweler"
60
60
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.5.26
1
+ 0.9.5.27
@@ -217,7 +217,7 @@ a:hover {
217
217
 
218
218
  #header li a {
219
219
  display: block;
220
- padding: 9px 12px;
220
+ padding: 9px;
221
221
  font-size: 14px;
222
222
  background-color: #c2c2b3;
223
223
  margin-top: 6px;
@@ -872,6 +872,7 @@ ul#menu.reordering_menu li a {
872
872
  background-position: 7px;
873
873
  width: 4px;
874
874
  _margin-top: 6px;
875
+ padding: 9px 12px;
875
876
  }
876
877
  #header #menu li a#menu_reorder:hover, #header #menu li a#menu_reorder_done:hover {
877
878
  background-color: #a1a18b;
@@ -34,6 +34,11 @@ module Crud
34
34
  end
35
35
 
36
36
  def create
37
+ # if the position field exists, set this object as last object, given the conditions of this class.
38
+ if #{class_name}.column_names.include?("position")
39
+ params[:#{singular_name}].merge!({:position => #{class_name}.maximum(:position, :conditions => "#{options[:conditions]}")})
40
+ end
41
+
37
42
  if (@#{singular_name} = #{class_name}.create(params[:#{singular_name}])).valid?
38
43
  unless request.xhr?
39
44
  flash[:notice] = "'\#{@#{singular_name}.#{options[:title_attribute]}}' was successfully created."
@@ -16,7 +16,13 @@ class <%= migration_name %> < ActiveRecord::Migration
16
16
  user.plugins.create(:title => "<%= class_name.pluralize.underscore.titleize %>", :position => (user.plugins.maximum(:position) || -1) +1)
17
17
  end
18
18
 
19
- page = Page.create(:title => "<%= class_name.pluralize.underscore.titleize %>", :link_url => "/<%= plural_name %>", :deletable => false, :position => ((Page.maximum(:position, :conditions => "parent_id IS NULL") || -1)+1))
19
+ page = Page.create(
20
+ :title => "<%= class_name.pluralize.underscore.titleize %>",
21
+ :link_url => "/<%= plural_name %>",
22
+ :deletable => false,
23
+ :position => ((Page.maximum(:position, :conditions => "parent_id IS NULL") || -1)+1),
24
+ :menu_match => "^/<%= plural_name %>(\/|\/.+?|)$"
25
+ )
20
26
  RefinerySetting.find_or_set(:default_page_parts, ["body", "side_body"]).each do |default_page_part|
21
27
  page.parts.create(:title => default_page_part, :body => nil)
22
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5.26
4
+ version: 0.9.5.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Resolve Digital
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2009-12-14 00:00:00 +13:00
14
+ date: 2009-12-17 00:00:00 +13:00
15
15
  default_executable:
16
16
  dependencies: []
17
17