ecm_cms 0.0.5.pre → 0.0.6.pre

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ class Ecm::Cms::PageController < ApplicationController
3
3
  include RailsTools::I18nController
4
4
 
5
5
  # add the page resolver
6
- append_view_path Ecm::Cms::PageResolver.instance unless view_paths.include?(Ecm::Cms::PageResolver.instance)
6
+ include Ecm::Cms::ControllerExtensions::PageResolver
7
7
 
8
8
  def respond
9
9
  render :template => params[:page]
@@ -0,0 +1,13 @@
1
+ module Ecm
2
+ module Cms
3
+ module ControllerExtensions
4
+ module PageResolver
5
+ def self.included(base)
6
+ # add the page resolver
7
+ base.append_view_path ::Ecm::Cms::PageResolver.instance unless base.view_paths.include?(::Ecm::Cms::PageResolver.instance)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+
@@ -0,0 +1,13 @@
1
+ module Ecm
2
+ module Cms
3
+ module ControllerExtensions
4
+ module PartialResolver
5
+ def self.included(base)
6
+ # add the partial resolver
7
+ base.append_view_path ::Ecm::Cms::PartialResolver.instance unless base.view_paths.include?(::Ecm::Cms::PartialResolver.instance)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+
@@ -0,0 +1,13 @@
1
+ module Ecm
2
+ module Cms
3
+ module ControllerExtensions
4
+ module TemplateResolver
5
+ def self.included(base)
6
+ # add the template resolver
7
+ base.append_view_path ::Ecm::Cms::TemplateResolver.instance unless base.view_paths.include?(::Ecm::Cms::TemplateResolver.instance)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+
@@ -16,8 +16,10 @@ module Ecm
16
16
  base.after_save :clear_resolver_cache
17
17
 
18
18
  # validations
19
+ # base.validates :basename, :presence => true,
20
+ # :uniqueness => { :scope => [:ecm_cms_folder_id , :locale] }
19
21
  base.validates :basename, :presence => true,
20
- :uniqueness => { :scope => [:ecm_cms_folder_id , :locale] }
22
+ :uniqueness => { :scope => [ :pathname, :locale, :format, :handler ] }
21
23
  base.validates :handler, :inclusion => ActionView::Template::Handlers.extensions.map(&:to_s)
22
24
  base.validates :locale, :inclusion => I18n.available_locales.map(&:to_s),
23
25
  :allow_nil => true,
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Cms
3
- VERSION = "0.0.5.pre"
3
+ VERSION = "0.0.6.pre"
4
4
  end
5
5
  end
data/lib/ecm_cms.rb CHANGED
@@ -20,6 +20,10 @@ require 'ecm/cms/resolvers/ecm/cms/page_resolver'
20
20
  require 'ecm/cms/resolvers/ecm/cms/template_resolver'
21
21
  require 'ecm/cms/resolvers/ecm/cms/partial_resolver'
22
22
 
23
+ require 'ecm/cms/controller_extensions/page_resolver'
24
+ require 'ecm/cms/controller_extensions/partial_resolver'
25
+ require 'ecm/cms/controller_extensions/template_resolver'
26
+
23
27
  ::ActionView::Template.register_template_handler :textile, ::ActionView::Template::Handlers::Textile.new
24
28
 
25
29
  module Ecm
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_cms
3
3
  version: !ruby/object:Gem::Version
4
- hash: 961915984
4
+ hash: 961915996
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
9
+ - 6
10
10
  - pre
11
- version: 0.0.5.pre
11
+ version: 0.0.6.pre
12
12
  platform: ruby
13
13
  authors:
14
14
  - Roberto Vasquez Angel
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-12-06 00:00:00 Z
19
+ date: 2012-12-08 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rails
@@ -419,6 +419,9 @@ files:
419
419
  - lib/ecm/cms/engine.rb
420
420
  - lib/ecm/cms/version.rb
421
421
  - lib/ecm/cms/routing.rb
422
+ - lib/ecm/cms/controller_extensions/page_resolver.rb
423
+ - lib/ecm/cms/controller_extensions/template_resolver.rb
424
+ - lib/ecm/cms/controller_extensions/partial_resolver.rb
422
425
  - lib/ecm/cms/importers/navigation_item.rb
423
426
  - lib/ecm/cms/importers/navigation.rb
424
427
  - lib/ecm/cms/importers/page.rb