refinerycms-pages 0.9.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/admin/page_parts_controller.rb +24 -0
- data/app/controllers/admin/pages_controller.rb +37 -0
- data/app/controllers/admin/pages_dialogs_controller.rb +87 -0
- data/app/controllers/pages_controller.rb +31 -0
- data/app/helpers/pages_helper.rb +2 -0
- data/app/models/page.rb +274 -0
- data/app/models/page_part.rb +23 -0
- data/app/presenters/page_presenter.rb +7 -0
- data/app/views/admin/pages/_form.html.erb +61 -0
- data/app/views/admin/pages/_form_advanced_options.html.erb +79 -0
- data/app/views/admin/pages/_form_advanced_options_seo.html.erb +24 -0
- data/app/views/admin/pages/_form_fields_after_title.html.erb +1 -0
- data/app/views/admin/pages/_form_new_page_parts.html.erb +14 -0
- data/app/views/admin/pages/_form_page_parts.html.erb +47 -0
- data/app/views/admin/pages/_locale_picker.html.erb +11 -0
- data/app/views/admin/pages/_page.html.erb +35 -0
- data/app/views/admin/pages/_page_part_field.html.erb +5 -0
- data/app/views/admin/pages/_sortable_list.html.erb +5 -0
- data/app/views/admin/pages/edit.html.erb +1 -0
- data/app/views/admin/pages/index.html.erb +40 -0
- data/app/views/admin/pages/new.html.erb +1 -0
- data/app/views/admin/pages_dialogs/_page_link.html.erb +13 -0
- data/app/views/admin/pages_dialogs/link_to.html.erb +141 -0
- data/app/views/pages/home.html.erb +1 -0
- data/app/views/pages/show.html.erb +1 -0
- data/config/locales/cs.yml +84 -0
- data/config/locales/da.yml +84 -0
- data/config/locales/de.yml +84 -0
- data/config/locales/el.yml +84 -0
- data/config/locales/en.yml +84 -0
- data/config/locales/es.yml +83 -0
- data/config/locales/fr.yml +84 -0
- data/config/locales/it.yml +98 -0
- data/config/locales/lolcat.yml +83 -0
- data/config/locales/lt.yml +85 -0
- data/config/locales/lv.yml +86 -0
- data/config/locales/nb.yml +85 -0
- data/config/locales/nl.yml +81 -0
- data/config/locales/pl.yml +85 -0
- data/config/locales/pt-BR.yml +85 -0
- data/config/locales/rs.yml +84 -0
- data/config/locales/ru.yml +108 -0
- data/config/locales/sl.yml +83 -0
- data/config/locales/sv.yml +84 -0
- data/config/locales/vi.yml +84 -0
- data/config/locales/zh-CN.yml +84 -0
- data/config/locales/zh-TW.yml +84 -0
- data/config/routes.rb +21 -0
- data/db/migrate/20100913234708_create_refinerycms_pages_schema.rb +53 -0
- data/db/migrate/20101214040815_translate_page_plugin.rb +29 -0
- data/db/migrate/20101216194133_remove_cached_slug_from_pages.rb +9 -0
- data/db/seeds/pages.rb +43 -0
- data/features/manage_pages.feature +47 -0
- data/features/step_definitions/page_steps.rb +53 -0
- data/features/support/paths.rb +26 -0
- data/features/visit_pages.feature +47 -0
- data/lib/gemspec.rb +33 -0
- data/lib/generators/refinerycms_pages_generator.rb +8 -0
- data/lib/pages/marketable_routes.rb +10 -0
- data/lib/pages/tabs.rb +30 -0
- data/lib/refinerycms-pages.rb +45 -0
- data/license.md +21 -0
- data/readme.md +156 -0
- data/refinerycms-pages.gemspec +110 -0
- data/spec/models/page_spec.rb +144 -0
- metadata +133 -0
data/license.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2005-2010 [Resolve Digital](http://www.resolvedigital.com)
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/readme.md
ADDED
@@ -0,0 +1,156 @@
|
|
1
|
+
# Pages
|
2
|
+
|
3
|
+
![Refinery Pages](http://refinerycms.com/system/images/0000/0656/pages.png)
|
4
|
+
|
5
|
+
## About
|
6
|
+
|
7
|
+
One core part of Refinery is Pages. Plugins such as News and Inquiries hook to pages. The menu is rendered based off the structure of your pages.
|
8
|
+
|
9
|
+
Pages have one key thing about them that is unique - page parts.
|
10
|
+
|
11
|
+
## Page Parts
|
12
|
+
|
13
|
+
![Refinery Page Parts](http://refinerycms.com/system/images/0000/0586/editing-page.png)
|
14
|
+
|
15
|
+
### What are they?
|
16
|
+
|
17
|
+
Think of a page part is a single piece of content on your page. At [Resolve Digital](http://www.resolvedigital.com) we often simply use ``body`` and ``side_body``. One is for the main content and one is for the content which goes on a side bit of the page to display other information.
|
18
|
+
|
19
|
+
### Default Page Parts
|
20
|
+
|
21
|
+
You can change what the default page parts are called or add more by editing the "Default Page Parts" setting. This is a serialized array of names. The default looks like this
|
22
|
+
|
23
|
+
---
|
24
|
+
- Body
|
25
|
+
- Side Body
|
26
|
+
|
27
|
+
Edit this setting to suit your taste.
|
28
|
+
|
29
|
+
### Adding Page Parts for Specific Pages
|
30
|
+
|
31
|
+
You can add extra page parts to your pages by setting the "New Page Parts" to ``true``.
|
32
|
+
|
33
|
+
Now do this
|
34
|
+
|
35
|
+
* Edit the page you want to add a part to
|
36
|
+
* Click the little "+" icon up by the page part tabs
|
37
|
+
* Type the name of your new part and hit add.
|
38
|
+
|
39
|
+
_Note: in the user-facing front end we call them "content sections" not "page parts"._
|
40
|
+
|
41
|
+
## Page Options
|
42
|
+
|
43
|
+
### Draft/Published
|
44
|
+
|
45
|
+
You can have draft and published pages. This is controlled by checking and unchecking the "Save as Draft" field on the page form, when editing the page.
|
46
|
+
|
47
|
+
### Custom Title
|
48
|
+
|
49
|
+
There are three options for how the page title will be rendered on the front end.
|
50
|
+
|
51
|
+
* ``None``: will just default to the page title
|
52
|
+
* ``Text``: allows you to have a different name for the page in the backend to the front end (sometimes good for SEO)
|
53
|
+
* ``Image``: If your designer is using a custom non-standard web font, this is ideal. Bang the image of your title right in there (_we don't recommend this though! Standard web fonts are always a good idea_)
|
54
|
+
|
55
|
+
### Show in Menu
|
56
|
+
|
57
|
+
You can hide a page from the navigation if you like by unchecking "show in menu". This is good for extra reference pages or even pages you might want to link someone up to directly but not "advertise" the pages existence on the menu.
|
58
|
+
|
59
|
+
### Custom URL
|
60
|
+
|
61
|
+
This allows you to make your page not link to a normal page but make it show something else. This could be a donation link to a completely different site or as Refinery uses it, you might want to link to another plugin.
|
62
|
+
|
63
|
+
The "contact us" page for example has a Custom URL of ``/contact``, this is because we want it to load the inquiries form from the inquiries plugin instead and we have this ``match '/contact', :to => 'inquiries#new', :as => 'new_inquiry'`` in the routes.
|
64
|
+
|
65
|
+
### WYMeditor (the visual editor)
|
66
|
+
|
67
|
+
Refinery is backed by [WYMeditor](http://www.wymeditor.org/)
|
68
|
+
|
69
|
+
It's a standards compliant editor that we've trimmed to only have what we feel is absolutely necessary. When you're editing the content in a page part you're using [WYMeditor](http://www.wymeditor.org/).
|
70
|
+
|
71
|
+
We have since modified the source code of WYMeditor to allow for a lot of new features like our custom dialogues however it is all based on the release: WYMeditor 0.5 rc1.
|
72
|
+
|
73
|
+
You can also switch to "source" view and edit XHTML manually if the visual editor is not playing nice.
|
74
|
+
|
75
|
+
### Custom Selectable Styles in WYMeditor
|
76
|
+
|
77
|
+
![Refinery Page Editor Styles](http://refinerycms.com/system/images/0000/0596/editing-page-style.png)
|
78
|
+
|
79
|
+
Some sites require a little more than just your standard bold and heading controls. This is where the "css" style drop down comes in handy.
|
80
|
+
|
81
|
+
It allows your users to select a style you define. You need to edit/create a CSS file called ``theme.css``.
|
82
|
+
|
83
|
+
This file should be located in ``/public/stylesheets/themes.css``
|
84
|
+
|
85
|
+
Inside that file you define your styles like this
|
86
|
+
|
87
|
+
.category-name-style-name {
|
88
|
+
// apply your CSS rules here
|
89
|
+
}
|
90
|
+
|
91
|
+
For example, if I wanted to add a style that allowed my users to highlight their text a light yellow colour, I would put this
|
92
|
+
|
93
|
+
.text-highlight-yellow {
|
94
|
+
background: LightYellow;
|
95
|
+
}
|
96
|
+
|
97
|
+
Now edit ``public/javascripts/admin.js``. We're going to need to tell WYMeditor that we have some new styles it should load when the editor is loaded.
|
98
|
+
|
99
|
+
Currently your ``admin.js`` file will have something like this
|
100
|
+
|
101
|
+
var custom_wymeditor_boot_options = {
|
102
|
+
|
103
|
+
};
|
104
|
+
|
105
|
+
If we open ``public/javascripts/boot_wym.js`` we can see this inside which is the default:
|
106
|
+
|
107
|
+
, classesItems: [
|
108
|
+
{name: 'text-align', rules:['left', 'center', 'right', 'justify'], join: '-'}
|
109
|
+
, {name: 'image-align', rules:['left', 'right'], join: '-'}
|
110
|
+
, {name: 'font-size', rules:['small', 'normal', 'large'], join: '-'}
|
111
|
+
]
|
112
|
+
|
113
|
+
Let's just breakdown a single WYMeditor line and understand it:
|
114
|
+
|
115
|
+
{name: 'font-size', rules:['small','normal','large'], join: '-'}
|
116
|
+
|
117
|
+
``font-size`` is the name of the category and ``small``, ``normal``, ``large`` are the actual styles. So for this to match up with the styles in my theme.css file the class name has to be:
|
118
|
+
|
119
|
+
.font-size-small { // CSS rules here }
|
120
|
+
.font-size-normal { // CSS rules here }
|
121
|
+
.font-size-large { // CSS rules here }
|
122
|
+
|
123
|
+
So going back to our text highlighting style above, we make the new style show up in the editor by changing our ``admin.js`` file to:
|
124
|
+
|
125
|
+
var custom_wymeditor_boot_options = {
|
126
|
+
classesItems: [
|
127
|
+
{name: 'text-align', rules:['left', 'center', 'right', 'justify'], join: '-'}
|
128
|
+
, {name: 'image-align', rules:['left', 'right'], join: '-'}
|
129
|
+
, {name: 'font-size', rules:['small','normal','large'], join: '-'}
|
130
|
+
, {name: 'text-highlight', rules:['yellow'], join: '-'}
|
131
|
+
]
|
132
|
+
}
|
133
|
+
|
134
|
+
### Dialogs that show from WYMeditor
|
135
|
+
|
136
|
+
![Refinery Page Editor Link Dialog](http://refinerycms.com/system/images/0000/0636/link-dialog.png)
|
137
|
+
|
138
|
+
## Page Link dialog
|
139
|
+
|
140
|
+
The link dialog lets you link in several different ways:
|
141
|
+
|
142
|
+
* To an internal page
|
143
|
+
* To an external page
|
144
|
+
* To an email address
|
145
|
+
* To a resource you've uploaded in the Resources tab.
|
146
|
+
|
147
|
+
## Insert Image dialog
|
148
|
+
|
149
|
+
Simply lets you select from an existing image found in the Images tab or upload a new one right within the dialog.
|
150
|
+
|
151
|
+
## Refinery Default Pages
|
152
|
+
|
153
|
+
Some pages you have to keep in order for Refinery to stay fully functional:
|
154
|
+
|
155
|
+
* Home page - the page that has ``link_url`` to ``root_url`` (normally /)
|
156
|
+
* Page not found - the default 404 page
|
@@ -0,0 +1,110 @@
|
|
1
|
+
# DO NOT EDIT THIS FILE DIRECTLY! Instead, use lib/gemspec.rb to generate it.
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{refinerycms-pages}
|
5
|
+
s.version = %q{0.9.9.1}
|
6
|
+
s.summary = %q{Pages engine for Refinery CMS}
|
7
|
+
s.description = %q{The default content engine of Refinery CMS. This engine handles the administration and display of user-editable pages.}
|
8
|
+
s.date = %q{2011-02-15}
|
9
|
+
s.email = %q{info@refinerycms.com}
|
10
|
+
s.homepage = %q{http://refinerycms.com}
|
11
|
+
s.rubyforge_project = %q{refinerycms}
|
12
|
+
s.authors = ['Resolve Digital', 'Philip Arndt', 'David Jones', 'Steven Heidel']
|
13
|
+
s.license = %q{MIT}
|
14
|
+
s.require_paths = %w(lib)
|
15
|
+
s.executables = %w()
|
16
|
+
|
17
|
+
s.files = [
|
18
|
+
'app',
|
19
|
+
'app/controllers',
|
20
|
+
'app/controllers/admin',
|
21
|
+
'app/controllers/admin/page_parts_controller.rb',
|
22
|
+
'app/controllers/admin/pages_controller.rb',
|
23
|
+
'app/controllers/admin/pages_dialogs_controller.rb',
|
24
|
+
'app/controllers/pages_controller.rb',
|
25
|
+
'app/helpers',
|
26
|
+
'app/helpers/pages_helper.rb',
|
27
|
+
'app/models',
|
28
|
+
'app/models/page.rb',
|
29
|
+
'app/models/page_part.rb',
|
30
|
+
'app/presenters',
|
31
|
+
'app/presenters/page_presenter.rb',
|
32
|
+
'app/views',
|
33
|
+
'app/views/admin',
|
34
|
+
'app/views/admin/pages',
|
35
|
+
'app/views/admin/pages/_form.html.erb',
|
36
|
+
'app/views/admin/pages/_form_advanced_options.html.erb',
|
37
|
+
'app/views/admin/pages/_form_advanced_options_seo.html.erb',
|
38
|
+
'app/views/admin/pages/_form_fields_after_title.html.erb',
|
39
|
+
'app/views/admin/pages/_form_new_page_parts.html.erb',
|
40
|
+
'app/views/admin/pages/_form_page_parts.html.erb',
|
41
|
+
'app/views/admin/pages/_locale_picker.html.erb',
|
42
|
+
'app/views/admin/pages/_page.html.erb',
|
43
|
+
'app/views/admin/pages/_page_part_field.html.erb',
|
44
|
+
'app/views/admin/pages/_sortable_list.html.erb',
|
45
|
+
'app/views/admin/pages/edit.html.erb',
|
46
|
+
'app/views/admin/pages/index.html.erb',
|
47
|
+
'app/views/admin/pages/new.html.erb',
|
48
|
+
'app/views/admin/pages_dialogs',
|
49
|
+
'app/views/admin/pages_dialogs/_page_link.html.erb',
|
50
|
+
'app/views/admin/pages_dialogs/link_to.html.erb',
|
51
|
+
'app/views/pages',
|
52
|
+
'app/views/pages/home.html.erb',
|
53
|
+
'app/views/pages/show.html.erb',
|
54
|
+
'config',
|
55
|
+
'config/locales',
|
56
|
+
'config/locales/cs.yml',
|
57
|
+
'config/locales/da.yml',
|
58
|
+
'config/locales/de.yml',
|
59
|
+
'config/locales/el.yml',
|
60
|
+
'config/locales/en.yml',
|
61
|
+
'config/locales/es.yml',
|
62
|
+
'config/locales/fr.yml',
|
63
|
+
'config/locales/it.yml',
|
64
|
+
'config/locales/lolcat.yml',
|
65
|
+
'config/locales/lt.yml',
|
66
|
+
'config/locales/lv.yml',
|
67
|
+
'config/locales/nb.yml',
|
68
|
+
'config/locales/nl.yml',
|
69
|
+
'config/locales/pl.yml',
|
70
|
+
'config/locales/pt-BR.yml',
|
71
|
+
'config/locales/rs.yml',
|
72
|
+
'config/locales/ru.yml',
|
73
|
+
'config/locales/sl.yml',
|
74
|
+
'config/locales/sv.yml',
|
75
|
+
'config/locales/vi.yml',
|
76
|
+
'config/locales/zh-CN.yml',
|
77
|
+
'config/locales/zh-TW.yml',
|
78
|
+
'config/routes.rb',
|
79
|
+
'db',
|
80
|
+
'db/migrate',
|
81
|
+
'db/migrate/20100913234708_create_refinerycms_pages_schema.rb',
|
82
|
+
'db/migrate/20101214040815_translate_page_plugin.rb',
|
83
|
+
'db/migrate/20101216194133_remove_cached_slug_from_pages.rb',
|
84
|
+
'db/seeds',
|
85
|
+
'db/seeds/pages.rb',
|
86
|
+
'features',
|
87
|
+
'features/manage_pages.feature',
|
88
|
+
'features/step_definitions',
|
89
|
+
'features/step_definitions/page_steps.rb',
|
90
|
+
'features/support',
|
91
|
+
'features/support/paths.rb',
|
92
|
+
'features/visit_pages.feature',
|
93
|
+
'lib',
|
94
|
+
'lib/gemspec.rb',
|
95
|
+
'lib/generators',
|
96
|
+
'lib/generators/refinerycms_pages_generator.rb',
|
97
|
+
'lib/pages',
|
98
|
+
'lib/pages/marketable_routes.rb',
|
99
|
+
'lib/pages/tabs.rb',
|
100
|
+
'lib/refinerycms-pages.rb',
|
101
|
+
'license.md',
|
102
|
+
'readme.md',
|
103
|
+
'refinerycms-pages.gemspec',
|
104
|
+
'spec',
|
105
|
+
'spec/models',
|
106
|
+
'spec/models/page_spec.rb'
|
107
|
+
]
|
108
|
+
|
109
|
+
s.add_dependency 'refinerycms-core', '~> 0.9.9.1'
|
110
|
+
end
|
@@ -0,0 +1,144 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Page do
|
4
|
+
|
5
|
+
def reset_page(options = {})
|
6
|
+
@valid_attributes = {
|
7
|
+
:id => 1,
|
8
|
+
:title => "RSpec is great for testing too",
|
9
|
+
:deletable => true
|
10
|
+
}
|
11
|
+
|
12
|
+
@page.destroy! if @page
|
13
|
+
@page = Page.create!(@valid_attributes.update(options))
|
14
|
+
end
|
15
|
+
|
16
|
+
def page_cannot_be_destroyed
|
17
|
+
@page.destroy.should == false
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_child
|
21
|
+
@child = @page.children.create(:title => 'The child page')
|
22
|
+
end
|
23
|
+
|
24
|
+
def create_page_parts
|
25
|
+
@page.parts.create(:title => 'body', :content => "I'm the first page part for this page.")
|
26
|
+
@page.parts.create(:title => 'side body', :content => "Closely followed by the second page part.")
|
27
|
+
end
|
28
|
+
|
29
|
+
def turn_off_marketable_urls
|
30
|
+
RefinerySetting.set(:use_marketable_urls, {:value => false, :scoping => 'pages'})
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
before(:each) do
|
35
|
+
reset_page
|
36
|
+
end
|
37
|
+
|
38
|
+
context "cannot be deleted under certain rules" do
|
39
|
+
it "if link_url is present" do
|
40
|
+
reset_page({:link_url => '/plugin-name'})
|
41
|
+
page_cannot_be_destroyed
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
it "if refinery team deems it so" do
|
46
|
+
reset_page({:deletable => false})
|
47
|
+
page_cannot_be_destroyed
|
48
|
+
end
|
49
|
+
|
50
|
+
it "if menu_match is present" do
|
51
|
+
reset_page({:menu_match => '^/RSpec is great for testing too.*$'})
|
52
|
+
page_cannot_be_destroyed
|
53
|
+
end
|
54
|
+
|
55
|
+
it "unless you really want it to! >:]" do
|
56
|
+
reset_page
|
57
|
+
@page.destroy!
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
context "page urls" do
|
62
|
+
|
63
|
+
it "should return a full path" do
|
64
|
+
@page.path.should == 'RSpec is great for testing too'
|
65
|
+
end
|
66
|
+
|
67
|
+
it "and all of its parent page titles, reversed" do
|
68
|
+
create_child
|
69
|
+
@child.path.should == 'RSpec is great for testing too - The child page'
|
70
|
+
end
|
71
|
+
|
72
|
+
it "or normally ;-)" do
|
73
|
+
create_child
|
74
|
+
@child.path({:reversed => false}).should == 'The child page - RSpec is great for testing too'
|
75
|
+
end
|
76
|
+
|
77
|
+
it "should return its url" do
|
78
|
+
@page.link_url = '/contact'
|
79
|
+
@page.url.should == '/contact'
|
80
|
+
end
|
81
|
+
|
82
|
+
it "should return its path with marketable urls" do
|
83
|
+
@page.url[:id].should be_nil
|
84
|
+
@page.url[:path].should == ["rspec-is-great-for-testing-too"]
|
85
|
+
end
|
86
|
+
|
87
|
+
it "should not have a path without marketable urls" do
|
88
|
+
turn_off_marketable_urls
|
89
|
+
@page.url[:path].should be_nil
|
90
|
+
@page.url[:id].should == "rspec-is-great-for-testing-too"
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
context "home page" do
|
95
|
+
it "should respond as the home page" do
|
96
|
+
@page.link_url = '/'
|
97
|
+
@page.home?.should == true
|
98
|
+
end
|
99
|
+
|
100
|
+
it "should not respond as the home page" do
|
101
|
+
@page.home?.should == false
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
context "content sections (page parts)" do
|
106
|
+
it "should return the content when using []" do
|
107
|
+
create_page_parts
|
108
|
+
|
109
|
+
@page[:body].should == "<p>I'm the first page part for this page.</p>"
|
110
|
+
@page["BoDY"].should == "<p>I'm the first page part for this page.</p>"
|
111
|
+
end
|
112
|
+
|
113
|
+
it "should return all page part content" do
|
114
|
+
create_page_parts
|
115
|
+
|
116
|
+
@page.all_page_part_content.should == "<p>I'm the first page part for this page.</p> <p>Closely followed by the second page part.</p>"
|
117
|
+
end
|
118
|
+
|
119
|
+
it "should reposition correctly" do
|
120
|
+
create_page_parts
|
121
|
+
@page.parts.first.position = 6
|
122
|
+
@page.parts.last.position = 4
|
123
|
+
|
124
|
+
@page.parts.first.position.should == 6
|
125
|
+
@page.parts.last.position.should == 4
|
126
|
+
|
127
|
+
@page.reposition_parts!
|
128
|
+
|
129
|
+
@page.parts.first.position.should == 0
|
130
|
+
@page.parts.last.position.should == 1
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
context "draft pages" do
|
135
|
+
it "should not be a live page when set to draft" do
|
136
|
+
@page.draft = true
|
137
|
+
@page.live?.should == false
|
138
|
+
|
139
|
+
@page.draft = false
|
140
|
+
@page.live?.should == true
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
end
|
metadata
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: refinerycms-pages
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.9.9.1
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Resolve Digital
|
9
|
+
- Philip Arndt
|
10
|
+
- David Jones
|
11
|
+
- Steven Heidel
|
12
|
+
autorequire:
|
13
|
+
bindir: bin
|
14
|
+
cert_chain: []
|
15
|
+
|
16
|
+
date: 2011-02-15 00:00:00 +13:00
|
17
|
+
default_executable:
|
18
|
+
dependencies:
|
19
|
+
- !ruby/object:Gem::Dependency
|
20
|
+
name: refinerycms-core
|
21
|
+
prerelease: false
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 0.9.9.1
|
28
|
+
type: :runtime
|
29
|
+
version_requirements: *id001
|
30
|
+
description: The default content engine of Refinery CMS. This engine handles the administration and display of user-editable pages.
|
31
|
+
email: info@refinerycms.com
|
32
|
+
executables: []
|
33
|
+
|
34
|
+
extensions: []
|
35
|
+
|
36
|
+
extra_rdoc_files: []
|
37
|
+
|
38
|
+
files:
|
39
|
+
- app/controllers/admin/page_parts_controller.rb
|
40
|
+
- app/controllers/admin/pages_controller.rb
|
41
|
+
- app/controllers/admin/pages_dialogs_controller.rb
|
42
|
+
- app/controllers/pages_controller.rb
|
43
|
+
- app/helpers/pages_helper.rb
|
44
|
+
- app/models/page.rb
|
45
|
+
- app/models/page_part.rb
|
46
|
+
- app/presenters/page_presenter.rb
|
47
|
+
- app/views/admin/pages/_form.html.erb
|
48
|
+
- app/views/admin/pages/_form_advanced_options.html.erb
|
49
|
+
- app/views/admin/pages/_form_advanced_options_seo.html.erb
|
50
|
+
- app/views/admin/pages/_form_fields_after_title.html.erb
|
51
|
+
- app/views/admin/pages/_form_new_page_parts.html.erb
|
52
|
+
- app/views/admin/pages/_form_page_parts.html.erb
|
53
|
+
- app/views/admin/pages/_locale_picker.html.erb
|
54
|
+
- app/views/admin/pages/_page.html.erb
|
55
|
+
- app/views/admin/pages/_page_part_field.html.erb
|
56
|
+
- app/views/admin/pages/_sortable_list.html.erb
|
57
|
+
- app/views/admin/pages/edit.html.erb
|
58
|
+
- app/views/admin/pages/index.html.erb
|
59
|
+
- app/views/admin/pages/new.html.erb
|
60
|
+
- app/views/admin/pages_dialogs/_page_link.html.erb
|
61
|
+
- app/views/admin/pages_dialogs/link_to.html.erb
|
62
|
+
- app/views/pages/home.html.erb
|
63
|
+
- app/views/pages/show.html.erb
|
64
|
+
- config/locales/cs.yml
|
65
|
+
- config/locales/da.yml
|
66
|
+
- config/locales/de.yml
|
67
|
+
- config/locales/el.yml
|
68
|
+
- config/locales/en.yml
|
69
|
+
- config/locales/es.yml
|
70
|
+
- config/locales/fr.yml
|
71
|
+
- config/locales/it.yml
|
72
|
+
- config/locales/lolcat.yml
|
73
|
+
- config/locales/lt.yml
|
74
|
+
- config/locales/lv.yml
|
75
|
+
- config/locales/nb.yml
|
76
|
+
- config/locales/nl.yml
|
77
|
+
- config/locales/pl.yml
|
78
|
+
- config/locales/pt-BR.yml
|
79
|
+
- config/locales/rs.yml
|
80
|
+
- config/locales/ru.yml
|
81
|
+
- config/locales/sl.yml
|
82
|
+
- config/locales/sv.yml
|
83
|
+
- config/locales/vi.yml
|
84
|
+
- config/locales/zh-CN.yml
|
85
|
+
- config/locales/zh-TW.yml
|
86
|
+
- config/routes.rb
|
87
|
+
- db/migrate/20100913234708_create_refinerycms_pages_schema.rb
|
88
|
+
- db/migrate/20101214040815_translate_page_plugin.rb
|
89
|
+
- db/migrate/20101216194133_remove_cached_slug_from_pages.rb
|
90
|
+
- db/seeds/pages.rb
|
91
|
+
- features/manage_pages.feature
|
92
|
+
- features/step_definitions/page_steps.rb
|
93
|
+
- features/support/paths.rb
|
94
|
+
- features/visit_pages.feature
|
95
|
+
- lib/gemspec.rb
|
96
|
+
- lib/generators/refinerycms_pages_generator.rb
|
97
|
+
- lib/pages/marketable_routes.rb
|
98
|
+
- lib/pages/tabs.rb
|
99
|
+
- lib/refinerycms-pages.rb
|
100
|
+
- license.md
|
101
|
+
- readme.md
|
102
|
+
- refinerycms-pages.gemspec
|
103
|
+
- spec/models/page_spec.rb
|
104
|
+
has_rdoc: true
|
105
|
+
homepage: http://refinerycms.com
|
106
|
+
licenses:
|
107
|
+
- MIT
|
108
|
+
post_install_message:
|
109
|
+
rdoc_options: []
|
110
|
+
|
111
|
+
require_paths:
|
112
|
+
- lib
|
113
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: "0"
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: "0"
|
125
|
+
requirements: []
|
126
|
+
|
127
|
+
rubyforge_project: refinerycms
|
128
|
+
rubygems_version: 1.5.2
|
129
|
+
signing_key:
|
130
|
+
specification_version: 3
|
131
|
+
summary: Pages engine for Refinery CMS
|
132
|
+
test_files: []
|
133
|
+
|