refinerycms-pages 4.0.1 → 4.0.2
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.tar.gz.sig +0 -0
- data/app/controllers/refinery/admin/page_parts_controller.rb +5 -1
- data/app/controllers/refinery/admin/pages_controller.rb +10 -2
- data/app/models/refinery/page.rb +9 -2
- data/app/views/refinery/admin/pages/_form.html.erb +27 -17
- data/app/views/refinery/admin/pages/_page.html.erb +4 -3
- data/app/views/refinery/admin/pages/_sortable_list.html.erb +5 -4
- data/app/views/refinery/admin/pages/children.html.erb +1 -1
- data/db/migrate/20140105190324_add_custom_slug_to_refinery_pages.rb +4 -9
- data/db/migrate/20180316032602_add_children_count_to_refinery_pages.rb +5 -0
- data/lib/generators/refinery/pages/templates/config/initializers/refinery/pages.rb.erb +1 -1
- data/lib/refinery/pages.rb +1 -1
- data/lib/refinery/pages/type.rb +15 -0
- data/refinerycms-pages.gemspec +1 -1
- data/spec/controllers/refinery/admin/pages_controller_spec.rb +6 -0
- data/spec/controllers/refinery/pages_controller_spec.rb +2 -2
- data/spec/factories/page_parts.rb +1 -1
- data/spec/factories/pages.rb +2 -2
- data/spec/features/refinery/admin/pages_spec.rb +24 -0
- data/spec/features/refinery/pages_spec.rb +26 -7
- data/spec/helpers/refinery/pages/admin/pages_helper_spec.rb +6 -6
- data/spec/lib/pages_spec.rb +20 -0
- data/spec/lib/refinery/pages/type_spec.rb +30 -0
- data/spec/models/refinery/page_finder_spec.rb +1 -1
- data/spec/models/refinery/page_url_spec.rb +1 -1
- data/spec/presenters/refinery/pages/menu_presenter_spec.rb +4 -4
- metadata +8 -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: '09bcb164f233eb9e0139cec096762c44bdb0633a'
|
4
|
+
data.tar.gz: 663a3ed2390bf1f68b828000655a780c70755cfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99fb3481b27dce69ceec963ac413f1c9ee15216a6d6a4de818597d94c43d5b3b84df0ac1f40d254c79a22830093c5927c94f1a55679be77cf1f4618e9684c8cb
|
7
|
+
data.tar.gz: aeb2b2af427ea62b1dece0f277c97bda0c50cc68bd4781a1a2221baba45faa7d5695e72483552ce13a7ac8bf09e21a6b69c1b95465432c56012d84f27fff37c3
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
@@ -23,9 +23,13 @@ module Refinery
|
|
23
23
|
|
24
24
|
protected
|
25
25
|
def new_page_part_params
|
26
|
-
params.except(:part_index).permit(
|
26
|
+
params.except(:part_index).permit(permitted_new_page_part_params)
|
27
27
|
end
|
28
28
|
|
29
|
+
private
|
30
|
+
def permitted_new_page_part_params
|
31
|
+
[:title, :slug, :body, :locale]
|
32
|
+
end
|
29
33
|
end
|
30
34
|
end
|
31
35
|
end
|
@@ -91,7 +91,7 @@ module Refinery
|
|
91
91
|
end
|
92
92
|
|
93
93
|
def new_page_params
|
94
|
-
params.permit(
|
94
|
+
params.permit(permitted_new_page_params)
|
95
95
|
end
|
96
96
|
|
97
97
|
private
|
@@ -100,10 +100,18 @@ module Refinery
|
|
100
100
|
[
|
101
101
|
:browser_title, :draft, :link_url, :menu_title, :meta_description,
|
102
102
|
:parent_id, :skip_to_first_child, :show_in_menu, :title, :view_template,
|
103
|
-
:layout_template, :custom_slug, parts_attributes:
|
103
|
+
:layout_template, :custom_slug, parts_attributes: permitted_parts_attributes_params
|
104
104
|
]
|
105
105
|
end
|
106
106
|
|
107
|
+
def permitted_parts_attributes_params
|
108
|
+
[:id, :title, :slug, :body, :position]
|
109
|
+
end
|
110
|
+
|
111
|
+
def permitted_new_page_params
|
112
|
+
[:parent_id, :view_template, :layout_template]
|
113
|
+
end
|
114
|
+
|
107
115
|
def save_and_continue_locals(page)
|
108
116
|
nested_url = page.nested_url
|
109
117
|
{
|
data/app/models/refinery/page.rb
CHANGED
@@ -55,7 +55,7 @@ module Refinery
|
|
55
55
|
|
56
56
|
# Docs for acts_as_nested_set https://github.com/collectiveidea/awesome_nested_set
|
57
57
|
# rather than :delete_all we want :destroy
|
58
|
-
acts_as_nested_set :dependent
|
58
|
+
acts_as_nested_set counter_cache: :children_count, dependent: :destroy, touch: true
|
59
59
|
|
60
60
|
friendly_id :custom_slug_or_title, FriendlyIdOptions.options
|
61
61
|
|
@@ -73,6 +73,9 @@ module Refinery
|
|
73
73
|
before_destroy :deletable?
|
74
74
|
after_save :reposition_parts!
|
75
75
|
|
76
|
+
after_save :update_all_descendants
|
77
|
+
after_move :update_all_descendants
|
78
|
+
|
76
79
|
class << self
|
77
80
|
# Live pages are 'allowed' to be shown in the frontend of your website.
|
78
81
|
# By default, this is all pages that are not set as 'draft'.
|
@@ -378,11 +381,15 @@ module Refinery
|
|
378
381
|
def slug_locale
|
379
382
|
return Globalize.locale if translation_for(Globalize.locale, false).try(:slug).present?
|
380
383
|
|
381
|
-
if translations.empty? || translation_for(Refinery::I18n.default_frontend_locale, false).present?
|
384
|
+
if translations.empty? || translation_for(Refinery::I18n.default_frontend_locale, false).try(:slug).present?
|
382
385
|
Refinery::I18n.default_frontend_locale
|
383
386
|
else
|
384
387
|
translations.first.locale
|
385
388
|
end
|
386
389
|
end
|
390
|
+
|
391
|
+
def update_all_descendants
|
392
|
+
self.descendants.map(&:touch)
|
393
|
+
end
|
387
394
|
end
|
388
395
|
end
|
@@ -18,19 +18,20 @@
|
|
18
18
|
|
19
19
|
<%= render 'form_advanced_options', :f => f %>
|
20
20
|
|
21
|
-
<%= render '/refinery/admin/form_actions', :
|
22
|
-
:
|
23
|
-
:
|
24
|
-
:
|
25
|
-
:
|
21
|
+
<%= render '/refinery/admin/form_actions', f: f,
|
22
|
+
continue_editing: true,
|
23
|
+
delete_title: t('delete', scope: 'refinery.admin.pages'),
|
24
|
+
delete_confirmation: t('message', scope: 'refinery.admin.delete', title: @page.title),
|
25
|
+
before_cancel_button: submit_tag(
|
26
26
|
t('.preview'),
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
30
|
-
:
|
31
|
-
:
|
27
|
+
id: 'preview-button',
|
28
|
+
title: 'Preview page',
|
29
|
+
name: nil,
|
30
|
+
class: 'wymupdate button',
|
31
|
+
tooltip: t('.preview_changes'),
|
32
|
+
data: { disable_with: false }
|
32
33
|
),
|
33
|
-
:
|
34
|
+
cancel_url: refinery.admin_pages_path %>
|
34
35
|
|
35
36
|
<%= render 'form_new_page_parts', :f => f if Refinery::Pages.new_page_parts %>
|
36
37
|
<% end %>
|
@@ -44,17 +45,26 @@
|
|
44
45
|
, "<%= refinery.admin_page_parts_path %>"
|
45
46
|
);
|
46
47
|
|
47
|
-
$(
|
48
|
+
$( '#preview-button' ).on( 'click', function(e) {
|
49
|
+
e.preventDefault();
|
50
|
+
|
48
51
|
var $form = $(this).parents('form');
|
49
52
|
var prev_url = $form.attr('action');
|
50
53
|
var prev_target = $form.attr('target') || '';
|
54
|
+
|
51
55
|
$form.attr({
|
52
|
-
|
53
|
-
|
54
|
-
})
|
56
|
+
action: '<%= @page.persisted? ? refinery.pages_admin_preview_page_path(@page.nested_url) : refinery.pages_admin_preview_pages_path %>',
|
57
|
+
target: '_blank'
|
58
|
+
})
|
59
|
+
|
55
60
|
$form.submit();
|
56
|
-
|
57
|
-
|
61
|
+
|
62
|
+
setTimeout(function(){
|
63
|
+
$form.attr({
|
64
|
+
action: prev_url,
|
65
|
+
target: prev_target
|
66
|
+
});
|
67
|
+
}, 100);
|
58
68
|
});
|
59
69
|
});
|
60
70
|
</script>
|
@@ -46,7 +46,8 @@
|
|
46
46
|
<%= action_icon(:delete, delete_url, t('delete', scope: 'refinery.admin.pages' ), delete_options ) if page.deletable? %>
|
47
47
|
</span>
|
48
48
|
</div>
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
|
50
|
+
<%= content_tag :ul, class: 'nested', data: { 'ajax-content': refinery.admin_children_pages_path(page.nested_url) } do %>
|
51
|
+
<%= render(partial: 'page', collection: page.children, cached: true) if Refinery::Pages.auto_expand_admin_tree %>
|
52
|
+
<% end %>
|
52
53
|
</li>
|
@@ -1,4 +1,5 @@
|
|
1
|
-
|
2
|
-
<%= render :
|
3
|
-
|
4
|
-
|
1
|
+
<%= content_tag :ul, id: 'sortable_list' do %>
|
2
|
+
<%= render partial: 'page', collection: @pages.roots, cached: true %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<%= render '/refinery/admin/sortable_list', continue_reordering: !!local_assigns[:continue_reordering] %>
|
@@ -1 +1 @@
|
|
1
|
-
<%= render :
|
1
|
+
<%= render partial: 'page', collection: @page.children, cached: true %>
|
@@ -1,20 +1,15 @@
|
|
1
1
|
class AddCustomSlugToRefineryPages < ActiveRecord::Migration[4.2]
|
2
2
|
def up
|
3
|
-
|
4
|
-
add_column :refinery_pages, :custom_slug, :string
|
5
|
-
end
|
3
|
+
add_column :refinery_pages, :custom_slug, :string unless custom_slug_exists?
|
6
4
|
end
|
7
5
|
|
8
6
|
def down
|
9
|
-
if
|
10
|
-
remove_column :refinery_pages, :custom_slug
|
11
|
-
end
|
7
|
+
remove_column :refinery_pages, :custom_slug if custom_slug_exists?
|
12
8
|
end
|
13
9
|
|
14
10
|
private
|
15
|
-
def page_column_names
|
16
|
-
return [] unless defined?(::Refinery::Page)
|
17
11
|
|
18
|
-
|
12
|
+
def custom_slug_exists?
|
13
|
+
column_exists?(:refinery_pages, :custom_slug)
|
19
14
|
end
|
20
15
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
Refinery::Pages.configure do |config|
|
3
3
|
# Configure specific page templates
|
4
4
|
# config.types.register :home do |home|
|
5
|
-
# home.parts =
|
5
|
+
# home.parts = [{slug: "intro", title: "Intro"}, {slug: "body", title: "Body}]
|
6
6
|
# end
|
7
7
|
|
8
8
|
# Configure global page default parts
|
data/lib/refinery/pages.rb
CHANGED
data/lib/refinery/pages/type.rb
CHANGED
@@ -4,6 +4,21 @@ module Refinery
|
|
4
4
|
|
5
5
|
attr_accessor :name, :parts, :template
|
6
6
|
|
7
|
+
def parts=(new_parts)
|
8
|
+
@parts = if new_parts.all? { |v| v.is_a?(String) }
|
9
|
+
new_syntax = new_parts.map do |part|
|
10
|
+
{ title: part, slug: part.downcase.gsub(" ", "_") }
|
11
|
+
end
|
12
|
+
Refinery.deprecate(
|
13
|
+
"Change specific page template page parts from #{new_parts} to #{new_syntax}",
|
14
|
+
when: "4.1.0"
|
15
|
+
)
|
16
|
+
new_syntax
|
17
|
+
else
|
18
|
+
new_parts
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
7
22
|
def parts
|
8
23
|
@parts ||= []
|
9
24
|
end
|
data/refinerycms-pages.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.summary = %q{Pages extension for Refinery CMS}
|
11
11
|
s.description = %q{The default content extension of Refinery CMS. This extension handles the administration and display of user-editable pages.}
|
12
12
|
s.email = %q{refinerycms@p.arndt.io}
|
13
|
-
s.homepage = %q{
|
13
|
+
s.homepage = %q{https://www.refinerycms.com}
|
14
14
|
s.rubyforge_project = %q{refinerycms}
|
15
15
|
s.authors = ['Philip Arndt', 'Uģis Ozols', 'Rob Yurkowski']
|
16
16
|
s.license = %q{MIT}
|
@@ -4,6 +4,12 @@ module Refinery
|
|
4
4
|
module Admin
|
5
5
|
describe PagesController, type: :controller do
|
6
6
|
|
7
|
+
describe "with view template" do
|
8
|
+
before { Refinery::Pages::Types.register("show") { |type| type.parts = Refinery::Pages.default_parts } }
|
9
|
+
after { Refinery::Pages::Types.registered.delete(Refinery::Pages::Types.registered.find_by_name("show")) }
|
10
|
+
it { expect(get(:new, params: { view_template: "show" })).to be_ok }
|
11
|
+
end
|
12
|
+
|
7
13
|
describe "valid templates" do
|
8
14
|
before do
|
9
15
|
File.write(Rails.root.join('tmp', 'abc.html.erb'), '')
|
@@ -3,8 +3,8 @@ require "spec_helper"
|
|
3
3
|
module Refinery
|
4
4
|
describe PagesController, :type => :controller do
|
5
5
|
before do
|
6
|
-
|
7
|
-
|
6
|
+
FactoryBot.create(:page, :link_url => "/")
|
7
|
+
FactoryBot.create(:page, :title => "test")
|
8
8
|
end
|
9
9
|
|
10
10
|
describe "#home" do
|
data/spec/factories/pages.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
|
1
|
+
FactoryBot.define do
|
2
2
|
factory :page, class: Refinery::Page do
|
3
3
|
sequence(:title, "a") { |n| "Test title #{n}" }
|
4
4
|
|
5
5
|
factory :page_with_page_part do
|
6
6
|
after(:create) do |page|
|
7
|
-
page.parts <<
|
7
|
+
page.parts << FactoryBot.build(:page_part)
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -327,6 +327,30 @@ module Refinery
|
|
327
327
|
window.close
|
328
328
|
end
|
329
329
|
|
330
|
+
# Regression test for save-and_continue after previewing
|
331
|
+
# https://github.com/refinery/refinerycms/issues/3328
|
332
|
+
it 'will save-and-continue after show the preview in a new window' do
|
333
|
+
visit refinery.admin_pages_path
|
334
|
+
|
335
|
+
find('a[tooltip^=Edit]').click
|
336
|
+
fill_in "Title", :with => "Save this"
|
337
|
+
|
338
|
+
window = window_opened_by do
|
339
|
+
click_button "Preview"
|
340
|
+
end
|
341
|
+
|
342
|
+
expect_window_with_content("Save this", window: window)
|
343
|
+
expect_window_without_content(
|
344
|
+
::I18n.t('switch_to_website', :scope => 'refinery.site_bar'),
|
345
|
+
window: window
|
346
|
+
)
|
347
|
+
|
348
|
+
window.close
|
349
|
+
|
350
|
+
click_button "Save & continue editing"
|
351
|
+
expect(page).to have_content("'Save this' was successfully updated")
|
352
|
+
end
|
353
|
+
|
330
354
|
it 'will show pages with inherited templates', js:true do
|
331
355
|
visit refinery.admin_pages_path
|
332
356
|
|
@@ -365,28 +365,39 @@ module Refinery
|
|
365
365
|
context "with multiple locales" do
|
366
366
|
|
367
367
|
describe "redirects" do
|
368
|
-
before { allow(Refinery::I18n).to receive(:frontend_locales).and_return([:en, :ru]) }
|
369
|
-
after { allow(Refinery::I18n).to receive(:frontend_locales).and_call_original }
|
370
368
|
let(:en_page_title) { 'News' }
|
371
369
|
let(:en_page_slug) { 'news' }
|
372
370
|
let(:ru_page_title) { 'Новости' }
|
373
371
|
let(:ru_page_slug_encoded) { '%D0%BD%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8' }
|
374
372
|
let!(:news_page) do
|
375
|
-
|
373
|
+
@page = Globalize.with_locale(:en) { Page.create title: en_page_title }
|
376
374
|
Globalize.with_locale(:ru) do
|
377
|
-
|
378
|
-
|
375
|
+
@page.title = ru_page_title
|
376
|
+
@page.save
|
379
377
|
end
|
380
378
|
|
381
|
-
|
379
|
+
@page
|
382
380
|
end
|
383
381
|
|
382
|
+
before {
|
383
|
+
allow(Refinery::I18n).to receive(:frontend_locales).and_return([:en, :ru])
|
384
|
+
allow(Page).to receive(:fast_menu).and_return([@page])
|
385
|
+
}
|
386
|
+
|
387
|
+
after { allow(Refinery::I18n).to receive(:frontend_locales).and_call_original }
|
388
|
+
|
384
389
|
it "should recognise when default locale is in the path" do
|
385
390
|
visit "/en/#{en_page_slug}"
|
386
391
|
|
387
392
|
expect(current_path).to eq("/en/#{en_page_slug}")
|
388
393
|
end
|
389
394
|
|
395
|
+
it "should display the default locale when locale is not in the path" do
|
396
|
+
visit "/#{en_page_slug}"
|
397
|
+
|
398
|
+
expect(current_path).to eq("/#{en_page_slug}")
|
399
|
+
end
|
400
|
+
|
390
401
|
it "should redirect to default locale slug" do
|
391
402
|
visit "/#{ru_page_slug_encoded}"
|
392
403
|
|
@@ -401,6 +412,14 @@ module Refinery
|
|
401
412
|
visit "/en/#{en_page_slug}"
|
402
413
|
end
|
403
414
|
|
415
|
+
it "should not have the locale in the menu href link" do
|
416
|
+
visit "/en/#{en_page_slug}"
|
417
|
+
|
418
|
+
within('.menu') do
|
419
|
+
expect(page).to have_selector(:css, "a[href='/#{en_page_slug}']")
|
420
|
+
end
|
421
|
+
end
|
422
|
+
|
404
423
|
describe "nested page" do
|
405
424
|
let(:nested_page_title) { 'nested_page' }
|
406
425
|
let(:nested_page_slug) { 'nested_page' }
|
@@ -428,4 +447,4 @@ module Refinery
|
|
428
447
|
end
|
429
448
|
end
|
430
449
|
end
|
431
|
-
end
|
450
|
+
end
|
@@ -6,7 +6,7 @@ module Refinery
|
|
6
6
|
describe "#template_options" do
|
7
7
|
context "when page layout/view template is set" do
|
8
8
|
it "returns those templates as selected" do
|
9
|
-
page =
|
9
|
+
page = FactoryBot.create(:page)
|
10
10
|
|
11
11
|
page.view_template = "rspec_template"
|
12
12
|
expect(helper.template_options(:view_template, page)).to eq(:selected => "rspec_template")
|
@@ -22,7 +22,7 @@ module Refinery
|
|
22
22
|
end
|
23
23
|
|
24
24
|
it "works as expected" do
|
25
|
-
page =
|
25
|
+
page = FactoryBot.create(:page, :layout_template => "three")
|
26
26
|
|
27
27
|
expect(helper.template_options(:layout_template, page)).to eq(:selected => 'three')
|
28
28
|
end
|
@@ -31,8 +31,8 @@ module Refinery
|
|
31
31
|
context "when page layout template isn't set" do
|
32
32
|
context "when page has parent and parent has layout_template set" do
|
33
33
|
it "returns parent layout_template as selected" do
|
34
|
-
parent =
|
35
|
-
page =
|
34
|
+
parent = FactoryBot.create(:page, :layout_template => "rspec_layout")
|
35
|
+
page = FactoryBot.create(:page, :parent_id => parent.id)
|
36
36
|
|
37
37
|
expected_layout = { :selected => parent.layout_template }
|
38
38
|
expect(helper.template_options(:layout_template, page)).to eq(expected_layout)
|
@@ -41,7 +41,7 @@ module Refinery
|
|
41
41
|
|
42
42
|
context "when page doesn't have parent page" do
|
43
43
|
it "returns default application template" do
|
44
|
-
page =
|
44
|
+
page = FactoryBot.create(:page)
|
45
45
|
|
46
46
|
expected_layout = { :selected => "application" }
|
47
47
|
expect(helper.template_options(:layout_template, page)).to eq(expected_layout)
|
@@ -51,7 +51,7 @@ module Refinery
|
|
51
51
|
end
|
52
52
|
|
53
53
|
describe "#page_meta_information" do
|
54
|
-
let(:page) {
|
54
|
+
let(:page) { FactoryBot.build(:page) }
|
55
55
|
|
56
56
|
context "when show_in_menu is false" do
|
57
57
|
it "adds 'hidden' label" do
|
data/spec/lib/pages_spec.rb
CHANGED
@@ -22,5 +22,25 @@ module Refinery
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
25
|
+
|
26
|
+
describe ".default_parts_for" do
|
27
|
+
context "with no view template" do
|
28
|
+
it "returns the default page parts" do
|
29
|
+
expect(subject.default_parts_for(Page.new)).to eq subject.default_parts
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context "with registered type" do
|
34
|
+
let(:type_name) { "custom_type" }
|
35
|
+
before { Pages::Types.registered.register(type_name) }
|
36
|
+
after { Pages::Types.registered.delete(Pages::Types.registered.find_by_name(type_name)) }
|
37
|
+
|
38
|
+
it "delegates to the type's parts" do
|
39
|
+
part = Pages::Types.registered.find_by_name(type_name)
|
40
|
+
expect(part).to receive(:parts).and_return []
|
41
|
+
subject.default_parts_for(Page.new(view_template: type_name))
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
25
45
|
end
|
26
46
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module Refinery
|
4
|
+
module Pages
|
5
|
+
describe Type do
|
6
|
+
subject { Type.new }
|
7
|
+
|
8
|
+
describe ".parts=" do
|
9
|
+
it "returns an array of hashes unaltered" do
|
10
|
+
parts = [{title: "Body", slug: "body"}]
|
11
|
+
subject.parts = parts
|
12
|
+
expect(subject.parts).to eq parts
|
13
|
+
end
|
14
|
+
|
15
|
+
it "rewrites an array of strings and warns about this deprecated format" do
|
16
|
+
parts = ["Side Bar"]
|
17
|
+
rewritten_parts = [{title: "Side Bar", slug: "side_bar"}]
|
18
|
+
expect(Refinery).to receive(:deprecate).with(
|
19
|
+
"Change specific page template page parts from #{parts} to #{rewritten_parts}",
|
20
|
+
when: "4.1.0"
|
21
|
+
)
|
22
|
+
|
23
|
+
subject.parts = parts
|
24
|
+
expect(subject.parts).to eq rewritten_parts
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
@@ -270,7 +270,7 @@ module Refinery
|
|
270
270
|
|
271
271
|
context "given a page with a custom_slug exists" do
|
272
272
|
before do
|
273
|
-
|
273
|
+
FactoryBot.create(:page, :custom_slug => custom_page_slug)
|
274
274
|
end
|
275
275
|
|
276
276
|
it "fails validation when a new record uses that custom_slug" do
|
@@ -60,10 +60,10 @@ module Refinery
|
|
60
60
|
|
61
61
|
describe "#to_html" do
|
62
62
|
let(:menu_items) {
|
63
|
-
Refinery::Menu.new(
|
63
|
+
Refinery::Menu.new(FactoryBot.create(:page, :title => "Refinery CMS"))
|
64
64
|
}
|
65
65
|
let(:menu_presenter) { MenuPresenter.new(menu_items, view) }
|
66
|
-
|
66
|
+
|
67
67
|
context "wrapped in html" do
|
68
68
|
it "returns menu items" do
|
69
69
|
expect(menu_presenter.to_html).to xml_eq(
|
@@ -72,7 +72,7 @@ module Refinery
|
|
72
72
|
end
|
73
73
|
|
74
74
|
context "with role set to navigation" do
|
75
|
-
let(:menu_presenter_with_role) {
|
75
|
+
let(:menu_presenter_with_role) {
|
76
76
|
menu_presenter.menu_role = 'navigation'
|
77
77
|
menu_presenter
|
78
78
|
}
|
@@ -96,7 +96,7 @@ module Refinery
|
|
96
96
|
|
97
97
|
context "when page has a link_url" do
|
98
98
|
let(:menu_items) {
|
99
|
-
Menu.new(
|
99
|
+
Menu.new(FactoryBot.create(:page, title: "Home", link_url: "/"))
|
100
100
|
}
|
101
101
|
it "the menu item URL includes the mounted path" do
|
102
102
|
expect(menu_presenter.to_html).to xml_eq(
|
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: 4.0.
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philip Arndt
|
@@ -32,7 +32,7 @@ cert_chain:
|
|
32
32
|
jOQmH9VbgbfUrXYM1YOKdlwW5sPR1f4PKLDlvEE+bppIUgKOgLOIv3i7KwrGvFOq
|
33
33
|
5r7Wz/HY31SM47mkK21saPJG4NvUFEycf0wlpzP657Pl9aVo47aKKbxX
|
34
34
|
-----END CERTIFICATE-----
|
35
|
-
date:
|
35
|
+
date: 2018-05-21 00:00:00.000000000 Z
|
36
36
|
dependencies:
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: friendly_id
|
@@ -140,14 +140,14 @@ dependencies:
|
|
140
140
|
requirements:
|
141
141
|
- - '='
|
142
142
|
- !ruby/object:Gem::Version
|
143
|
-
version: 4.0.
|
143
|
+
version: 4.0.2
|
144
144
|
type: :runtime
|
145
145
|
prerelease: false
|
146
146
|
version_requirements: !ruby/object:Gem::Requirement
|
147
147
|
requirements:
|
148
148
|
- - '='
|
149
149
|
- !ruby/object:Gem::Version
|
150
|
-
version: 4.0.
|
150
|
+
version: 4.0.2
|
151
151
|
- !ruby/object:Gem::Dependency
|
152
152
|
name: babosa
|
153
153
|
requirement: !ruby/object:Gem::Requirement
|
@@ -286,6 +286,7 @@ files:
|
|
286
286
|
- db/migrate/20151103211604_fix_slug_format_in_refinery_page_parts.rb
|
287
287
|
- db/migrate/20170703015418_remove_translated_columns_to_refinery_pages.rb
|
288
288
|
- db/migrate/20170703020017_remove_translated_columns_to_refinery_page_parts.rb
|
289
|
+
- db/migrate/20180316032602_add_children_count_to_refinery_pages.rb
|
289
290
|
- db/seeds.rb
|
290
291
|
- lib/generators/refinery/pages/pages_generator.rb
|
291
292
|
- lib/generators/refinery/pages/templates/config/initializers/refinery/pages.rb.erb
|
@@ -314,6 +315,7 @@ files:
|
|
314
315
|
- spec/lib/generators/refinery/pages/pages_generator_spec.rb
|
315
316
|
- spec/lib/pages_spec.rb
|
316
317
|
- spec/lib/refinery/pages/tab_spec.rb
|
318
|
+
- spec/lib/refinery/pages/type_spec.rb
|
317
319
|
- spec/lib/refinery/pages/url_spec.rb
|
318
320
|
- spec/models/refinery/page_finder_spec.rb
|
319
321
|
- spec/models/refinery/page_menu_spec.rb
|
@@ -328,7 +330,7 @@ files:
|
|
328
330
|
- spec/presenters/refinery/pages/section_presenter_spec.rb
|
329
331
|
- spec/presenters/refinery/pages/title_section_presenter_spec.rb
|
330
332
|
- spec/support/refinery/pages/caching_helpers.rb
|
331
|
-
homepage:
|
333
|
+
homepage: https://www.refinerycms.com
|
332
334
|
licenses:
|
333
335
|
- MIT
|
334
336
|
metadata: {}
|
@@ -364,6 +366,7 @@ test_files:
|
|
364
366
|
- spec/lib/generators/refinery/pages/pages_generator_spec.rb
|
365
367
|
- spec/lib/pages_spec.rb
|
366
368
|
- spec/lib/refinery/pages/tab_spec.rb
|
369
|
+
- spec/lib/refinery/pages/type_spec.rb
|
367
370
|
- spec/lib/refinery/pages/url_spec.rb
|
368
371
|
- spec/models/refinery/page_finder_spec.rb
|
369
372
|
- spec/models/refinery/page_menu_spec.rb
|
metadata.gz.sig
CHANGED
Binary file
|