refinerycms-core 0.9.9.17 → 0.9.9.18

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,9 +15,11 @@
15
15
  -%>
16
16
  <nav id='<%= dom_id %>' class='<%= css %>'>
17
17
  <ul>
18
+ <% roots.each_with_index do |menu_branch, index| %>
18
19
  <%= render :partial => '/shared/menu_branch',
19
- :collection => roots,
20
20
  :locals => {
21
+ :menu_branch => menu_branch,
22
+ :menu_branch_counter => index,
21
23
  :hide_children => hide_children,
22
24
  :sibling_count => (roots.length - 1),
23
25
  :collection => collection,
@@ -25,6 +27,7 @@
25
27
  :apply_css => true #if you don't care about class='first' class='last' or class='selected' set apply_css to false for speed.
26
28
  }
27
29
  -%>
30
+ <% end %>
28
31
  </ul>
29
32
  </nav>
30
33
  <% end -%>
@@ -13,16 +13,19 @@
13
13
  <%= link_to menu_branch.title, menu_branch.url -%>
14
14
  <% if children.present? -%>
15
15
  <ul class='clearfix'>
16
- <%=
17
- render :partial => '/shared/menu_branch',
18
- :collection => children,
19
- :locals => {
20
- :apply_css => local_assigns[:apply_css],
21
- :hide_children => !!hide_children,
22
- :collection => collection,
23
- :selected_item => selected_item,
24
- :sibling_count => children.size - 1
25
- } -%>
16
+ <% children.each_with_index do |child, index| %>
17
+ <%=
18
+ render :partial => '/shared/menu_branch',
19
+ :locals => {
20
+ :menu_branch => child,
21
+ :menu_branch_counter => index,
22
+ :apply_css => local_assigns[:apply_css],
23
+ :hide_children => !!hide_children,
24
+ :collection => collection,
25
+ :selected_item => selected_item,
26
+ :sibling_count => children.size - 1
27
+ } -%>
28
+ <% end %>
26
29
  </ul>
27
30
  <% end -%>
28
31
  </li>
data/lib/gemspec.rb CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.add_dependency 'friendly_id_globalize3', '~> 3.2.1'
27
27
  s.add_dependency 'globalize3', '>= 0.1.0.beta'
28
28
  s.add_dependency 'moretea-awesome_nested_set', '~> 1.4'
29
- s.add_dependency 'rails', '~> 3.0.7.rc1'
29
+ s.add_dependency 'rails', '~> 3.0.7.rc2'
30
30
  s.add_dependency 'rdoc', '>= 2.5.11' # helps fix ubuntu
31
31
  s.add_dependency 'truncate_html', '~> 0.5'
32
32
  s.add_dependency 'will_paginate', '~> 3.0.pre'
@@ -105,6 +105,12 @@ class RefinerycmsGenerator < ::Refinery::Generators::EngineInstaller
105
105
  }.sort.each do |path|
106
106
  copy_file path, path.to_s.gsub(self.class.source_root.to_s, Rails.root.to_s)
107
107
  end
108
+
109
+ # Ensure i18n exists and is up to date.
110
+ if defined?(::Refinery::I18n)
111
+ require 'generators/refinerycms_i18n_generator'
112
+ ::RefinerycmsI18n.new.generate
113
+ end
108
114
  end
109
115
 
110
116
  end
@@ -3,12 +3,12 @@
3
3
  db/*.sqlite3
4
4
  db/*.sqlite3-journal
5
5
  *.log
6
+ tmp
6
7
  tmp/**/*
7
8
 
8
9
  # Documentation
9
10
  doc/api
10
11
  doc/app
11
- doc/*
12
12
  .yardoc
13
13
  .yardopts
14
14
 
@@ -29,7 +29,7 @@ index/**/*
29
29
  # Refinery Specific
30
30
  *.tmproj
31
31
  *.autobackupbyrefinery.*
32
- /refinerycms-*.gem
32
+ refinerycms-*.gem
33
33
  .autotest
34
34
 
35
35
  # Mac
@@ -57,6 +57,9 @@ nbproject
57
57
  # RubyMine
58
58
  .idea
59
59
 
60
+ # E-texteditor
61
+ .eprj
62
+
60
63
  # Backup
61
64
  *~
62
65
 
@@ -2,21 +2,24 @@ xml.instruct!
2
2
 
3
3
  xml.urlset "xmlns" => "http://www.sitemaps.org/schemas/sitemap/0.9" do
4
4
 
