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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d327e71c9f7ef6a229475b92d7a9c24ad7a77ccf
4
- data.tar.gz: 9f6803a4470abd5de575fb5b318774a444b8ac3c
3
+ metadata.gz: dcffa3a2465a357c8da162aa93e300adc675e0dc
4
+ data.tar.gz: 097ea8f7351a8dee830bb7226b9cc408f8b8b730
5
5
  SHA512:
6
- metadata.gz: 7e87bc4e0fad263152412de36f2e62f218b962744404ca9aa1110150f528851f8c94e601a42cb8dc4dcb24fbe02e4d0a3bd32bc2920b791a807362958ecba193
7
- data.tar.gz: 8ae23b7eacbfb56dd35336c59c6ddb2a0a4b25ce48c691bff5661e06fd8b2af5393cf639a4a37e64411d09fb08edc3e375e62c626e1902defdb521d18f4a0dce
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
- return true if Spontaneous.development? || referer || params.key?('preview')
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
@@ -1,6 +1,6 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module Spontaneous
4
- VERSION = "0.2.0.beta3"
4
+ VERSION = "0.2.0.beta4"
5
5
  GEM = false
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spontaneous
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.beta3
4
+ version: 0.2.0.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garry Hill