refinerycms-pages 0.9.9.10 → 0.9.9.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,7 +34,7 @@ jp:
34
34
  reserved_system_word: "このタイトルはシステム用ですので使用出来ません。"
35
35
  page:
36
36
  view_live_html: "このページを表示する<br/><em>(新しいウィンドウが開きます)</em>"
37
- hidden: 隠す
37
+ hidden: 非表示
38
38
  draft: 準備稿
39
39
  form_new_page_parts:
40
40
  title: タイトル
@@ -5,6 +5,6 @@ end
5
5
  # Add any parts of routes as reserved words.
6
6
  if Page.use_marketable_urls?
7
7
  Page.friendly_id_config.reserved_words |= ::Refinery::Application.routes.named_routes.map { |name, route|
8
- route.path.gsub(/^\//, '').to_s.split('(').first.split(':').first.to_s.split('/')
8
+ route.path.gsub(/^\//, '').to_s.split('(').first.to_s.split(':').first.to_s.split('/')
9
9
  }.flatten.reject{|w| w =~ /\_/}.uniq
10
10
  end
@@ -0,0 +1,37 @@
1
+ module Refinery
2
+ module Pages
3
+ module InstanceMethods
4
+
5
+ def error_404(exception=nil)
6
+ if (@page = Page.where(:menu_match => "^/404$").includes(:parts, :slugs).first).present?
7
+ # render the application's custom 404 page with layout and meta.
8
+ render :template => "/pages/show",
9
+ :format => 'html',
10
+ :status => 404
11
+ else
12
+ super
13
+ end
14
+ end
15
+
16
+ protected
17
+ def find_pages_for_menu
18
+ @menu_pages = Page.in_menu.live.order('lft ASC').includes(:slugs)
19
+ end
20
+
21
+ def render(*args)
22
+ present(@page) unless admin? or @meta.present?
23
+ super
24
+ end
25
+
26
+ private
27
+ def store_current_location!
28
+ unless admin?
29
+ session[:website_return_to] = @page.url if @page.try(:present?)
30
+ else
31
+ super
32
+ end
33
+ end
34
+
35
+ end
36
+ end
37
+ end
@@ -5,6 +5,8 @@ require 'globalize3'
5
5
  module Refinery
6
6
  module Pages
7
7
 
8
+ autoload :InstanceMethods, File.expand_path('../refinery/pages/instance_methods', __FILE__)
9
+
8
10
  class << self
9
11
  attr_accessor :root
10
12
  def root
@@ -13,7 +15,6 @@ module Refinery
13
15
  end
14
16
 
15
17
  class Engine < ::Rails::Engine
16
-
17
18
  initializer "serve static assets" do |app|
18
19
  app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public"
19
20
  end
@@ -22,6 +23,10 @@ module Refinery
22
23
  require File.expand_path('../pages/tabs', __FILE__)
23
24
  end
24
25
 
26
+ refinery.on_attach do
27
+ ::ApplicationController.send :include, ::Refinery::Pages::InstanceMethods
28
+ end
29
+
25
30
  config.after_initialize do
26
31
  ::Refinery::Plugin.register do |plugin|
27
32
  plugin.name = "refinery_pages"
@@ -2,10 +2,10 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{refinerycms-pages}
5
- s.version = %q{0.9.9.10}
5
+ s.version = %q{0.9.9.11}
6
6
  s.summary = %q{Pages engine for Refinery CMS}
7
7
  s.description = %q{The default content engine of Refinery CMS. This engine handles the administration and display of user-editable pages.}
8
- s.date = %q{2011-03-17}
8
+ s.date = %q{2011-03-25}
9
9
  s.email = %q{info@refinerycms.com}
10
10
  s.homepage = %q{http://refinerycms.com}
11
11
  s.rubyforge_project = %q{refinerycms}
@@ -103,6 +103,9 @@ Gem::Specification.new do |s|
103
103
  'lib/pages',
104
104
  'lib/pages/marketable_routes.rb',
105
105
  'lib/pages/tabs.rb',
106
+ 'lib/refinery',
107
+ 'lib/refinery/pages',
108
+ 'lib/refinery/pages/instance_methods.rb',
106
109
  'lib/refinerycms-pages.rb',
107
110
  'license.md',
108
111
  'refinerycms-pages.gemspec',
@@ -111,5 +114,5 @@ Gem::Specification.new do |s|
111
114
  'spec/models/page_spec.rb'
112
115
  ]
113
116
 
114
- s.add_dependency 'refinerycms-core', '~> 0.9.9.10'
117
+ s.add_dependency 'refinerycms-core', '~> 0.9.9.11'
115
118
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: refinerycms-pages
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.9.9.10
5
+ version: 0.9.9.11
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-03-17 00:00:00 +13:00
16
+ date: 2011-03-25 00:00:00 +13:00
17
17
  default_executable:
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
@@ -24,7 +24,7 @@ dependencies:
24
24
  requirements:
25
25
  - - ~>
26
26
  - !ruby/object:Gem::Version
27
- version: 0.9.9.10
27
+ version: 0.9.9.11
28
28
  type: :runtime
29
29
  version_requirements: *id001
30
30
  description: The default content engine of Refinery CMS. This engine handles the administration and display of user-editable pages.
@@ -102,6 +102,7 @@ files:
102
102
  - lib/generators/refinerycms_pages_generator.rb
103
103
  - lib/pages/marketable_routes.rb
104
104
  - lib/pages/tabs.rb
105
+ - lib/refinery/pages/instance_methods.rb
105
106
  - lib/refinerycms-pages.rb
106
107
  - license.md
107
108
  - refinerycms-pages.gemspec