5
- @pages.each do |page|
6
- # exclude sites that are external to our own domain.
7
- page_url = if page.url.is_a?(Hash)
8
- # This is how most pages work without being overriden by link_url
9
- page.url.merge({:only_path => false})
10
- elsif page.url.to_s !~ /^http/
11
- # handle relative link_url addresses.
12
- "#{request.protocol}#{request.host_with_port}#{page.url}"
13
- end
5
+ @locales.each do |locale|
6
+ ::I18n.locale = locale
7
+ Page.live.in_menu.includes(:parts).each do |page|
8
+ # exclude sites that are external to our own domain.
9
+ page_url = if page.url.is_a?(Hash)
10
+ # This is how most pages work without being overriden by link_url
11
+ page.url.merge({:only_path => false})
12
+ elsif page.url.to_s !~ /^http/
13
+ # handle relative link_url addresses.
14
+ [request.protocol, request.host_with_port, page.url].join
15
+ end
14
16
 
15
- # Add XML entry only if there is a valid page_url found above.
16
- xml.url do
17
- xml.loc url_for(page_url)
18
- xml.lastmod page.updated_at.to_date
19
- end if page_url.present?
17
+ # Add XML entry only if there is a valid page_url found above.
18
+ xml.url do
19
+ xml.loc url_for(page_url)
20
+ xml.lastmod page.updated_at.to_date
21
+ end if page_url.present? and page.show_in_menu?
22
+ end
20
23
  end
21
24
 
22
25
  end
@@ -1,3 +1,5 @@
1
+ require 'devise'
2
+
1
3
  # Use this hook to configure devise mailer, warden hooks and so forth. The first
2
4
  # four configuration values can also be set straight in your models.
3
5
  ::Devise.setup do |config|
data/lib/refinery/crud.rb CHANGED
@@ -2,20 +2,25 @@
2
2
  # Simply override any methods in your action controller you want to be customised
3
3
  # Don't forget to add:
4
4
  # resources :plural_model_name_here
5
+ # or for scoped:
6
+ # scope(:as => 'module_module', :module => 'module_name') do
7
+ # resources :plural_model_name_here
8
+ # end
5
9
  # to your routes.rb file.
6
10
  # Full documentation about CRUD and resources go here:
7
- # -> http://caboo.se/doc/classes/ActionController/Resources.html#M003716
11
+ # -> http://api.rubyonrails.org/classes/ActionDispatch/Routing/Mapper/Resources.html#method-i-resources
8
12
  # Example (add to your controller):
9
- # crudify :foo, {:title_attribute => 'name'}
13
+ # crudify :foo, {:title_attribute => 'name'} for CRUD on Foo model
14
+ # crudify 'foo/bar', :{title_attribute => 'name'} for CRUD on Foo::Bar model
10
15
 
11
16
  module Refinery
12
17
  module Crud
13
18
 
14
19
  def self.default_options(model_name)
15
- singular_name = model_name.to_s
16
- class_name = singular_name.camelize
17
- plural_name = singular_name.pluralize
20
+ class_name = model_name.to_s.include?("/") ? "::#{model_name.to_s.camelize}" : model_name.to_s.camelize
18
21
  this_class = class_name.constantize.base_class
22
+ singular_name = model_name.to_s.underscore.gsub("/","_")
23
+ plural_name = singular_name.pluralize
19
24
 
20
25
  {
21
26
  :conditions => '',
@@ -23,12 +28,15 @@ module Refinery
23
28
  :order => ('position ASC' if this_class.table_exists? and this_class.column_names.include?('position')),
24
29
  :paging => true,
25
30
  :per_page => false,
26
- :redirect_to_url => "admin_#{plural_name}_url",
31
+ :redirect_to_url => "admin_#{model_name.to_s.gsub('/', '_').pluralize}_url",
27
32
  :searchable => true,
28
33
  :search_conditions => '',
29
34
  :sortable => true,
30
35
  :title_attribute => "title",
31
- :xhr_paging => false
36
+ :xhr_paging => false,
37
+ :class_name => class_name,
38
+ :singular_name => singular_name,
39
+ :plural_name => plural_name
32
40
  }
33
41
  end
34
42
 
@@ -41,10 +49,9 @@ module Refinery
41
49
 
42
50
  def crudify(model_name, options = {})
43
51
  options = ::Refinery::Crud.default_options(model_name).merge(options)
44
-
45
- class_name = model_name.to_s.camelize
46
- singular_name = class_name.demodulize.underscore
47
- plural_name = singular_name.pluralize
52
+ class_name = options[:class_name]
53
+ singular_name = options[:singular_name]
54
+ plural_name = options[:plural_name]
48
55
 
