refinerycms 0.9.6.1 → 0.9.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/config/environments/development.rb +8 -2
- data/db/seeds.rb +13 -12
- data/public/stylesheets/refinery/refinery.css +2 -2
- data/test/fixtures/page_parts.yml +2 -2
- data/vendor/plugins/images/images.md +3 -1
- data/vendor/plugins/pages/pages.md +2 -2
- data/vendor/plugins/refinery/app/views/shared/admin/_resource_picker.html.erb +2 -2
- data/vendor/plugins/refinery/lib/generators/refinery/templates/migration.rb +1 -1
- data/vendor/plugins/refinery/lib/generators/refinery/templates/model.rb +2 -2
- data/vendor/plugins/refinery/lib/generators/refinery/templates/public_controller.rb +7 -2
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/_form.html.erb +2 -2
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/index.html.erb +11 -15
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/show.html.erb +24 -22
- data/vendor/plugins/resources/app/views/admin/resources/insert.html.erb +10 -10
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.6.
|
1
|
+
0.9.6.2
|
@@ -16,5 +16,11 @@ config.action_controller.perform_caching = false
|
|
16
16
|
# Don't care if the mailer can't send
|
17
17
|
config.action_mailer.raise_delivery_errors = false
|
18
18
|
|
19
|
-
# Uncomment the following
|
20
|
-
#
|
19
|
+
# Uncomment the following lines if you're getting
|
20
|
+
# "A copy of XX has been removed from the module tree but is still active!"
|
21
|
+
# or you want to develop a plugin and don't want to restart every time a change is made:
|
22
|
+
#config.after_initialize do
|
23
|
+
# ::ActiveSupport::Dependencies.load_once_paths = ::ActiveSupport::Dependencies.load_once_paths.select do |path|
|
24
|
+
# (path =~ /app/).nil?
|
25
|
+
# end
|
26
|
+
#end
|
data/db/seeds.rb
CHANGED
@@ -26,11 +26,11 @@ Page.create(:title => "Home",
|
|
26
26
|
:menu_match => "^/$",
|
27
27
|
:position => 0).parts.create(
|
28
28
|
{
|
29
|
-
:title => "
|
29
|
+
:title => "Body",
|
30
30
|
:body => "<p>Welcome to our site. This is just a place holder page while we gather our content.</p>"
|
31
31
|
}).page.parts.create(
|
32
32
|
{
|
33
|
-
:title => "
|
33
|
+
:title => "Side Body",
|
34
34
|
:body => "<p>This is another block of content over here.</p>"
|
35
35
|
})
|
36
36
|
|
@@ -38,11 +38,11 @@ Page.create(:title => "About Us",
|
|
38
38
|
:deletable => true,
|
39
39
|
:position => 1).parts.create(
|
40
40
|
{
|
41
|
-
:title => "
|
41
|
+
:title => "Body",
|
42
42
|
:body => "<p>This is just a standard text page example. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin metus dolor, hendrerit sit amet, aliquet nec, posuere sed, purus. Nullam et velit iaculis odio sagittis placerat. Duis metus tellus, pellentesque ut, luctus id, egestas a, lorem. Praesent vitae mauris. Aliquam sed nulla. Sed id nunc vitae leo suscipit viverra. Proin at leo ut lacus consequat rhoncus. In hac habitasse platea dictumst. Nunc quis tortor sed libero hendrerit dapibus.\n\nInteger interdum purus id erat. Duis nec velit vitae dolor mattis euismod. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse pellentesque dignissim lacus. Nulla semper euismod arcu. Suspendisse egestas, erat a consectetur dapibus, felis orci cursus eros, et sollicitudin purus urna et metus. Integer eget est sed nunc euismod vestibulum. Integer nulla dui, tristique in, euismod et, interdum imperdiet, enim. Mauris at lectus. Sed egestas tortor nec mi.</p>"
|
43
43
|
}).page.parts.create(
|
44
44
|
{
|
45
|
-
:title => "
|
45
|
+
:title => "Side Body",
|
46
46
|
:body => "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus fringilla nisi a elit. Duis ultricies orci ut arcu. Ut ac nibh. Duis blandit rhoncus magna. Pellentesque semper risus ut magna. Etiam pulvinar tellus eget diam. Morbi blandit. Donec pulvinar mauris at ligula. Sed pellentesque, ipsum id congue molestie, lectus risus egestas pede, ac viverra diam lacus ac urna. Aenean elit.</p>"
|
47
47
|
})
|
48
48
|
|
@@ -56,7 +56,7 @@ Page.create(:title => "News",
|
|
56
56
|
:body => "<p>Want to know the latest? Here's what has been happening.</p>"
|
57
57
|
}).page.parts.create(
|
58
58
|
{
|
59
|
-
:title => "
|
59
|
+
:title => "Side Body",
|
60
60
|
:body => "<p>Here we post up the latest about us, along with events and updates you don't want to miss!</p>"
|
61
61
|
})
|
62
62
|
|
@@ -66,11 +66,11 @@ Page.create(:title => "Contact Us",
|
|
66
66
|
:deletable => false,
|
67
67
|
:position => 4).parts.create(
|
68
68
|
{
|
69
|
-
:title => "
|
69
|
+
:title => "Body",
|
70
70
|
:body => "<p>Get in touch with us. Just use the form below and we'll get back to you as soon as we can.</p>"
|
71
71
|
}).page.parts.create(
|
72
72
|
{
|
73
|
-
:title => "
|
73
|
+
:title => "Side Body",
|
74
74
|
:body => "<p>163 Evergreen Terrace<br/>Happyville<br/>USA.<br/>Phone: 1-800 CALLUSNOW</p>"
|
75
75
|
})
|
76
76
|
|
@@ -81,7 +81,7 @@ Page.create(:title => "Thank You",
|
|
81
81
|
:position => 0,
|
82
82
|
:parent_id => 4).parts.create(
|
83
83
|
{
|
84
|
-
:title => "
|
84
|
+
:title => "Body",
|
85
85
|
:body => "<p>We've received your inquiry and will get back to you with a response shortly.</p><p><a href='/'>Return to the home page</a></p>"
|
86
86
|
})
|
87
87
|
|
@@ -91,7 +91,7 @@ Page.create(:title => "Page not found",
|
|
91
91
|
:deletable => false,
|
92
92
|
:position => 5).parts.create(
|
93
93
|
{
|
94
|
-
:title => "
|
94
|
+
:title => "Body",
|
95
95
|
: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>"
|
96
96
|
})
|
97
97
|
|
@@ -100,11 +100,11 @@ Page.create(:title => "Privacy Policy",
|
|
100
100
|
:show_in_menu => false,
|
101
101
|
:position => 6).parts.create(
|
102
102
|
{
|
103
|
-
:title => "
|
103
|
+
:title => "Body",
|
104
104
|
:body => "<p><strong>We respect your privacy. We do not market, rent or sell our email list to any outside parties.</p><p>We need your e-mail address so that we can ensure that the people using our forms are bona fide. It also allows us to send you e-mail newsletters and other communications, if you opt-in. Your postal address is required in order to send you information and pricing, if you request it.</p><p>Please call us at 123 456 7890 if you have any questions or concerns.</p>"
|
105
105
|
}).page.parts.create(
|
106
106
|
{
|
107
|
-
:title => "
|
107
|
+
:title => "Side Body",
|
108
108
|
:body => ""
|
109
109
|
})
|
110
110
|
|
@@ -113,11 +113,12 @@ Page.create(:title => "Down for maintenance",
|
|
113
113
|
:show_in_menu => false,
|
114
114
|
:position => 7).parts.create(
|
115
115
|
{
|
116
|
-
:title => "
|
116
|
+
:title => "Body",
|
117
117
|
:body => "<p>Our site is currently down for maintenance. Please try back later.</p>"
|
118
118
|
})
|
119
119
|
|
120
120
|
# Install default themes.
|
121
|
+
FileUtils::mkdir File.join(%W(#{RAILS_ROOT} themes)) unless File.directory? File.join(%W(#{RAILS_ROOT} themes))
|
121
122
|
Dir[File.join(%W(#{REFINERY_ROOT} themes *.zip))].each do |theme|
|
122
123
|
Theme.create(:uploaded_data => {
|
123
124
|
"size" => File.size(theme),
|
@@ -789,13 +789,13 @@ body.dialog form {
|
|
789
789
|
/*bottom: 0px;*/
|
790
790
|
/*right: 0px;*/
|
791
791
|
text-align: right;
|
792
|
-
|
792
|
+
float: right;
|
793
793
|
/*position: absolute;*/
|
794
794
|
margin: 0px;
|
795
795
|
width: 763px;
|
796
796
|
}
|
797
797
|
|
798
|
-
#upload_image_area {
|
798
|
+
#upload_image_area, #upload_resource_area {
|
799
799
|
padding: 12px;
|
800
800
|
}
|
801
801
|
|
@@ -41,7 +41,9 @@ _Note: you will have to restart your web server after changing this setting for
|
|
41
41
|
|
42
42
|
Take the default thumbnails above to use the ``:side_body`` thumbnail I would collect that image out of the database and apply it like this in my view:
|
43
43
|
|
44
|
-
<%=
|
44
|
+
<%= image_fu @image, :side_body %>
|
45
|
+
|
46
|
+
image_fu is a command we have created that automatically adds width and height attributes to the generated image so that web browsers render your pages more smoothly as they know in advance how big an image is going to be before it is fully downloaded.
|
45
47
|
|
46
48
|
## Related Settings
|
47
49
|
|
@@ -21,8 +21,8 @@ Think of a page part is a single piece of content on your page. At [Resolve Digi
|
|
21
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
22
|
|
23
23
|
---
|
24
|
-
-
|
25
|
-
-
|
24
|
+
- Body
|
25
|
+
- Side Body
|
26
26
|
|
27
27
|
Edit this setting to suit your taste.
|
28
28
|
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<% content_for :head do %>
|
25
25
|
<script type='text/javascript'>
|
26
26
|
resource_changed = function() {
|
27
|
-
$('#current_resource_link').attr('href', $('#current_resource_link').attr('href').replace(/current_link=([^&])*&/, "current_link=" + $('#current_resource').attr('href') + "&");
|
27
|
+
$('#current_resource_link').attr('href', $('#current_resource_link').attr('href').replace(/current_link=([^&])*&/, "current_link=" + $('#current_resource').attr('href') + "&"));
|
28
28
|
$('#remove_resource').show();
|
29
29
|
$('#current_resource_container').show();
|
30
30
|
$('#no_resource_selected').hide();
|
@@ -36,7 +36,7 @@
|
|
36
36
|
$('#current_resource_container').hide();
|
37
37
|
$('#current_resource_text').innerHTML = '';
|
38
38
|
$('#no_resource_selected').show();
|
39
|
-
$('#current_resource_link').attr('href', $('#current_resource_link').attr('href').replace(/current_link=([^&])*&/, "current_link=&");
|
39
|
+
$('#current_resource_link').attr('href', $('#current_resource_link').attr('href').replace(/current_link=([^&])*&/, "current_link=&"));
|
40
40
|
$(this).hide();
|
41
41
|
e.preventDefault();
|
42
42
|
});
|
@@ -23,7 +23,7 @@ class <%= migration_name %> < ActiveRecord::Migration
|
|
23
23
|
:position => ((Page.maximum(:position, :conditions => "parent_id IS NULL") || -1)+1),
|
24
24
|
:menu_match => "^/<%= plural_name %>(\/|\/.+?|)$"
|
25
25
|
)
|
26
|
-
RefinerySetting.find_or_set(:default_page_parts, ["
|
26
|
+
RefinerySetting.find_or_set(:default_page_parts, ["Body", "Side Body"]).each do |default_page_part|
|
27
27
|
page.parts.create(:title => default_page_part, :body => nil)
|
28
28
|
end
|
29
29
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
class <%= class_name %> < ActiveRecord::Base
|
2
2
|
|
3
3
|
acts_as_indexed :fields => [:<%= attributes.collect{ |attribute| attribute.name if attribute.type.to_s =~ /string|text/ }.compact.uniq.join(", :") %>],
|
4
|
-
|
4
|
+
:index_file => %W(#{RAILS_ROOT} tmp index)
|
5
5
|
|
6
6
|
validates_presence_of :<%= attributes.first.name %>
|
7
7
|
validates_uniqueness_of :<%= attributes.first.name %>
|
8
8
|
|
9
|
-
end
|
9
|
+
end
|
@@ -1,14 +1,15 @@
|
|
1
1
|
class <%= class_name.pluralize %>Controller < ApplicationController
|
2
2
|
|
3
|
+
before_filter :find_all_<%= plural_name %>
|
3
4
|
before_filter :find_page
|
4
5
|
|
5
6
|
def index
|
6
|
-
|
7
|
+
# you can use meta fields from your model instead (e.g. browser_title)
|
8
|
+
# by swapping @page for @<%= singular_name %> in the line below:
|
7
9
|
present(@page)
|
8
10
|
end
|
9
11
|
|
10
12
|
def show
|
11
|
-
@<%= plural_name %> = <%= class_name %>.find(:all, :order => "position ASC") # for body_content_right
|
12
13
|
@<%= singular_name %> = <%= class_name %>.find(params[:id])
|
13
14
|
|
14
15
|
# you can use meta fields from your model instead (e.g. browser_title)
|
@@ -18,6 +19,10 @@ class <%= class_name.pluralize %>Controller < ApplicationController
|
|
18
19
|
|
19
20
|
protected
|
20
21
|
|
22
|
+
def find_all_<%= plural_name %>
|
23
|
+
@<%= plural_name %> = <%= class_name %>.find(:all, :order => "position ASC")
|
24
|
+
end
|
25
|
+
|
21
26
|
def find_page
|
22
27
|
@page = Page.find_by_link_url("/<%= plural_name %>")
|
23
28
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
<%%= error_messages_for :<%= singular_name %> -%>
|
2
2
|
<%% form_for [:admin, @<%= singular_name %>] do |f| -%>
|
3
|
-
<% attributes.
|
3
|
+
<% attributes.each_with_index do |attribute, index| %>
|
4
4
|
<div class='field'>
|
5
5
|
<%%= f.label :<%= attribute.name %> -%>
|
6
6
|
<% if attribute.field_type.to_s == "text_area" -%>
|
7
7
|
<%%= f.text_area :<%= attribute.name %>, :rows => 20, :cols => 140, :class => 'wymeditor' -%>
|
8
8
|
<% else -%>
|
9
|
-
<%%= f.<%= attribute.field_type -%> :<%= attribute.name -%> -%>
|
9
|
+
<%%= f.<%= attribute.field_type -%> :<%= attribute.name -%><%= ", :class => 'larger'" if (index == 0 && attribute.field_type == :text_field) -%> -%>
|
10
10
|
<% end -%>
|
11
11
|
</div>
|
12
12
|
<% end %>
|
@@ -1,15 +1,11 @@
|
|
1
|
-
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
<div id='body_content_right' class='clearfix'>
|
13
|
-
|
14
|
-
</div>
|
15
|
-
</div>
|
1
|
+
<%% content_for :body_content_left do %>
|
2
|
+
<ul id="<%= plural_name %>">
|
3
|
+
<%% @<%= plural_name %>.each do |<%= singular_name %>| %>
|
4
|
+
<li>
|
5
|
+
<%%= link_to <%= singular_name %>.<%= attributes.first.name %>, <%= singular_name %>_url(<%= singular_name %>) %>
|
6
|
+
</li>
|
7
|
+
<%% end %>
|
8
|
+
</ul>
|
9
|
+
<%% end %>
|
10
|
+
|
11
|
+
<%%= render :partial => "/shared/content_page" %>
|
@@ -1,23 +1,25 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
</div>
|
11
|
-
<% end %>
|
1
|
+
<%% content_for :body_content_title do %>
|
2
|
+
<%%= @<%= singular_name %>.<%= attributes.first.name %> %>
|
3
|
+
<%% end %>
|
4
|
+
|
5
|
+
<%% content_for :body_content_left do %>
|
6
|
+
<% attributes.each do |attribute| %>
|
7
|
+
<div>
|
8
|
+
<h3><%= attribute.name.titleize %></h3>
|
9
|
+
<%%= @<%= singular_name %>.<%= attribute.name %> %>
|
12
10
|
</div>
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
11
|
+
<% end %>
|
12
|
+
<%% end %>
|
13
|
+
|
14
|
+
<%% content_for :body_content_right do %>
|
15
|
+
<h2>Other <%= $title_name.pluralize %></h2>
|
16
|
+
<ul id="<%= plural_name %>">
|
17
|
+
<%% @<%= plural_name %>.each do |<%= singular_name %>| %>
|
18
|
+
<li>
|
19
|
+
<%%= link_to <%= singular_name %>.<%= attributes.first.name %>, <%= singular_name %>_url(<%= singular_name %>) %>
|
20
|
+
</li>
|
21
|
+
<%% end %>
|
22
|
+
</ul>
|
23
|
+
<%% end %>
|
24
|
+
|
25
|
+
<%%= render :partial => "/shared/content_page" %>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<label for='resource_type_existing' class='stripped'>Existing File</label>
|
7
7
|
</span>
|
8
8
|
<% end %>
|
9
|
-
<span id='upload_resource_radio' class='radio<%= " selected_radio" if @resource.errors.size > 0 %>'>
|
9
|
+
<span id='upload_resource_radio' class='radio<%= " selected_radio" if @resource.errors.size > 0 or @resources.empty? %>'>
|
10
10
|
<input type='radio' name='resource_type' value='upload_resource' id='resource_type_upload' <%= "checked='true'" if @resources.empty? or !@resource.errors.empty? %> />
|
11
11
|
<label for='resource_type_upload' class='stripped'>New File</label>
|
12
12
|
</span>
|
@@ -29,14 +29,14 @@
|
|
29
29
|
</ul>
|
30
30
|
</div>
|
31
31
|
</div>
|
32
|
-
<%= will_paginate @resources,
|
33
|
-
:previous_label => '« Previous',
|
34
|
-
:next_label => 'Next »',
|
35
|
-
:renderer => Refinery::LinkRenderer,
|
32
|
+
<%= will_paginate @resources,
|
33
|
+
:previous_label => '« Previous',
|
34
|
+
:next_label => 'Next »',
|
35
|
+
:renderer => Refinery::LinkRenderer,
|
36
36
|
:url => {:controller => "admin/resources", :action => "insert", :dialog => from_dialog?} unless @thickbox %>
|
37
37
|
</div>
|
38
38
|
<% end %>
|
39
|
-
<div id='upload_resource_area' class='dialog_area' <%= "style='display:none;'"
|
39
|
+
<div id='upload_resource_area' class='dialog_area' <%= "style='display:none;'" unless @resources.empty? %>>
|
40
40
|
<%= render :partial => "form", :locals => {:insert => true} %>
|
41
41
|
</div>
|
42
42
|
</div>
|
@@ -47,10 +47,10 @@
|
|
47
47
|
or
|
48
48
|
<%= link_to "Cancel", "", :id => "cancel_button", :class => "close_dialog" %>
|
49
49
|
|
50
|
-
<%= will_paginate @resources,
|
51
|
-
:previous_label => '« Previous',
|
52
|
-
:next_label => 'Next »',
|
53
|
-
:renderer => Refinery::LinkRenderer,
|
50
|
+
<%= will_paginate @resources,
|
51
|
+
:previous_label => '« Previous',
|
52
|
+
:next_label => 'Next »',
|
53
|
+
:renderer => Refinery::LinkRenderer,
|
54
54
|
:url => {:controller => "admin/resources", :action => "insert", :dialog => from_dialog? } %>
|
55
55
|
</div>
|
56
56
|
<% end %>
|