refinerycms-pages 3.0.6 → 4.0.0

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: 6f503f368f89b0578401ea340bd135e5aac4a4ef
4
- data.tar.gz: f6ea7967a335cf7107ad792f37f87b60f3116968
3
+ metadata.gz: 4ba7a91ac45acb1e48cc5552edecedafaf35e30a
4
+ data.tar.gz: 82266071f24ad8859480269962de199aea2516ea
5
5
  SHA512:
6
- metadata.gz: 805867400c5c99ff7402ca86e747509a179fceadd081a31518b43706e995b4bfe44a08b2c0c5f9ae4742f4ef1c8dfcb53959d38677f96078ca6ae22c675b79f6
7
- data.tar.gz: ef16b436cbc796b1a697c0fdf5e18ce92a26d8869b519ed0de0be351c430ff60a703fee797f209104ddda6a1b061860bd98563eab08921bcb9671a707c9304d9
6
+ metadata.gz: f21a83919c3e2a0dade0799322ff27500354576e3fc4021d88c0744980c88016e792819f1fcb528fd69859cd138eb1fb043a19b7807926f01138aa11225baff2
7
+ data.tar.gz: b62a810e695b50cfb8669ffa5cf0678673d47dce17d26afa045a1d0d815dc22202ef5c7e11d66d0074b50820f081738972e23c09b5a3b8d9a4713510c5ab8eed
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- �ĔD�M�a��v ��8�~5�M�,�����M��`͍a���� ��W�
2
- tl:
1
+ zdv.�� p
2
+ =��WK �+x�� D���g�?�4 �(�J&!�i���������>��˘���+ȁ:����k^3��cG���dJw)�v��F�E|�e������3���ߒ�Lu�>t�'��F��-uHLL�<]�j�E���e&�Q\M�Y�ɑH�P-��*�ׇ|��ԃL�*���Q� �R�ʦ �)BKKI��I׋Z1�ɶ�ΰ�>�r�O�?T�<�$��������9��8M� +Ĕ3�F/�/
data.tar.gz.sig CHANGED
Binary file
@@ -15,9 +15,9 @@ module Refinery
15
15
  page = part.page
16
16
  if part.destroy
17
17
  page.reposition_parts!
18
- render :text => "'#{part.title}' deleted."
18
+ render plain: t('refinery.crudify.destroyed', what: "'#{part.title}'")
19
19
  else
20
- render :text => "'#{part.title}' not deleted."
20
+ render plain: t('refinery.crudify.not_destroyed', what: "'#{part.title}'")
21
21
  end
22
22
  end
23
23
 
@@ -54,14 +54,6 @@ module Refinery
54
54
 
55
55
  meta_information
56
56
  end
57
-
58
- # We show the title from the next available locale
59
- # if there is no title for the current locale
60
- def page_title_with_translations(page)
61
- Refinery.deprecate('page_title_with_translations', when: '3.1', replacement: 'translated_field')
62
- page.title.presence || page.translations.detect { |t| t.title.present?}.title
63
- end
64
-
65
57
  end
66
58
  end
67
59
  end
@@ -10,6 +10,13 @@ module Refinery
10
10
 
11
11
  translates :title, :menu_title, :custom_slug, :slug, :include => :seo_meta
12
12
 
13
+ attribute :title
14
+ attribute :menu_title
15
+ attribute :custom_slug
16
+ attribute :slug
17
+
18
+ after_save { translations.collect(&:save) }
19
+
13
20
  class Translation
14
21
  is_seo_meta
15
22
 
@@ -137,11 +144,10 @@ module Refinery
137
144
  dialog ? Pages.pages_per_dialog : Pages.pages_per_admin_index
138
145
  end
139
146
 
140
- def rebuild_with_slug_nullification!
141
- rebuild_without_slug_nullification!
147
+ def rebuild!
148
+ super
142
149
  nullify_duplicate_slugs_under_the_same_parent!
143
150
  end
144
- alias_method_chain :rebuild!, :slug_nullification
145
151
 
146
152
  protected
147
153
 
@@ -320,11 +326,6 @@ module Refinery
320
326
  end
321
327
  end
322
328
 
323
- def part_with_title(part_title)
324
- Refinery.deprecate("Refinery::Page#part_with_title", when: "3.1", replacement: "part_with_slug")
325
- part_with_slug(part_title.to_s.parameterize.underscore)
326
- end
327
-
328
329
  # Protects generated slugs from title if they are in the list of reserved words
329
330
  # This applies mostly to plugin-generated pages.
330
331
  # This only kicks in when Refinery::Pages.marketable_urls is enabled.
@@ -11,12 +11,14 @@ module Refinery
11
11
 
12
12
  translates :body
13
13
 
14
+ attribute :body
15
+
14
16
  def to_param
15
17
  "page_part_#{slug.downcase.gsub(/\W/, '_')}"
16
18
  end
17
19
 
18
20
  def body=(value)
19
- super
21
+ write_attribute(:body, value)
20
22
 
21
23
  normalise_text_fields
22
24
  end
@@ -28,16 +30,11 @@ module Refinery
28
30
  )
29
31
  end
30
32
 
31
- def title_matches?(other_title)
32
- Refinery.deprecate("Refinery::PagePart#title_matches?", when: "3.1", replacement: "slug_matches?")
33
- slug_matches?(other_title.to_s.parameterize.underscore)
34
- end
35
-
36
33
  protected
37
34
 
38
35
  def normalise_text_fields
39
- if body? && body !~ %r{^<}
40
- self.body = "<p>#{body.gsub("\r\n\r\n", "</p><p>").gsub("\r\n", "<br/>")}</p>"
36
+ if read_attribute(:body).present? && read_attribute(:body) !~ %r{^<}
37
+ write_attribute(:body, "<p>#{read_attribute(:body).gsub("\r\n\r\n", "</p><p>").gsub("\r\n", "<br/>")}</p>")
41
38
  end
42
39
  end
43
40
 
@@ -10,7 +10,7 @@ module Refinery
10
10
  include ActionView::Helpers::UrlHelper
11
11
  include ActiveSupport::Configurable
12
12
 
13
- config_accessor :roots, :menu_tag, :list_tag, :list_item_tag, :css, :dom_id,
13
+ config_accessor :roots, :menu_tag, :menu_role, :list_tag, :list_item_tag, :css, :dom_id,
14
14
  :max_depth, :active_css, :selected_css, :first_css, :last_css, :list_tag_css,
15
15
  :link_tag_css
16
16
  self.dom_id = 'menu'
@@ -42,7 +42,7 @@ module Refinery
42
42
 
43
43
  private
44
44
  def render_menu(items)
45
- content_tag(menu_tag, :id => dom_id, :class => css) do
45
+ content_tag(menu_tag, id: dom_id, class: css, role: menu_role) do
46
46
  render_menu_items(items)
47
47
  end
48
48
  end
@@ -77,11 +77,6 @@ module Refinery
77
77
  item.has_children? && item.descendants.any?(&method(:selected_item?))
78
78
  end
79
79
 
80
- def selected_item_or_descendant_item_selected?(item)
81
- Refinery.deprecate('Refinery::Pages::MenuPresenter#selected_item_or_descendant_item_selected?', when: '3.1')
82
- selected_item?(item) || descendant_item_selected?(item)
83
- end
84
-
85
80
  # Determine whether the supplied item is the currently open item according to Refinery.
86
81
  def selected_item?(item)
87
82
  # Ensure we match the path without the locale, if present.
@@ -40,6 +40,7 @@ da:
40
40
  view_live_html: Vis siden live <br/><em>(åbner i et nyt vindue)</em>
41
41
  hidden: skjult
42
42
  draft: kladde
43
+ redirected: Videresendt
43
44
  form:
44
45
  preview: Preview
45
46
  preview_changes: Se dine ændringer før du udgiver dem
@@ -1,4 +1,4 @@
1
- class CreateRefinerycmsPagesSchema < ActiveRecord::Migration
1
+ class CreateRefinerycmsPagesSchema < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  create_table :refinery_page_parts do |t|
4
4
  t.integer :refinery_page_id
@@ -1,4 +1,4 @@
1
- class AddCustomSlugToRefineryPages < ActiveRecord::Migration
1
+ class AddCustomSlugToRefineryPages < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  if page_column_names.exclude?('custom_slug')
4
4
  add_column :refinery_pages, :custom_slug, :string
@@ -1,4 +1,4 @@
1
- class AddSlugToRefineryPageParts < ActiveRecord::Migration
1
+ class AddSlugToRefineryPageParts < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  rename_column :refinery_page_parts, :title, :slug
4
4
  add_column :refinery_page_parts, :title, :string
@@ -1,4 +1,4 @@
1
- class UpdateSlugAndTitleInRefineryPageParts < ActiveRecord::Migration
1
+ class UpdateSlugAndTitleInRefineryPageParts < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  begin
4
4
  ::Refinery::PagePart.all.each do |pp|
@@ -1,4 +1,4 @@
1
- class FixSlugFormatInRefineryPageParts < ActiveRecord::Migration
1
+ class FixSlugFormatInRefineryPageParts < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  begin
4
4
  ::Refinery::PagePart.all.each do |pp|
@@ -0,0 +1,6 @@
1
+ class RemoveTranslatedColumnsToRefineryPages < ActiveRecord::Migration[5.0]
2
+ def change
3
+ remove_column :refinery_pages, :custom_slug
4
+ remove_column :refinery_pages, :slug
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class RemoveTranslatedColumnsToRefineryPageParts < ActiveRecord::Migration[5.0]
2
+ def change
3
+ remove_column :refinery_page_parts, :body
4
+ end
5
+ end
@@ -39,22 +39,8 @@ module Refinery
39
39
  def layout_template_whitelist
40
40
  Array(config.layout_template_whitelist).map(&:to_s)
41
41
  end
42
-
43
- def default_parts
44
- if config.default_parts.all? { |v| v.is_a? String }
45
- new_syntax = config.default_parts.map do |part|
46
- { title: part, slug: part.downcase.gsub(" ", "_") }
47
- end
48
- Refinery.deprecate(
49
- "Change Refinery::Pages.default_parts= from #{config.default_parts.inspect} to #{new_syntax.inspect}",
50
- when: "3.2.0"
51
- )
52
- new_syntax
53
- else
54
- config.default_parts
55
- end
56
- end
57
42
  end
43
+
58
44
  self.use_layout_templates = false
59
45
  self.page_title = {
60
46
  :chain_page_title => false,
@@ -25,11 +25,11 @@ module Refinery
25
25
  Refinery.include_once(Refinery::AdminController, Refinery::Pages::Admin::InstanceMethods)
26
26
  end
27
27
 
28
- initializer "refinery.pages append marketable routes", :after => :set_routes_reloader_hook do
28
+ initializer "refinery.pages append marketable routes" do
29
29
  append_marketable_routes if Refinery::Pages.marketable_urls
30
30
  end
31
31
 
32
- initializer "add marketable route parts to reserved words", :after => :set_routes_reloader_hook do
32
+ initializer "add marketable route parts to reserved words" do
33
33
  add_route_parts_as_reserved_words if Refinery::Pages.marketable_urls
34
34
  end
35
35
 
@@ -41,6 +41,7 @@ module Refinery
41
41
 
42
42
  config.after_initialize do
43
43
  Refinery.register_extension(Refinery::Pages)
44
+ Rails.application.reload_routes!
44
45
  end
45
46
 
46
47
  protected
@@ -49,14 +50,13 @@ module Refinery
49
50
  Refinery::Core::Engine.routes.append do
50
51
  get '*path', :to => 'pages#show', :as => :marketable_page
51
52
  end
52
- Rails.application.routes_reloader.reload!
53
53
  end
54
54
 
55
55
  # Add any parts of routes as reserved words.
56
56
  def add_route_parts_as_reserved_words
57
57
  ActiveSupport.on_load(:active_record) do
58
58
  # do not add routes with :allow_slug => true
59
- included_routes = Rails.application.routes.named_routes.routes.reject{ |name, route| route.defaults[:allow_slug] }
59
+ included_routes = Rails.application.routes.named_routes.to_a.reject{ |name, route| route.defaults[:allow_slug] }
60
60
  route_paths = included_routes.map { |name, route| route.path.spec }
61
61
  route_paths.reject! { |path| path.to_s =~ %r{^/(rails|refinery)}}
62
62
  Refinery::Pages.friendly_id_reserved_words |= route_paths.map { |path|
@@ -20,13 +20,14 @@ Gem::Specification.new do |s|
20
20
  s.test_files = `git ls-files -- spec/*`.split("\n")
21
21
 
22
22
  s.add_dependency 'friendly_id', ['>= 5.1.0', '< 5.3']
23
- s.add_dependency 'globalize', ['>= 4.0.0', '< 5.2']
24
- s.add_dependency 'awesome_nested_set', '~> 3.0.0'
25
- s.add_dependency 'seo_meta', '~> 2.0.0.rc.1'
23
+ s.add_dependency 'globalize', ['>= 5.1.0.beta1', '< 5.2']
24
+ s.add_dependency 'activemodel-serializers-xml', '~> 1.0', '>= 1.0.1'
25
+ s.add_dependency 'awesome_nested_set', '~> 3.1', '>= 3.1.0'
26
+ s.add_dependency 'seo_meta', '~> 3.0', '>= 3.0.0'
26
27
  s.add_dependency 'refinerycms-core', version
27
28
  s.add_dependency 'babosa', '!= 0.3.6'
28
- s.add_dependency 'speakingurl-rails', '~> 8.0.0'
29
- s.add_dependency 'diffy', '~> 3.1.0'
29
+ s.add_dependency 'speakingurl-rails', '~> 8.0', '>= 8.0.0'
30
+ s.add_dependency 'diffy', '~> 3.1', '>= 3.1.0'
30
31
 
31
32
  s.required_ruby_version = Refinery::Version.required_ruby_version
32
33
 
@@ -16,7 +16,7 @@ module Refinery
16
16
 
17
17
  describe "#show" do
18
18
  it "renders show template" do
19
- get :show, :path => "test"
19
+ get :show, params: {path: "test"}
20
20
  expect(response).to render_template("show")
21
21
  end
22
22
  end
@@ -4,7 +4,7 @@ require 'spec_helper'
4
4
  module Refinery
5
5
  describe Page do
6
6
  let(:page_title) { 'RSpec is great for testing too' }
7
- let(:page) { subject.class.new(:title => page_title, :deletable => true)}
7
+ let(:page) { subject.class.create(title: page_title, deletable: true)}
8
8
 
9
9
  context 'responds to' do
10
10
  it 'meta_description' do
@@ -63,10 +63,26 @@ module Refinery
63
63
  Refinery::Menu.new(FactoryGirl.create(:page, :title => "Refinery CMS"))
64
64
  }
65
65
  let(:menu_presenter) { MenuPresenter.new(menu_items, view) }
66
- it "returns menu items wrapped in html" do
67
- expect(menu_presenter.to_html).to xml_eq(
68
- %Q{<nav class="menu clearfix" id="menu"><ul class="nav"><li class="first last"><a href="/refinery-cms">Refinery CMS</a></li></ul></nav>}
69
- )
66
+
67
+ context "wrapped in html" do
68
+ it "returns menu items" do
69
+ expect(menu_presenter.to_html).to xml_eq(
70
+ %Q{<nav class="menu clearfix" id="menu"><ul class="nav"><li class="first last"><a href="/refinery-cms">Refinery CMS</a></li></ul></nav>}
71
+ )
72
+ end
73
+
74
+ context "with role set to navigation" do
75
+ let(:menu_presenter_with_role) {
76
+ menu_presenter.menu_role = 'navigation'
77
+ menu_presenter
78
+ }
79
+
80
+ it "returns menu items wrapped in html with role set to navigation" do
81
+ expect(menu_presenter_with_role.to_html).to xml_eq(
82
+ %Q{<nav class="menu clearfix" id="menu" role="navigation"><ul class="nav"><li class="first last"><a href="/refinery-cms">Refinery CMS</a></li></ul></nav>}
83
+ )
84
+ end
85
+ end
70
86
  end
71
87
 
72
88
  context "takes mount point into account" do
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.6
4
+ version: 4.0.0
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: 2017-10-02 00:00:00.000000000 Z
35
+ date: 2017-09-29 00:00:00.000000000 Z
36
36
  dependencies:
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: friendly_id
@@ -60,7 +60,7 @@ dependencies:
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: 4.0.0
63
+ version: 5.1.0.beta1
64
64
  - - "<"
65
65
  - !ruby/object:Gem::Version
66
66
  version: '5.2'
@@ -70,52 +70,84 @@ dependencies:
70
70
  requirements:
71
71
  - - ">="
72
72
  - !ruby/object:Gem::Version
73
- version: 4.0.0
73
+ version: 5.1.0.beta1
74
74
  - - "<"
75
75
  - !ruby/object:Gem::Version
76
76
  version: '5.2'
77
+ - !ruby/object:Gem::Dependency
78
+ name: activemodel-serializers-xml
79
+ requirement: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '1.0'
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: 1.0.1
87
+ type: :runtime
88
+ prerelease: false
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - "~>"
92
+ - !ruby/object:Gem::Version
93
+ version: '1.0'
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 1.0.1
77
97
  - !ruby/object:Gem::Dependency
78
98
  name: awesome_nested_set
79
99
  requirement: !ruby/object:Gem::Requirement
80
100
  requirements:
81
101
  - - "~>"
82
102
  - !ruby/object:Gem::Version
83
- version: 3.0.0
103
+ version: '3.1'
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: 3.1.0
84
107
  type: :runtime
85
108
  prerelease: false
86
109
  version_requirements: !ruby/object:Gem::Requirement
87
110
  requirements:
88
111
  - - "~>"
89
112
  - !ruby/object:Gem::Version
90
- version: 3.0.0
113
+ version: '3.1'
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: 3.1.0
91
117
  - !ruby/object:Gem::Dependency
92
118
  name: seo_meta
93
119
  requirement: !ruby/object:Gem::Requirement
94
120
  requirements:
95
121
  - - "~>"
96
122
  - !ruby/object:Gem::Version
97
- version: 2.0.0.rc.1
123
+ version: '3.0'
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: 3.0.0
98
127
  type: :runtime
99
128
  prerelease: false
100
129
  version_requirements: !ruby/object:Gem::Requirement
101
130
  requirements:
102
131
  - - "~>"
103
132
  - !ruby/object:Gem::Version
104
- version: 2.0.0.rc.1
133
+ version: '3.0'
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: 3.0.0
105
137
  - !ruby/object:Gem::Dependency
106
138
  name: refinerycms-core
107
139
  requirement: !ruby/object:Gem::Requirement
108
140
  requirements:
109
141
  - - '='
110
142
  - !ruby/object:Gem::Version
111
- version: 3.0.6
143
+ version: 4.0.0
112
144
  type: :runtime
113
145
  prerelease: false
114
146
  version_requirements: !ruby/object:Gem::Requirement
115
147
  requirements:
116
148
  - - '='
117
149
  - !ruby/object:Gem::Version
118
- version: 3.0.6
150
+ version: 4.0.0
119
151
  - !ruby/object:Gem::Dependency
120
152
  name: babosa
121
153
  requirement: !ruby/object:Gem::Requirement
@@ -135,6 +167,9 @@ dependencies:
135
167
  requirement: !ruby/object:Gem::Requirement
136
168
  requirements:
137
169
  - - "~>"
170
+ - !ruby/object:Gem::Version
171
+ version: '8.0'
172
+ - - ">="
138
173
  - !ruby/object:Gem::Version
139
174
  version: 8.0.0
140
175
  type: :runtime
@@ -142,6 +177,9 @@ dependencies:
142
177
  version_requirements: !ruby/object:Gem::Requirement
143
178
  requirements:
144
179
  - - "~>"
180
+ - !ruby/object:Gem::Version
181
+ version: '8.0'
182
+ - - ">="
145
183
  - !ruby/object:Gem::Version
146
184
  version: 8.0.0
147
185
  - !ruby/object:Gem::Dependency
@@ -149,6 +187,9 @@ dependencies:
149
187
  requirement: !ruby/object:Gem::Requirement
150
188
  requirements:
151
189
  - - "~>"
190
+ - !ruby/object:Gem::Version
191
+ version: '3.1'
192
+ - - ">="
152
193
  - !ruby/object:Gem::Version
153
194
  version: 3.1.0
154
195
  type: :runtime
@@ -156,6 +197,9 @@ dependencies:
156
197
  version_requirements: !ruby/object:Gem::Requirement
157
198
  requirements:
158
199
  - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '3.1'
202
+ - - ">="
159
203
  - !ruby/object:Gem::Version
160
204
  version: 3.1.0
161
205
  description: The default content extension of Refinery CMS. This extension handles
@@ -240,6 +284,8 @@ files:
240
284
  - db/migrate/20150130044643_add_slug_to_refinery_page_parts.rb
241
285
  - db/migrate/20150720155305_update_slug_and_title_in_refinery_page_parts.rb
242
286
  - db/migrate/20151103211604_fix_slug_format_in_refinery_page_parts.rb
287
+ - db/migrate/20170703015418_remove_translated_columns_to_refinery_pages.rb
288
+ - db/migrate/20170703020017_remove_translated_columns_to_refinery_page_parts.rb
243
289
  - db/seeds.rb
244
290
  - lib/generators/refinery/pages/pages_generator.rb
245
291
  - lib/generators/refinery/pages/templates/config/initializers/refinery/pages.rb.erb
@@ -294,7 +340,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
294
340
  requirements:
295
341
  - - ">="
296
342
  - !ruby/object:Gem::Version
297
- version: 2.0.0
343
+ version: 2.2.2
298
344
  required_rubygems_version: !ruby/object:Gem::Requirement
299
345
  requirements:
300
346
  - - ">="
metadata.gz.sig CHANGED
Binary file