49
56
  module_eval %(
50
57
  prepend_before_filter :find_#{singular_name},
@@ -132,9 +132,6 @@ namespace :refinery do
132
132
  desc "Un-crudify a method on a controller that uses crudify"
133
133
  task :uncrudify => :environment do
134
134
  if (model_name = ENV["model"]).present? and (action = ENV["action"]).present?
135
- class_name = model_name.to_s.camelize
136
- singular_name = class_name.demodulize.underscore
137
- plural_name = singular_name.pluralize
138
135
 
139
136
  crud_lines = Refinery.roots('core').join('lib', 'refinery', 'crud.rb').read
140
137
  if (matches = crud_lines.scan(/(\ +)(def #{action}.+?protected)/m).first).present? and
@@ -146,9 +143,9 @@ namespace :refinery do
146
143
  crud_method.gsub!('#{options[:redirect_to_url]}', default_crud_options[:redirect_to_url])
147
144
  crud_method.gsub!('#{options[:conditions].inspect}', default_crud_options[:conditions].inspect)
148
145
  crud_method.gsub!('#{options[:title_attribute]}', default_crud_options[:title_attribute])
149
- crud_method.gsub!('#{singular_name}', singular_name)
150
- crud_method.gsub!('#{class_name}', class_name)
151
- crud_method.gsub!('#{plural_name}', plural_name)
146
+ crud_method.gsub!('#{singular_name}', default_crud_options[:singular_name])
147
+ crud_method.gsub!('#{class_name}', default_crud_options[:class_name])
148
+ crud_method.gsub!('#{plural_name}', default_crud_options[:plural_name])
152
149
  crud_method.gsub!('\\#{', '#{')
153
150
 
154
151
  puts crud_method
@@ -1071,7 +1071,7 @@ ul#page_parts_controls img {
1071
1071
  }
1072
1072
  #page_part_editors {
1073
1073
  clear:left;
1074
- min-height: 446px;
1074
+ /* min-height: 446px;*/
1075
1075
  }
1076
1076
  a#toggle_advanced_options {
1077
1077
  background: url('/images/refinery/icons/page_white_gear.png') no-repeat 0px 3px;
@@ -2,10 +2,10 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{refinerycms-core}
5
- s.version = %q{0.9.9.17}
5
+ s.version = %q{0.9.9.18}
6
6
  s.summary = %q{Core engine for Refinery CMS}
7
7
  s.description = %q{The core of Refinery CMS. This handles the common functionality and is required by most engines}
8
- s.date = %q{2011-04-15}
8
+ s.date = %q{2011-04-16}
9
9
  s.email = %q{info@refinerycms.com}
10
10
  s.homepage = %q{http://refinerycms.com}
11
11
  s.rubyforge_project = %q{refinerycms}
@@ -14,14 +14,14 @@ Gem::Specification.new do |s|
14
14
  s.require_paths = %w(lib)
15
15
  s.executables = %w()
16
16
 
17
- s.add_dependency 'refinerycms-base', '= 0.9.9.17'
18
- s.add_dependency 'refinerycms-settings', '= 0.9.9.17'
17
+ s.add_dependency 'refinerycms-base', '= 0.9.9.18'
18
+ s.add_dependency 'refinerycms-settings', '= 0.9.9.18'
19
19
  s.add_dependency 'refinerycms-generators', '~> 1.0'
20
20
  s.add_dependency 'acts_as_indexed', '~> 0.7'
21
21
  s.add_dependency 'friendly_id_globalize3', '~> 3.2.1'
22
22
  s.add_dependency 'globalize3', '>= 0.1.0.beta'
23
23
  s.add_dependency 'moretea-awesome_nested_set', '~> 1.4'
24
- s.add_dependency 'rails', '~> 3.0.7.rc1'
24
+ s.add_dependency 'rails', '~> 3.0.7.rc2'
25
25
  s.add_dependency 'rdoc', '>= 2.5.11' # helps fix ubuntu
26
26
  s.add_dependency 'truncate_html', '~> 0.5'
27
27
  s.add_dependency 'will_paginate', '~> 3.0.pre'
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: refinerycms-core
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.9.9.17
5
+ version: 0.9.9.18
6
6
  platform: ruby
7
7
  authors:
8
8
  - Resolve Digital
@@ -13,7 +13,7 @@ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
15
 
16
- date: 2011-04-15 00:00:00 Z
16
+ date: 2011-04-16 00:00:00 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: refinerycms-base
@@ -23,7 +23,7 @@ dependencies:
23
23
  requirements:
24
24
  - - "="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.9.9.17
26
+ version: 0.9.9.18
27
27
  type: :runtime
28
28
  version_requirements: *id001
29
29
  - !ruby/object:Gem::Dependency
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - "="
36
36
  - !ruby/object:Gem::Version
37
- version: 0.9.9.17
37
+ version: 0.9.9.18
38
38
  type: :runtime
39
39
  version_requirements: *id002
40
40
  - !ruby/object:Gem::Dependency
@@ -100,7 +100,7 @@ dependencies:
100
100
  requirements:
101
101
  - - ~>
102
102
  - !ruby/object:Gem::Version
103
- version: 3.0.7.rc1
103
+ version: 3.0.7.rc2
104
104
  type: :runtime
105
105
  version_requirements: *id008
106
106
  - !ruby/object:Gem::Dependency