refinerycms-multisite 0.0.6 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -43,7 +43,7 @@ module Refinery
43
43
  module InstanceMethods
44
44
  end
45
45
  end
46
-
46
+
47
47
  module SiteModelClassMethods
48
48
  #include ActiveRecord
49
49
 
@@ -53,7 +53,17 @@ end
53
53
  module PagesControllerSite
54
54
  def home_with_site
55
55
  if (@site)
56
- error_404 unless (@page = Page.find(@site.page_id)).present?
56
+ @page = Page.find(@site.page_id)
57
+ if @page.try(:live?) || (refinery_user? && current_user.authorized_plugins.include?("refinery_pages"))
58
+ # if the admin wants this to be a "placeholder" page which goes to its first child, go to that instead.
59
+ if @page.skip_to_first_child && (first_live_child = @page.children.order('lft ASC').live.first).present?
60
+ redirect_to first_live_child.url
61
+ elsif @page.link_url.present?
62
+ redirect_to @page.link_url and return
63
+ end
64
+ else
65
+ error_404
66
+ end
57
67
  else
58
68
  home_without_site
59
69
  end
@@ -1,5 +1,5 @@
1
1
  module Refinerycms
2
2
  module Multisite
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-multisite
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 8
10
+ version: 0.0.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Andreas K\xC3\xB6nig"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-26 00:00:00 +02:00
18
+ date: 2011-05-28 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  requirements: []
145
145
 
146
146
  rubyforge_project: refinerycms-multisite
147
- rubygems_version: 1.6.2
147
+ rubygems_version: 1.4.2
148
148
  signing_key:
149
149
  specification_version: 3
150
150
  summary: Multisite-Plugin for Refinery-CMS