spontaneous 0.2.0.beta3 → 0.2.0.beta4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spontaneous/rack/back/preview.rb +9 -1
- data/lib/spontaneous/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcffa3a2465a357c8da162aa93e300adc675e0dc
|
4
|
+
data.tar.gz: 097ea8f7351a8dee830bb7226b9cc408f8b8b730
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfda80067874f9daae5d505b7d06b579f5e775b40e1c42c5d40043edea73d249049a8bb83dc2290f59ff9836c2f2676e46b98609270b932cabf992436f2b8499
|
7
|
+
data.tar.gz: f35b32a7e205fbc4148c65d0add2b08766d51489415b1f37ba709a8ba5be10591aaa5fea739fd0b47be6ee63257c278238ace7e9df219e2eab8629ee4f7ac213
|
@@ -14,8 +14,16 @@ module Spontaneous::Rack::Back
|
|
14
14
|
# Redirect to the edit UI if a preview page is being accessed directly
|
15
15
|
def ensure_edit_preview(path)
|
16
16
|
referer = env['HTTP_REFERER']
|
17
|
-
|
17
|
+
development_preview = Spontaneous.development? && Content::Page.has_root?
|
18
|
+
return true if development_preview || referer || params.key?('preview')
|
18
19
|
home = find_page_by_path(path)
|
20
|
+
# Need to handle the site initialisation where there is no homepage
|
21
|
+
# so we want to force a load of the CMS to offer up the 'add home'
|
22
|
+
# dialogue
|
23
|
+
if home.nil?
|
24
|
+
redirect NAMESPACE
|
25
|
+
return false
|
26
|
+
end
|
19
27
|
redirect "#{NAMESPACE}/#{home.id}/preview"
|
20
28
|
false
|
21
29
|
end
|
data/lib/spontaneous/version.rb
CHANGED