constructor-pages 0.8.12 → 0.8.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/constructor_pages/pages_controller.rb +1 -1
- data/app/models/constructor_pages/page.rb +1 -1
- data/app/views/constructor_pages/pages/_form.haml +3 -3
- data/app/views/constructor_pages/templates/_form.haml +1 -1
- data/config/locales/ru.yml +3 -3
- data/constructor-pages.gemspec +1 -1
- data/db/migrate/15_rename_link_to_redirect.rb +9 -0
- data/spec/features/constructor_pages/pages_spec.rb +15 -0
- data/spec/models/constructor_pages/page_spec.rb +2 -2
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d026926c52a6cb3a5ae3d475466be5ea3e7b117b
|
4
|
+
data.tar.gz: 607421994b5261c7375f5af42f3912d6f9521f83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ed6b39d54645df86219b201f3f9451a96812dca3f809d6fabeb9068bd0703cb3fe6129ca912d32fd4573b42705d4557006a65877d3639ff650e0043169237b6
|
7
|
+
data.tar.gz: 1a531f685ae260efe0db140f77e65a6ac5950469a17d0e88bcc093bc3f89643b57fd658bb0edb1b148d02760f4dabaa77caba6c721337791032bb105b4c52be2
|
@@ -23,7 +23,7 @@ module ConstructorPages
|
|
23
23
|
_request = "/#{params[:all]}"
|
24
24
|
@page = Page.find_by_request_or_first(_request)
|
25
25
|
error_404 and return if @page.nil? or (!@page.published? and _request != '/')
|
26
|
-
redirect_to
|
26
|
+
redirect_to(@page.redirect) && return if @page.redirect?
|
27
27
|
_code_name = @page.template.code_name
|
28
28
|
instance_variable_set('@'+_code_name, @page)
|
29
29
|
|
@@ -41,16 +41,16 @@
|
|
41
41
|
.control-group
|
42
42
|
= f.label :parent_id, class: 'control-label'
|
43
43
|
.controls
|
44
|
-
= f.select :parent_id, options_for_select(for_select(@pages, true), selected: @parent_id), disabled: @page.self_and_descendants.map(&:id), include_blank:
|
44
|
+
= f.select :parent_id, options_for_select(for_select(@pages, true), selected: @parent_id), disabled: @page.self_and_descendants.map(&:id), include_blank: '--'
|
45
45
|
|
46
46
|
.control-group
|
47
47
|
= f.label :template_id, :class => 'control-label'
|
48
48
|
.controls
|
49
49
|
= f.select :template_id, options_for_select(templates, selected: @template_id)
|
50
50
|
.control-group
|
51
|
-
= f.label :
|
51
|
+
= f.label :redirect, class: 'control-label'
|
52
52
|
.controls
|
53
|
-
= f.text_field :
|
53
|
+
= f.text_field :redirect, class: 'span9'
|
54
54
|
.control-group
|
55
55
|
%label.control-label=t :display_in
|
56
56
|
.controls
|
@@ -18,7 +18,7 @@
|
|
18
18
|
.control-group
|
19
19
|
= f.label :parent_id, class: 'control-label'
|
20
20
|
.controls
|
21
|
-
= f.select :parent_id, options_for_select(for_select(@templates), selected: @template.parent_id), disabled: @template.self_and_descendants.map(&:id), include_blank:
|
21
|
+
= f.select :parent_id, options_for_select(for_select(@templates), selected: @template.parent_id), disabled: @template.self_and_descendants.map(&:id), include_blank: '--'
|
22
22
|
|
23
23
|
- unless @template.new_record?
|
24
24
|
.control-group
|
data/config/locales/ru.yml
CHANGED
@@ -62,14 +62,14 @@ ru:
|
|
62
62
|
constructor_pages/template:
|
63
63
|
name: "Название"
|
64
64
|
code_name: "Кодовое имя"
|
65
|
-
|
65
|
+
parent_id: "Родительский"
|
66
66
|
child: "Дочерний"
|
67
67
|
|
68
68
|
constructor_pages/page:
|
69
69
|
active: "Вкл./Выкл."
|
70
70
|
image: "Изображение"
|
71
71
|
name: "Название"
|
72
|
-
|
72
|
+
template_id: "Шаблон"
|
73
73
|
auto_url: "Авто-ссылка"
|
74
74
|
url: "Адрес"
|
75
75
|
in_menu: "Меню"
|
@@ -78,7 +78,7 @@ ru:
|
|
78
78
|
in_url: "Адрес"
|
79
79
|
parent: "Родитель"
|
80
80
|
parent_id: "Родительская страница"
|
81
|
-
|
81
|
+
redirect: "Редирект"
|
82
82
|
title: "Заголовок"
|
83
83
|
keywords: "Ключевые слова"
|
84
84
|
description: "Описание"
|
data/constructor-pages.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
|
21
21
|
s.add_dependency 'dragonfly'
|
22
22
|
s.add_dependency 'rack-cache'
|
23
|
-
s.add_dependency 'awesome_nested_set'
|
23
|
+
s.add_dependency 'awesome_nested_set', '3.0.0.rc1'
|
24
24
|
s.add_dependency 'haml-rails'
|
25
25
|
s.add_dependency 'acts_as_list'
|
26
26
|
|
@@ -88,6 +88,21 @@ module ConstructorPages
|
|
88
88
|
visit _second_page.full_url
|
89
89
|
page.should have_content 'Home page'
|
90
90
|
end
|
91
|
+
|
92
|
+
it 'should redirect if redirect specified' do
|
93
|
+
_page = Page.create name: 'First page', template: @template
|
94
|
+
_template = Template.create name: 'Home page', code_name: 'home_page'
|
95
|
+
Page.create name: 'Second page', template: _template
|
96
|
+
|
97
|
+
visit _page.full_url
|
98
|
+
current_path.should == '/first-page'
|
99
|
+
|
100
|
+
_page.redirect = '/second-page'
|
101
|
+
_page.save
|
102
|
+
|
103
|
+
visit _page.full_url
|
104
|
+
current_path.should == '/second-page'
|
105
|
+
end
|
91
106
|
end
|
92
107
|
|
93
108
|
describe 'Moving' do
|
@@ -280,12 +280,12 @@ module ConstructorPages
|
|
280
280
|
page = Page.create name: 'Test redirection'
|
281
281
|
page.redirect?.should be_false
|
282
282
|
|
283
|
-
page.
|
283
|
+
page.redirect = ''
|
284
284
|
page.save
|
285
285
|
|
286
286
|
page.redirect?.should be_false
|
287
287
|
|
288
|
-
page.
|
288
|
+
page.redirect = '/hello-redirect'
|
289
289
|
page.save
|
290
290
|
|
291
291
|
page.redirect?.should be_true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: constructor-pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Zotov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: constructor-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.8.
|
19
|
+
version: 0.8.13
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.8.
|
26
|
+
version: 0.8.13
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: dragonfly
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: awesome_nested_set
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - '
|
59
|
+
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 3.0.0.rc1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - '
|
66
|
+
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 3.0.0.rc1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: haml-rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -188,6 +188,7 @@ files:
|
|
188
188
|
- db/migrate/12_add_default_template.rb
|
189
189
|
- db/migrate/13_add_in_url_to_pages.rb
|
190
190
|
- db/migrate/14_remove_child_id_from_templates.rb
|
191
|
+
- db/migrate/15_rename_link_to_redirect.rb
|
191
192
|
- db/migrate/1_create_pages.rb
|
192
193
|
- db/migrate/2_create_templates.rb
|
193
194
|
- db/migrate/3_create_fields.rb
|