refinerycms-pages 3.0.4 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/app/controllers/refinery/pages_controller.rb +6 -2
- data/app/views/refinery/admin/pages/_form.html.erb +1 -1
- data/config/locales/fr.yml +4 -2
- data/db/seeds.rb +1 -1
- data/lib/refinery/pages/configuration.rb +1 -1
- data/spec/features/refinery/pages_spec.rb +24 -0
- data.tar.gz.sig +1 -2
- metadata +5 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e66573e24ded851715eb030ec7e56c42c7d5fcba
|
4
|
+
data.tar.gz: a5e7e009811a415a95e5911fcf739d32d3d77151
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11f6602c5142b8d36d9663d81d4af8cb99e85c57964b76315dd1c0d49a64ac4d3ff0b2273377ae042e29f77cc31cb54ecd9c5dd5449dada00b332c38fd90d24f
|
7
|
+
data.tar.gz: 9583d10fff14df271d377f178e3d5763ef4177ec7218888c86227a43fad848f2dec191380c93b423ae04496d20bc9678e1b05d05db8145996997fb0fe494b988
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -3,7 +3,7 @@ module Refinery
|
|
3
3
|
include Pages::RenderOptions
|
4
4
|
|
5
5
|
before_action :find_page, :set_canonical
|
6
|
-
before_action :error_404, :
|
6
|
+
before_action :error_404, unless: :current_user_can_view_page?
|
7
7
|
|
8
8
|
# Save whole Page after delivery
|
9
9
|
after_action :write_cache?
|
@@ -60,9 +60,13 @@ module Refinery
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def current_user_can_view_page?
|
63
|
-
page.live? ||
|
63
|
+
page.live? || current_refinery_user_can_access?("refinery_pages")
|
64
64
|
end
|
65
65
|
|
66
|
+
def current_refinery_user_can_access?(plugin)
|
67
|
+
admin? && authorisation_manager.allow?(:plugin, plugin)
|
68
|
+
end
|
69
|
+
|
66
70
|
def first_live_child
|
67
71
|
page.children.order('lft ASC').live.first
|
68
72
|
end
|
@@ -44,7 +44,7 @@
|
|
44
44
|
, "<%= refinery.admin_page_parts_path %>"
|
45
45
|
);
|
46
46
|
|
47
|
-
$(
|
47
|
+
$(document).on('click', '#preview-button', function(e) {
|
48
48
|
var $form = $(this).parents('form');
|
49
49
|
var prev_url = $form.attr('action');
|
50
50
|
var prev_target = $form.attr('target') || '';
|
data/config/locales/fr.yml
CHANGED
@@ -37,9 +37,11 @@ fr:
|
|
37
37
|
new: Ajouter une nouvelle sous-page
|
38
38
|
expand_collapse: Développer ou réduire les sous-pages
|
39
39
|
page:
|
40
|
-
view_live_html: Voir cette page<br/><em>(Ouvre une nouvelle fenêtre)</em>
|
41
|
-
hidden: caché
|
42
40
|
draft: brouillon
|
41
|
+
hidden: caché
|
42
|
+
redirected: redirigé
|
43
|
+
skip_to_first_child: redirigé vers 1er enfant
|
44
|
+
view_live_html: Voir cette page<br/><em>(Ouvre une nouvelle fenêtre)</em>
|
43
45
|
form:
|
44
46
|
preview: Prévisualiser
|
45
47
|
preview_changes: Prévisualiser vos changements avant de les appliquer
|
data/db/seeds.rb
CHANGED
@@ -25,7 +25,7 @@ if Refinery::Page.where(menu_match: "^/$").empty?
|
|
25
25
|
)
|
26
26
|
page_not_found_page.parts.create(
|
27
27
|
title: "Body",
|
28
|
-
body:
|
28
|
+
body: '<h2>Sorry, there was a problem...</h2><p>The page you requested was not found.</p><p><a href="/">Return to the home page</a></p>',
|
29
29
|
position: 0
|
30
30
|
)
|
31
31
|
|
@@ -24,7 +24,7 @@ module Refinery
|
|
24
24
|
self.layout_template_whitelist = ["application"]
|
25
25
|
self.add_whitelist_elements = %w[ source track ]
|
26
26
|
# Note: "data-" attributes are whitelisted by default. See https://github.com/refinery/refinerycms/pull/3187
|
27
|
-
self.add_whitelist_attributes = %w[ kind srclang placeholder controls ]
|
27
|
+
self.add_whitelist_attributes = %w[ kind srclang placeholder controls required ]
|
28
28
|
|
29
29
|
|
30
30
|
class << self
|
@@ -336,6 +336,30 @@ module Refinery
|
|
336
336
|
end
|
337
337
|
end
|
338
338
|
end
|
339
|
+
|
340
|
+
describe 'when draft is set to true' do
|
341
|
+
before { allow_any_instance_of(PagesController).to receive(:find_page).and_return(:draft_page) }
|
342
|
+
|
343
|
+
describe 'for vistor' do
|
344
|
+
it 'redirect to the 404 error page' do
|
345
|
+
allow_any_instance_of(PagesController).to receive(:current_refinery_user_can_access?).and_return(false)
|
346
|
+
|
347
|
+
visit refinery.page_path(draft_page)
|
348
|
+
|
349
|
+
expect(page).to have_http_status(404)
|
350
|
+
end
|
351
|
+
end
|
352
|
+
|
353
|
+
describe 'for admin' do
|
354
|
+
it 'displays draft page message not live' do
|
355
|
+
allow_any_instance_of(PagesController).to receive(:current_refinery_user_can_access?).and_return(true)
|
356
|
+
|
357
|
+
visit refinery.page_path(draft_page)
|
358
|
+
|
359
|
+
expect(page).to have_content(::I18n.t('refinery.draft_page_message.not_live'))
|
360
|
+
end
|
361
|
+
end
|
362
|
+
end
|
339
363
|
end
|
340
364
|
|
341
365
|
context "with multiple locales" do
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
xU�ꭙc�3����\��$��u&���+Pե#i�ua��g�GL��F�Z�� V��S���r)�Sb�n��[��!�3W.oɸ�m��"��9�x
|
1
|
+
o�6IҞ�
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philip Arndt
|
@@ -32,7 +32,7 @@ cert_chain:
|
|
32
32
|
+wsbjPvdIWsjWQMn6MasZYIVTnenwP2jg+z9HSNxW0NL2vZx8VabpsWGWfrb+koj
|
33
33
|
rE1h12GTgwaC3r9FOkdnSpClgPYAzTTCJ8kD74qO2zC9pGegrUXdWFM6
|
34
34
|
-----END CERTIFICATE-----
|
35
|
-
date: 2016-
|
35
|
+
date: 2016-11-23 00:00:00.000000000 Z
|
36
36
|
dependencies:
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: friendly_id
|
@@ -108,14 +108,14 @@ dependencies:
|
|
108
108
|
requirements:
|
109
109
|
- - '='
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: 3.0.
|
111
|
+
version: 3.0.5
|
112
112
|
type: :runtime
|
113
113
|
prerelease: false
|
114
114
|
version_requirements: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
116
|
- - '='
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: 3.0.
|
118
|
+
version: 3.0.5
|
119
119
|
- !ruby/object:Gem::Dependency
|
120
120
|
name: babosa
|
121
121
|
requirement: !ruby/object:Gem::Requirement
|
@@ -302,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
302
302
|
version: '0'
|
303
303
|
requirements: []
|
304
304
|
rubyforge_project: refinerycms
|
305
|
-
rubygems_version: 2.
|
305
|
+
rubygems_version: 2.5.2
|
306
306
|
signing_key:
|
307
307
|
specification_version: 4
|
308
308
|
summary: Pages extension for Refinery CMS
|
metadata.gz.sig
CHANGED
Binary file
|