refinerycms 0.9.5.31 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/VERSION +1 -1
- data/bin/refinery +2 -1
- data/config/environment.rb +1 -1
- data/config/environments/development.rb +3 -0
- data/contributors.md +2 -0
- data/db/migrate/20100202034802_remove_custom_title_image_id_and_image_id_from_pages.rb +13 -0
- data/db/migrate/20100204011654_change_part_titles_to_titleized_version_for_new_format.rb +13 -0
- data/db/schema.rb +6 -10
- data/public/javascripts/admin.js +1 -1
- data/public/javascripts/jquery-ui-1.8rc1.min.js +375 -0
- data/public/javascripts/jquery.js +4231 -2529
- data/public/javascripts/refinery/admin.js +609 -38
- data/public/javascripts/refinery/boot_wym.js +3 -3
- data/public/javascripts/thickbox.js +116 -129
- data/public/javascripts/wymeditor/jquery.refinery.wymeditor.js +3674 -3732
- data/public/javascripts/wymeditor/skins/refinery/skin.js +8 -8
- data/public/stylesheets/refinery/refinery.css +142 -32
- data/public/stylesheets/wymeditor/skins/refinery/skin.css +8 -1
- data/readme.md +35 -21
- data/test/fixtures/page_parts.yml +9 -0
- data/test/fixtures/pages.yml +88 -0
- data/test/performance/browsing_test.rb +9 -0
- data/test/test_helper.rb +38 -0
- data/test/unit/image_test.rb +14 -0
- data/test/unit/page_part_test.rb +19 -0
- data/test/unit/page_test.rb +130 -0
- data/vendor/plugins/authentication/app/controllers/sessions_controller.rb +1 -1
- data/vendor/plugins/authentication/app/views/admin/users/index.html.erb +1 -2
- data/vendor/plugins/authentication/authentication.md +9 -1
- data/vendor/plugins/dashboard/dashboard.md +3 -3
- data/vendor/plugins/images/app/controllers/admin/images_controller.rb +17 -13
- data/vendor/plugins/images/app/helpers/admin/images_helper.rb +6 -0
- data/vendor/plugins/images/app/models/image.rb +24 -39
- data/vendor/plugins/images/app/views/admin/images/_form.html.erb +11 -4
- data/vendor/plugins/images/app/views/admin/images/_grid_view.html.erb +1 -2
- data/vendor/plugins/images/app/views/admin/images/_list_view_image.html.erb +1 -2
- data/vendor/plugins/images/app/views/admin/images/index.html.erb +1 -1
- data/vendor/plugins/images/app/views/admin/images/insert.html.erb +8 -71
- data/vendor/plugins/images/images.md +12 -7
- data/vendor/plugins/inquiries/app/views/admin/inquiries/_inquiry.html.erb +6 -13
- data/vendor/plugins/inquiries/app/views/admin/inquiry_settings/index.html.erb +1 -2
- data/vendor/plugins/inquiries/inquiries.md +8 -8
- data/vendor/plugins/news/app/views/admin/news_items/_news_item.html.erb +1 -2
- data/vendor/plugins/news/news.md +4 -4
- data/vendor/plugins/pages/app/controllers/admin/page_dialogs_controller.rb +11 -10
- data/vendor/plugins/pages/app/controllers/admin/page_parts_controller.rb +5 -1
- data/vendor/plugins/pages/app/controllers/admin/pages_controller.rb +2 -2
- data/vendor/plugins/pages/app/models/page.rb +75 -29
- data/vendor/plugins/pages/app/models/page_part.rb +1 -1
- data/vendor/plugins/pages/app/views/admin/page_dialogs/_page_link.html.erb +2 -2
- data/vendor/plugins/pages/app/views/admin/page_dialogs/link_to.html.erb +8 -112
- data/vendor/plugins/pages/app/views/admin/pages/_form.html.erb +50 -154
- data/vendor/plugins/pages/app/views/admin/pages/_list.html.erb +10 -10
- data/vendor/plugins/pages/app/views/admin/pages/_page_part_field.html.erb +4 -4
- data/vendor/plugins/pages/app/views/admin/pages/_sortable_list.html.erb +1 -1
- data/vendor/plugins/pages/pages.md +30 -25
- data/vendor/plugins/refinery/app/views/admin/_head.html.erb +5 -14
- data/vendor/plugins/refinery/app/views/admin/_menu.html.erb +2 -64
- data/vendor/plugins/refinery/app/views/shared/_message.html.erb +0 -6
- data/vendor/plugins/refinery/app/views/shared/admin/_error_messages_for.html.erb +1 -6
- data/vendor/plugins/refinery/app/views/shared/admin/_form_actions.html.erb +8 -10
- data/vendor/plugins/refinery/app/views/shared/admin/_image_picker.html.erb +22 -38
- data/vendor/plugins/refinery/app/views/shared/admin/_make_sortable.html.erb +6 -65
- data/vendor/plugins/refinery/app/views/shared/admin/_resource_picker.html.erb +16 -16
- data/vendor/plugins/refinery/app/views/shared/admin/_sortable_list.html.erb +3 -4
- data/vendor/plugins/refinery/lib/crud.rb +1 -1
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/_singular_name.html.erb +1 -1
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/_sortable_list.html.erb +1 -1
- data/vendor/plugins/refinery/plugins.md +19 -12
- data/vendor/plugins/refinery_dialogs/app/controllers/admin/dialogs_controller.rb +6 -4
- data/vendor/plugins/refinery_dialogs/app/views/admin/dialogs/show.html.erb +3 -3
- data/vendor/plugins/refinery_dialogs/app/views/layouts/admin_dialog.html.erb +7 -14
- data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/_refinery_setting.html.erb +1 -1
- data/vendor/plugins/refinery_settings/settings.md +51 -1
- data/vendor/plugins/resources/app/controllers/admin/resources_controller.rb +16 -11
- data/vendor/plugins/resources/app/views/admin/resources/_form.html.erb +9 -2
- data/vendor/plugins/resources/app/views/admin/resources/_resource.html.erb +1 -3
- data/vendor/plugins/resources/app/views/admin/resources/index.html.erb +2 -2
- data/vendor/plugins/resources/app/views/admin/resources/insert.html.erb +14 -60
- data/vendor/plugins/resources/resources.md +1 -1
- data/vendor/plugins/themes/app/controllers/admin/themes_controller.rb +6 -6
- data/vendor/plugins/themes/app/models/theme.rb +3 -3
- data/vendor/plugins/themes/app/views/admin/themes/_theme.html.erb +14 -20
- data/vendor/plugins/themes/themes.md +21 -19
- metadata +18 -19
- data/public/javascripts/builder.js +0 -136
- data/public/javascripts/controls.js +0 -963
- data/public/javascripts/dragdrop.js +0 -973
- data/public/javascripts/effects.js +0 -1128
- data/public/javascripts/fastinit.js +0 -84
- data/public/javascripts/livepipe.js +0 -180
- data/public/javascripts/prototype.js +0 -4874
- data/public/javascripts/refinery/dialog.js +0 -52
- data/public/javascripts/refinery/parse_url.js +0 -38
- data/public/javascripts/refinery/prototype.enhancements.js +0 -24
- data/public/javascripts/refinery/tooltips.js +0 -173
- data/public/javascripts/scriptaculous.js +0 -47
- data/public/javascripts/slider.js +0 -275
- data/public/javascripts/tabs.js +0 -149
- data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/_make_sortable.html.erb +0 -7
@@ -5,7 +5,7 @@
|
|
5
5
|
"branch_start"
|
6
6
|
end
|
7
7
|
-%>
|
8
|
-
<li class='
|
8
|
+
<li class='record<%= " #{branch}" %>' id="<%= dom_id(page) -%>">
|
9
9
|
<div class='clearfix'>
|
10
10
|
<span class='actions'>
|
11
11
|
<%= link_to refinery_icon_tag('application_go.png'), page.url, :target => "_blank",
|
@@ -13,17 +13,17 @@
|
|
13
13
|
<%= link_to refinery_icon_tag('application_edit.png'), edit_admin_page_path(page),
|
14
14
|
:title => "Edit this page" %>
|
15
15
|
<%= link_to refinery_icon_tag('delete.png'), admin_page_path(page),
|
16
|
-
|
17
|
-
|
18
|
-
:title => "Remove this page forever" if page.deletable? %>
|
16
|
+
:class => "cancel confirm-delete",
|
17
|
+
:title => "Remove this page forever" if page.deletable? %>
|
19
18
|
</span>
|
20
19
|
<%= h page.title %> <%= "<em>(hidden)</em>" unless page.show_in_menu? %>
|
21
20
|
<%= "<em>(draft)</em>" if page.draft? %>
|
22
21
|
</div>
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
<% unless (children = page.children).empty? %>
|
23
|
+
<ul<%= " class='nested'" %>>
|
24
|
+
<% children.each do |child| %>
|
25
|
+
<%= render :partial => 'list', :locals => {:page => child} %>
|
26
|
+
<% end %>
|
27
|
+
</ul>
|
26
28
|
<% end %>
|
27
|
-
|
28
|
-
</ul>
|
29
|
-
</li>
|
29
|
+
</li>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div class='page_part field' id='
|
2
|
-
<%= hidden_field_tag "page[parts_attributes][#{part_index}][title]", title if new_part %>
|
3
|
-
<%= text_area_tag "page[parts_attributes][#{part_index}][body]", body, :rows => 20, :cols => 140, :class => 'wymeditor' %>
|
4
|
-
</div>
|
1
|
+
<div class='page_part field' id='<%= new_part ? "page_part_new_#{part_index}" : dom_id(part) %>'>
|
2
|
+
<%= hidden_field_tag "page[parts_attributes][#{part_index}][title]", part.title if new_part %>
|
3
|
+
<%= text_area_tag "page[parts_attributes][#{part_index}][body]", part.body, :rows => 20, :cols => 140, :class => 'wymeditor' %>
|
4
|
+
</div>
|
@@ -1,4 +1,4 @@
|
|
1
1
|
<% @pages.each do |page| %>
|
2
2
|
<%= render :partial => 'list', :locals => {:page => page} %>
|
3
3
|
<% end %>
|
4
|
-
<%= render :partial => "/shared/admin/sortable_list" %>
|
4
|
+
<%= render :partial => "/shared/admin/sortable_list", :locals => {:continue_reordering => (defined?(continue_reordering) ? continue_reordering : true)} %>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
## About
|
6
6
|
|
7
|
-
One core part of is Pages. Plugins such as
|
7
|
+
One core part of is Pages. Plugins such as News and Inquiries hook to pages. The menu is rendered based off the structure of your pages.
|
8
8
|
|
9
9
|
Pages have one key thing about them that is unique - page parts.
|
10
10
|
|
@@ -12,25 +12,31 @@ Pages have one key thing about them that is unique - page parts.
|
|
12
12
|
|
13
13
|
![Refinery Page Parts](http://refinerycms.com/system/images/0000/0586/editing-page.png)
|
14
14
|
|
15
|
-
### What are they
|
15
|
+
### What are they?
|
16
16
|
|
17
17
|
Think of a page part is a single piece of content on your page. At [Resolve Digital](http://www.resolvedigital.co.nz) 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
18
|
|
19
19
|
### Default Page Parts
|
20
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
|
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
24
|
- body
|
25
25
|
- side_body
|
26
26
|
|
27
|
-
|
27
|
+
Edit this setting to suit your taste.
|
28
28
|
|
29
|
-
### Adding Page Parts for
|
29
|
+
### Adding Page Parts for Specific Pages
|
30
30
|
|
31
|
-
You can add extra page parts to your pages by setting the "New Page Parts" to ``true
|
31
|
+
You can add extra page parts to your pages by setting the "New Page Parts" to ``true``.
|
32
32
|
|
33
|
-
|
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"._
|
34
40
|
|
35
41
|
## Page Options
|
36
42
|
|
@@ -44,36 +50,35 @@ There are three options for how the page title will be rendered on the front end
|
|
44
50
|
|
45
51
|
* ``None``: will just default to the page title
|
46
52
|
* ``Text``: allows you to have a different name for the page in the backend to the front end (sometimes good for SEO)
|
47
|
-
* ``Image``: If
|
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_)
|
48
54
|
|
49
|
-
### Show in
|
55
|
+
### Show in Menu
|
50
56
|
|
51
|
-
You can hide a page from the navigation if you like by unchecking "show in menu"
|
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.
|
52
58
|
|
53
59
|
### Custom URL
|
54
60
|
|
55
|
-
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
|
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.
|
56
62
|
|
57
|
-
The "contact us" page for example has a Custom URL of ``/inquiries/new
|
63
|
+
The "contact us" page for example has a Custom URL of ``/inquiries/new``, this is because we want it to load the inquiries form from the inquiries plugin instead.
|
58
64
|
|
59
65
|
### WYMEditor (the visual editor)
|
60
66
|
|
61
67
|
Refinery is backed by [WYMEditor](http://www.wymeditor.org/)
|
62
68
|
|
63
|
-
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
|
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/).
|
64
70
|
|
65
|
-
You can also switch to "source" view and edit XHTML manually.
|
71
|
+
You can also switch to "source" view and edit XHTML manually if the visual editor is not playing nice.
|
66
72
|
|
67
|
-
### Custom
|
73
|
+
### Custom Selectable Styles in WYMEditor
|
68
74
|
|
69
75
|
![Refinery Page Editor Styles](http://refinerycms.com/system/images/0000/0596/editing-page-style.png)
|
70
76
|
|
71
|
-
Some sites require a little more than just your standard bold and heading controls. This is where the "css" style drop down comes in
|
77
|
+
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.
|
72
78
|
|
73
|
-
It allows your
|
79
|
+
It allows your users to select a style you define. You need to edit/create a CSS file called ``theme.css``.
|
74
80
|
|
75
|
-
|
76
|
-
2. ``/themes/your_theme_name/stylesheets/themes.css``
|
81
|
+
This file should be located in ``/public/stylesheets/themes.css``
|
77
82
|
|
78
83
|
Inside that file you define your styles like this
|
79
84
|
|
@@ -81,7 +86,7 @@ Inside that file you define your styles like this
|
|
81
86
|
// apply your CSS rules here
|
82
87
|
}
|
83
88
|
|
84
|
-
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
|
89
|
+
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
|
85
90
|
|
86
91
|
.text-highlight-yellow {
|
87
92
|
background: LightYellow;
|
@@ -97,7 +102,7 @@ Currently your ``admin.js`` file will have something like this
|
|
97
102
|
, {name: 'font-size', rules:['small','normal','large'], join: '-'}
|
98
103
|
]
|
99
104
|
|
100
|
-
Let's just breakdown a single WYMeditor
|
105
|
+
Let's just breakdown a single WYMeditor line and understand it:
|
101
106
|
|
102
107
|
{name: 'font-size', rules:['small','normal','large'], join: '-'}
|
103
108
|
|
@@ -107,7 +112,7 @@ Let's just breakdown a single WYMeditor class line and understand it:
|
|
107
112
|
.font-size-normal { // CSS rules here }
|
108
113
|
.font-size-large { // CSS rules here }
|
109
114
|
|
110
|
-
So going back to our text highlighting above we make the new style show up in the editor by changing our ``admin.js`` file to:
|
115
|
+
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:
|
111
116
|
|
112
117
|
var wymeditorClassesItems = [
|
113
118
|
{name: 'text-align', rules:['left', 'center', 'right', 'justify'], join: '-'}
|
@@ -122,7 +127,7 @@ So going back to our text highlighting above we make the new style show up in th
|
|
122
127
|
|
123
128
|
## Page Link dialog
|
124
129
|
|
125
|
-
The link dialog lets you link in several different ways
|
130
|
+
The link dialog lets you link in several different ways:
|
126
131
|
|
127
132
|
* To an internal page
|
128
133
|
* To an external page
|
@@ -135,7 +140,7 @@ Simply lets you select from an existing image found in the Images tab or upload
|
|
135
140
|
|
136
141
|
## Refinery Default Pages
|
137
142
|
|
138
|
-
Some pages you have to keep in order for Refinery to fully
|
143
|
+
Some pages you have to keep in order for Refinery to stay fully functional:
|
139
144
|
|
140
|
-
* Page not found - the default 404 page
|
145
|
+
* Page not found - the default 404 page
|
141
146
|
* Down for maintenance - renders when you're site is being updated.
|
@@ -7,22 +7,13 @@
|
|
7
7
|
<% if (using_google_libs = RefinerySetting.find_or_set(:use_google_ajax_libraries, true)) and !local_request? -%>
|
8
8
|
<script type='text/javascript' src="http://www.google.com/jsapi"></script>
|
9
9
|
<script type='text/javascript'>
|
10
|
-
google.load("
|
11
|
-
google.load("
|
12
|
-
google.load("jquery", "1.3");
|
10
|
+
google.load("jquery", "1.4");
|
11
|
+
google.load("jqueryui", "1.8");
|
13
12
|
</script>
|
14
13
|
<% end %>
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
<% else %>
|
19
|
-
<%= javascript_include_tag 'prototype', 'scriptaculous', 'jquery' %>
|
20
|
-
<% end %>
|
21
|
-
<% end %>
|
22
|
-
<script type='text/javascript'>jQuery.noConflict();</script>
|
23
|
-
<%= javascript_include_tag 'admin' %>
|
24
|
-
<%= javascript_include_tag 'refinery/prototype.enhancements.js', 'fastinit', 'refinery/tooltips', 'livepipe', 'tabs', 'thickbox', "wymeditor/jquery.refinery.wymeditor.js", 'refinery/boot_wym', 'refinery/admin', :cache => (use_caching ? "cache/admin" : false) %>
|
25
|
-
<%= "<script type='text/javascript' src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>" if RefinerySetting.find_or_set(:show_firebug_lite, false) == true -%>
|
14
|
+
<%= javascript_include_tag 'jquery', 'jquery-ui-1.8rc1.min.js', :cache => (use_caching ? "cache/libraries" : nil) if !using_google_libs or local_request? %>
|
15
|
+
<%= javascript_include_tag 'admin', 'thickbox', 'wymeditor/jquery.refinery.wymeditor.js', 'refinery/boot_wym', 'refinery/admin', :cache => (use_caching ? "cache/admin" : false) %>
|
16
|
+
<%= javascript_include_tag "http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js" if RefinerySetting.find_or_set(:show_firebug_lite, false) -%>
|
26
17
|
<%= "<script type='text/javascript'>jQuery(document).ready(function(){ jQuery('#flash').fadeIn(550); });</script>" unless flash.empty? -%>
|
27
18
|
<%= yield :head %>
|
28
19
|
</head>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
</li>
|
9
9
|
<% end
|
10
10
|
end -%>
|
11
|
-
<% if Refinery::Plugins.active.in_menu.size > 1
|
11
|
+
<% if Refinery::Plugins.active.in_menu.size > 1 -%>
|
12
12
|
<li>
|
13
13
|
<%= link_to " ", "", :id => "menu_reorder", :title => "Reorder menu" %>
|
14
14
|
<%= link_to " ", "", :id => "menu_reorder_done", :title => "I'm done reordering the menu", :style => "display: none;" %>
|
@@ -18,68 +18,6 @@
|
|
18
18
|
<%= link_to "Log out", logout_url %>
|
19
19
|
</li>
|
20
20
|
</ul>
|
21
|
-
<input type='hidden' id='admin_menu_reorder_authenticity_token' value='<%= form_authenticity_token %>' />
|
22
|
-
<script type='text/javascript'>
|
23
|
-
disable_menu_reordering = function(e)
|
24
|
-
{
|
25
|
-
Sortable.destroy("menu");
|
26
21
|
|
27
|
-
|
28
|
-
menu.removeClassName('reordering_menu');
|
22
|
+
<input type='hidden' id='admin_authenticity_token' value='<%= form_authenticity_token %>' />
|
29
23
|
|
30
|
-
$('menu_reorder_done').hide();
|
31
|
-
$('menu_reorder').show();
|
32
|
-
|
33
|
-
[$('header').childElements().without(menu), $('content'), $('logout')].flatten().each(function(element) {
|
34
|
-
new Effect.Appear(element, { duration: 0.5});
|
35
|
-
});
|
36
|
-
|
37
|
-
$$('#menu li a').each(function(anchor) {
|
38
|
-
if (!anchor.id.startsWith("menu_reorder")) {
|
39
|
-
anchor.stopObserving('click');
|
40
|
-
}
|
41
|
-
});
|
42
|
-
|
43
|
-
e.stop();
|
44
|
-
}
|
45
|
-
|
46
|
-
enable_menu_reordering = function(e)
|
47
|
-
{
|
48
|
-
$('menu_reorder_done').show();
|
49
|
-
$('menu_reorder').hide();
|
50
|
-
|
51
|
-
menu = $('menu');
|
52
|
-
menu.addClassName('reordering_menu');
|
53
|
-
|
54
|
-
Sortable.create($('menu'), {
|
55
|
-
constraint: 'horizontal'
|
56
|
-
, only: 'tab'
|
57
|
-
, onUpdate:function() {
|
58
|
-
new Ajax.Request('<%= url_for :controller => "/admin", :action => "update_menu_positions" %>',
|
59
|
-
{
|
60
|
-
asynchronous:true
|
61
|
-
, evalScripts:true
|
62
|
-
, parameters: Sortable.serialize('menu') + '&authenticity_token=' + encodeURIComponent($('admin_menu_reorder_authenticity_token').value)
|
63
|
-
});
|
64
|
-
}
|
65
|
-
});
|
66
|
-
|
67
|
-
[$('header').childElements().without(menu), $('content'), $('logout')].flatten().each(function(element) {
|
68
|
-
new Effect.Fade(element, { duration: 0.5, from: 1, to: 0.2 });
|
69
|
-
});
|
70
|
-
|
71
|
-
$$('#menu li a').each(function(anchor) {
|
72
|
-
if (!anchor.id.startsWith("menu_reorder")) {
|
73
|
-
anchor.observe('click', function(e){e.stop();});
|
74
|
-
}
|
75
|
-
});
|
76
|
-
|
77
|
-
e.stop();
|
78
|
-
}
|
79
|
-
|
80
|
-
FastInit.addOnLoad(function()
|
81
|
-
{
|
82
|
-
$('menu_reorder').observe('click', enable_menu_reordering);
|
83
|
-
$('menu_reorder_done').observe('click', disable_menu_reordering);
|
84
|
-
});
|
85
|
-
</script>
|
@@ -1,11 +1,5 @@
|
|
1
1
|
<% flash.each do |key, value| %>
|
2
2
|
<div id="flash" class="flash_<%= key %>" style='display: none;' >
|
3
3
|
<%= value %> (<%= link_to "close", "", {:id => "flash_close"} %>)
|
4
|
-
<script type="text/javascript">
|
5
|
-
jQuery('#flash_close').click(function(e) {
|
6
|
-
jQuery('#flash').fadeOut({duration: 330});
|
7
|
-
e.preventDefault();
|
8
|
-
});
|
9
|
-
</script>
|
10
4
|
</div>
|
11
5
|
<% end %>
|
@@ -1,7 +1,2 @@
|
|
1
1
|
<%= error_messages_for symbol %>
|
2
|
-
|
3
|
-
<script type='text/javascript'>
|
4
|
-
$$('#<%= fields.join("','#") %>').each(function(error_field) {
|
5
|
-
error_field.up('div.field').addClassName('fieldWithErrors').removeClassName('field');
|
6
|
-
});
|
7
|
-
</script>
|
2
|
+
<input type='hidden' id='fieldsWithErrors' value='<%= object.errors.collect { |attrib, msg| "#{object.class.name.underscore}_#{attrib}"}.join(",") %>' />
|
@@ -1,15 +1,13 @@
|
|
1
1
|
<div class='form-actions'>
|
2
|
-
<%= f.submit 'Save', :id => "submit_button", :class => "wymupdate"
|
3
|
-
|
4
|
-
<% if (continue_editing ||= false and !f.object.new_record?) %>
|
2
|
+
<%= f.submit 'Save', :id => "#{submit_button_id ||= "submit_button"}", :class => "wymupdate" -%>
|
3
|
+
<% if (continue_editing ||= false and !f.object.new_record?) -%>
|
5
4
|
or
|
6
|
-
<%= render :partial => "/shared/admin/continue_editing", :locals => {:f => f}
|
7
|
-
<% end
|
8
|
-
|
9
|
-
<% unless (hide_cancel ||= false) %>
|
5
|
+
<%= render :partial => "/shared/admin/continue_editing", :locals => {:f => f} -%>
|
6
|
+
<% end -%>
|
7
|
+
<% unless (hide_cancel ||= from_dialog?) -%>
|
10
8
|
or
|
11
9
|
<%= link_to "Cancel", (cancel_url ||= send("admin_#{f.object.class.name.pluralize.underscore}_url")),
|
12
10
|
:title => (title ||= "Cancelling will lose all changes you've made to this #{f.object.class.name.underscore.gsub("_", " ")}"),
|
13
|
-
:id => "cancel_button", :class => "close_dialog" %>
|
14
|
-
<% end
|
15
|
-
</div>
|
11
|
+
:id => "#{cancel_button_id ||= "cancel_button"}", :class => "close_dialog" %>
|
12
|
+
<% end -%>
|
13
|
+
</div>
|
@@ -1,50 +1,34 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<%
|
2
|
+
description ||= "image"
|
3
|
+
thumbnail ||= "medium"
|
4
|
+
toggle_image_display ||= false
|
5
|
+
-%>
|
6
|
+
<%= link_to "Show", "", :id => "current_image_toggler" if toggle_image_display -%>
|
7
|
+
<%= f.hidden_field field, :id => 'custom_title_field' -%>
|
8
|
+
|
9
|
+
<div id='current_image_container'<%= " style='display: none'" if toggle_image_display %> style="margin-top: 10px;">
|
10
|
+
<a id='current_image_link' href="<%= insert_admin_images_url %>?thickbox=true&modal=true&titlebar=true&field=custom_title_field&thumbnail=&KeepThis=true&TB_iframe=true&width=958&height=510" style='border: 0px' title='Change <%= description.titleize %>' name='Change <%= description.titleize %>' class='thickbox'>
|
11
|
+
<% unless image.nil? -%>
|
6
12
|
<%= image_fu image, nil, {:class => "brown_border", :id => "current_picked_image"} %>
|
7
|
-
<% else
|
13
|
+
<% else -%>
|
8
14
|
<img id="current_picked_image" class="" src="" alt="" style='display: none' />
|
9
|
-
<% end
|
15
|
+
<% end -%>
|
10
16
|
<p id='no_picked_image_selected' <%= "style='display: none;'" unless image.nil? %>>
|
11
|
-
There is currently no <%= description
|
17
|
+
There is currently no <%= description %> selected, please click here to add one.
|
12
18
|
</p>
|
13
19
|
</a>
|
14
20
|
<br/>
|
15
|
-
<%= link_to "Remove current #{description
|
21
|
+
<%= link_to "Remove current #{description}", "#", :id => "remove_picked_image", :style => "#{"display:none;" if image.nil?}" %>
|
16
22
|
</div>
|
17
|
-
<% content_for :head do %>
|
18
|
-
<script type='text/javascript'>
|
19
|
-
picked_image_changed = function()
|
20
|
-
{
|
21
|
-
$('remove_picked_image').show();
|
22
|
-
$('current_picked_image').show();
|
23
|
-
$('current_picked_image').addClassName('brown_border');
|
24
|
-
$('no_picked_image_selected').hide();
|
25
|
-
}
|
26
23
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
$('current_picked_image').style.width = "auto";
|
35
|
-
$('current_picked_image').style.height = "auto";
|
36
|
-
$('no_picked_image_selected').show();
|
37
|
-
$('current_picked_image').hide();
|
38
|
-
this.hide();
|
39
|
-
e.stop();
|
40
|
-
});
|
41
|
-
<% if toggle_image_display ||= false -%>
|
42
|
-
jQuery('#current_image_toggler').click(function(e){
|
43
|
-
jQuery(this).html((jQuery(this).html() == 'Show' ? 'Hide' : 'Show'));
|
44
|
-
jQuery("#current_image_container").toggle();
|
45
|
-
e.preventDefault();
|
24
|
+
<% content_for :head do -%>
|
25
|
+
<script type='text/javascript'>
|
26
|
+
$(document).ready(function(){
|
27
|
+
image_picker.init({
|
28
|
+
thumbnail: '<%= thumbnail %>'
|
29
|
+
, toggle_image_display: <%= toggle_image_display.to_s %>
|
30
|
+
, description: '<%= description %>'
|
46
31
|
});
|
47
|
-
<% end -%>
|
48
32
|
});
|
49
33
|
</script>
|
50
34
|
<% end %>
|
@@ -1,69 +1,10 @@
|
|
1
|
-
<%
|
2
|
-
list_id ||= "sortable_list"
|
3
|
-
update_url ||= url_for(:action => "update_positions")
|
4
|
-
tree ||= false
|
5
|
-
|
6
|
-
content_for :head do
|
7
|
-
%>
|
1
|
+
<% content_for :head do -%>
|
8
2
|
<script type='text/javascript'>
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
3
|
+
$(document).ready(function(){
|
4
|
+
list_reorder.update_url = '<%= update_url ||= url_for(:action => "update_positions") %>';
|
5
|
+
list_reorder.sortable_list = $('#<%= list_id ||= "sortable_list" %>');
|
6
|
+
list_reorder.tree = <%= tree ||= false %>;
|
7
|
+
list_reorder.init();
|
14
8
|
});
|
15
|
-
|
16
|
-
disable_reordering = function(e)
|
17
|
-
{
|
18
|
-
if (reordering_button_enabled) {
|
19
|
-
$('<%= list_id %>').removeClassName('reordering');
|
20
|
-
|
21
|
-
Sortable.destroy("<%= list_id %>");
|
22
|
-
|
23
|
-
$('reorder_action_done').hide();
|
24
|
-
$('reorder_action').show();
|
25
|
-
}
|
26
|
-
if (e) { e.stop(); }
|
27
|
-
}
|
28
|
-
|
29
|
-
enable_reordering = function(e)
|
30
|
-
{
|
31
|
-
sortable_list = $('<%= list_id %>');
|
32
|
-
sortable_list.addClassName('reordering');
|
33
|
-
|
34
|
-
nest_id = 0;
|
35
|
-
sortable_list.select('ul.nested').each(function(nested)
|
36
|
-
{
|
37
|
-
nested.id = nested.id.length > 0 ? nested.id : "nested_" + nest_id++;
|
38
|
-
Sortable.create(nested.id, {
|
39
|
-
constraint: <%= tree ? "false" : "'vertical'" %>
|
40
|
-
, hoverclass: 'hover'
|
41
|
-
, scroll: window
|
42
|
-
, tree: <%= tree %>
|
43
|
-
});
|
44
|
-
});
|
45
|
-
|
46
|
-
Sortable.create("<%= list_id %>", {
|
47
|
-
constraint: <%= tree ? "false" : "'vertical'" %>
|
48
|
-
, hoverclass: 'hover'
|
49
|
-
, scroll: window
|
50
|
-
, tree: <%= tree %>
|
51
|
-
, onUpdate:function() {
|
52
|
-
reordering_button_enabled = false;
|
53
|
-
new Ajax.Updater('<%= list_id %>', '<%= update_url %>',
|
54
|
-
{
|
55
|
-
asynchronous:true
|
56
|
-
, evalScripts:true
|
57
|
-
, parameters: Sortable.serialize('<%= list_id %>') + '&tree=<%= tree %>' + '&authenticity_token=' + encodeURIComponent($('reorder_authenticity_token').value)
|
58
|
-
, onComplete: function(e) { reordering_button_enabled = true; }
|
59
|
-
});
|
60
|
-
}
|
61
|
-
});
|
62
|
-
|
63
|
-
$('reorder_action').hide();
|
64
|
-
$('reorder_action_done').show();
|
65
|
-
|
66
|
-
if (e) { e.stop(); }
|
67
|
-
}
|
68
9
|
</script>
|
69
10
|
<% end %>
|