imagine_cms 4.1.4 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +2 -1
- data/app/assets/images/interface/form_loading.gif +0 -0
- data/app/assets/images/management/btn-top-delete.png +0 -0
- data/app/assets/images/management/btn-top-edit.png +0 -0
- data/app/assets/images/management/btn-top-exterminate.png +0 -0
- data/app/assets/images/management/btn-top-new.png +0 -0
- data/app/assets/images/management/btn-top-preview.png +0 -0
- data/app/assets/images/management/btn-top-properties.png +0 -0
- data/app/assets/javascripts/codemirror/modes-custom/imagine_cms.js +87 -0
- data/app/assets/javascripts/imagine_cms/core.js +510 -0
- data/app/assets/javascripts/imagine_cms/legacy/misc.js +537 -0
- data/app/assets/javascripts/imagine_cms/legacy/rollovers.js +193 -0
- data/app/assets/javascripts/imagine_cms/legacy/slideshow.js +116 -0
- data/app/assets/javascripts/imagine_cms/legacy/textfieldhints.js +55 -0
- data/app/assets/javascripts/imagine_cms.js +14 -1
- data/app/assets/javascripts/imagine_cms_compat.js +26 -0
- data/app/assets/javascripts/jquery-ui.js +16608 -0
- data/app/assets/javascripts/tag-it.js +591 -0
- data/app/assets/stylesheets/imagine_cms.css.scss +26 -10
- data/app/assets/stylesheets/imagine_controls.css.scss +8 -0
- data/app/assets/stylesheets/jquery-ui.css +1225 -0
- data/app/assets/stylesheets/jquery-ui.structure.css +833 -0
- data/app/assets/stylesheets/jquery-ui.theme.css +410 -0
- data/app/assets/stylesheets/jquery.tagit.css +69 -0
- data/app/assets/stylesheets/management.css.scss +7 -0
- data/app/assets/stylesheets/tagit.ui-imagine.css +100 -0
- data/app/controllers/cms/content_controller.rb +28 -45
- data/app/controllers/management/cms_controller.rb +116 -94
- data/app/helpers/cms_application_helper.rb +76 -39
- data/app/models/cms_page.rb +32 -14
- data/app/models/cms_page_object.rb +1 -1
- data/app/models/cms_page_tag.rb +2 -2
- data/app/models/cms_template.rb +1 -1
- data/app/models/user.rb +6 -6
- data/app/models/user_group.rb +1 -1
- data/app/views/cms/content/_photo_gallery.html.erb +12 -12
- data/app/views/cms/content/_search.html.erb +2 -2
- data/app/views/cms/content/_search_result.html.erb +16 -10
- data/app/views/layouts/management.html.erb +18 -17
- data/app/views/management/cms/_edit_page.html.erb +47 -33
- data/app/views/management/cms/_gallery_index.html.erb +4 -4
- data/app/views/management/cms/_image.html.erb +3 -3
- data/app/views/management/cms/_image_details.html.erb +9 -8
- data/app/views/management/cms/_list_page.html.erb +2 -2
- data/app/views/management/cms/_list_page_select.html.erb +1 -1
- data/app/views/management/cms/_page_list.html.erb +69 -48
- data/app/views/management/cms/_page_list_source_folder.html.erb +2 -2
- data/app/views/management/cms/_template_options.html.erb +4 -4
- data/app/views/management/cms/_template_reference.html.erb +13 -15
- data/app/views/management/cms/edit_page_content.html.erb +3 -3
- data/app/views/management/cms/edit_snippet.html.erb +19 -41
- data/app/views/management/cms/edit_template.html.erb +15 -38
- data/app/views/management/cms/pages.html.erb +17 -29
- data/app/views/management/cms/snippets.html.erb +2 -2
- data/app/views/management/cms/templates.html.erb +2 -2
- data/app/views/management/cms/toolbar_edit.html.erb +2 -0
- data/app/views/management/cms/toolbar_preview.html.erb +2 -2
- data/config/initializers/config_file.rb +1 -1
- data/imagine_cms.gemspec +7 -4
- data/lib/extensions/action_controller_extensions.rb +50 -19
- data/lib/imagine_cms/engine.rb +12 -8
- data/lib/imagine_cms/version.rb +1 -1
- data/lib/prototype_legacy_helper/lib/prototype_legacy_helper.rb +2 -2
- data/lib/tasks/imagine_cms_tasks.rake +8 -0
- metadata +69 -91
- data/app/assets/images/management/btn_archive.gif +0 -0
- data/app/assets/images/management/btn_delete.gif +0 -0
- data/app/assets/images/management/btn_duplicate.gif +0 -0
- data/app/assets/images/management/btn_edit.gif +0 -0
- data/app/assets/images/management/btn_new_page.gif +0 -0
- data/app/assets/images/management/btn_preview.gif +0 -0
- data/app/assets/images/management/btn_properties.gif +0 -0
- data/app/assets/images/management/btn_restore.gif +0 -0
- data/app/assets/images/management/btn_top_delete.gif +0 -0
- data/app/assets/images/management/btn_top_duplicate.gif +0 -0
- data/app/assets/images/management/btn_top_edit.gif +0 -0
- data/app/assets/images/management/btn_top_new.gif +0 -0
- data/app/assets/images/management/btn_top_preview.gif +0 -0
- data/app/assets/images/management/btn_top_properties.gif +0 -0
- data/app/assets/javascripts/codepress/codepress.html +0 -36
- data/app/assets/javascripts/codepress/codepress.js +0 -130
- data/app/assets/javascripts/codepress/engines/gecko.js +0 -240
- data/app/assets/javascripts/codepress/engines/khtml.js +0 -0
- data/app/assets/javascripts/codepress/engines/msie.js +0 -263
- data/app/assets/javascripts/codepress/engines/older.js +0 -0
- data/app/assets/javascripts/codepress/engines/opera.js +0 -259
- data/app/assets/javascripts/codepress/languages/css.js +0 -23
- data/app/assets/javascripts/codepress/languages/generic.js +0 -25
- data/app/assets/javascripts/codepress/languages/html.js +0 -63
- data/app/assets/javascripts/codepress/languages/java.js +0 -24
- data/app/assets/javascripts/codepress/languages/javascript.js +0 -30
- data/app/assets/javascripts/codepress/languages/perl.js +0 -27
- data/app/assets/javascripts/codepress/languages/php.js +0 -60
- data/app/assets/javascripts/codepress/languages/ruby.js +0 -26
- data/app/assets/javascripts/codepress/languages/sql.js +0 -30
- data/app/assets/javascripts/codepress/languages/text.js +0 -9
- data/app/assets/javascripts/imagine.js +0 -1393
- data/app/assets/stylesheets/codepress/codepress.css +0 -7
- data/app/assets/stylesheets/codepress/languages/css.css +0 -10
- data/app/assets/stylesheets/codepress/languages/generic.css +0 -9
- data/app/assets/stylesheets/codepress/languages/html.css +0 -18
- data/app/assets/stylesheets/codepress/languages/java.css +0 -7
- data/app/assets/stylesheets/codepress/languages/javascript.css +0 -8
- data/app/assets/stylesheets/codepress/languages/perl.css +0 -11
- data/app/assets/stylesheets/codepress/languages/php.css +0 -12
- data/app/assets/stylesheets/codepress/languages/ruby.css +0 -10
- data/app/assets/stylesheets/codepress/languages/sql.css +0 -10
- data/app/assets/stylesheets/codepress/languages/text.css +0 -5
@@ -1,16 +1,23 @@
|
|
1
1
|
<script type="text/javascript">
|
2
2
|
attrlist = new Array(<%= @attrs.size %>)
|
3
|
-
|
4
3
|
<%- @attrs.each_with_index do |attr, i| -%>
|
5
|
-
attrlist[<%= i %>]="<%=
|
4
|
+
attrlist[<%= i %>]="<%=j attr %>";
|
5
|
+
<%- end -%>
|
6
|
+
|
7
|
+
taglist = new Array(<%= @taglist.size %>)
|
8
|
+
<%- @taglist.each_with_index do |tag, i| -%>
|
9
|
+
taglist[<%= i %>]="<%=j tag %>";
|
6
10
|
<%- end -%>
|
11
|
+
|
12
|
+
jQuery(document).ready(function () {
|
13
|
+
jQuery('#tags').tagit({ availableTags: taglist, allowSpaces: true, caseSensitive: false, removeConfirmation: true, autocomplete: { delay: 0, minLength: 0 } });
|
14
|
+
});
|
7
15
|
</script>
|
8
16
|
|
9
17
|
<div id="save_errors" class="error"></div>
|
10
18
|
|
11
19
|
<%= form_remote_tag :url => { :action => 'edit_page', :id => @pg },
|
12
|
-
:loading => "$('btn_save').disabled = true; $('btn_save').value = 'Saving...';"
|
13
|
-
:html => { :onsubmit => 'teardownTextFieldHints();' } do %>
|
20
|
+
:loading => "$('btn_save').disabled = true; $('btn_save').value = 'Saving...';" do %>
|
14
21
|
<table id="dlg-page-properties">
|
15
22
|
<col width="120"><col width="*"><col width="5">
|
16
23
|
<%- if (@pg.id || 2) > 1 -%>
|
@@ -67,7 +74,7 @@
|
|
67
74
|
</script>
|
68
75
|
</td>
|
69
76
|
</tr>
|
70
|
-
<tr
|
77
|
+
<tr>
|
71
78
|
<td>Article Date:</td>
|
72
79
|
<td>
|
73
80
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
@@ -86,7 +93,7 @@
|
|
86
93
|
</td>
|
87
94
|
</tr>
|
88
95
|
<tr>
|
89
|
-
<td>Tags:</td>
|
96
|
+
<td valign="middle">Tags:</td>
|
90
97
|
<td><%= text_field_tag :tags, @tags, :class => 'form', :style => 'width: 100%' %></td>
|
91
98
|
</tr>
|
92
99
|
<tr class="page-field">
|
@@ -126,18 +133,21 @@
|
|
126
133
|
<%- if @pg.new_record? -%>
|
127
134
|
A thumbnail cannot be added until you save this page.
|
128
135
|
<%- else -%>
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
136
|
+
<div id="thumbnail_preview" style="width: 385px; overflow: auto;">
|
137
|
+
<%- if @pg.thumbnail_path.blank? -%>
|
138
|
+
<!-- no thumbnail image selected -->
|
139
|
+
<%- else -%>
|
140
|
+
<%= image_tag(@pg.thumbnail_path, onclick: "jQuery('#pg_thumbnail_path').toggle();") %>
|
141
|
+
<%- end -%>
|
142
|
+
</div>
|
143
|
+
<%= button_to_function "Select Thumbnail...",
|
144
|
+
"selectThumbnail('#{url_for action: 'upload_thumb', id: @pg}');",
|
145
|
+
class: 'form_button' %>
|
146
|
+
<%- if @pg.thumbnail_path.present? -%>
|
147
|
+
<%= button_to_function "Remove", "jQuery('#thumbnail_preview img').remove(); jQuery('#pg_thumbnail_path').val(''); jQuery(this).remove();", class: 'form_button' %>
|
134
148
|
<%- end -%>
|
135
|
-
|
136
|
-
<%= button_to_function "Select Thumbnail...",
|
137
|
-
"selectThumbnail('#{url_for :action => 'upload_thumb', :id => @pg}');",
|
138
|
-
:class => 'form_button' %>
|
149
|
+
<%= text_field :pg, :thumbnail_path, class: 'form', style: 'width: 100%; display: none;' %>
|
139
150
|
<%- end -%>
|
140
|
-
<%= text_field :pg, :thumbnail_path, :class => 'form', :style => 'width: 100%; display: none;' %>
|
141
151
|
</td>
|
142
152
|
</tr>
|
143
153
|
<%- if @pg.respond_to?(:feature_image_path) -%>
|
@@ -147,18 +157,21 @@
|
|
147
157
|
<%- if @pg.new_record? -%>
|
148
158
|
A feature image cannot be added until you save this page.
|
149
159
|
<%- else -%>
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
160
|
+
<div id="feature_image_preview" style="width: 385px; overflow: auto;">
|
161
|
+
<%- if @pg.feature_image_path.blank? -%>
|
162
|
+
<!-- no feature image selected -->
|
163
|
+
<%- else -%>
|
164
|
+
<%= image_tag(@pg.feature_image_path, onclick: "jQuery('#pg_feature_image_path').toggle();") %>
|
165
|
+
<%- end -%>
|
166
|
+
</div>
|
167
|
+
<%= button_to_function "Select Feature Image...",
|
168
|
+
"selectThumbnail('#{url_for action: 'upload_feature_image', id: @pg}');",
|
169
|
+
class: 'form_button' %>
|
170
|
+
<%- if @pg.feature_image_path.present? -%>
|
171
|
+
<%= button_to_function "Remove", "jQuery('#feature_image_preview img').remove(); jQuery('#pg_feature_image_path').val(''); jQuery(this).remove();", class: 'form_button' %>
|
155
172
|
<%- end -%>
|
156
|
-
|
157
|
-
<%= button_to_function "Select Feature Image...",
|
158
|
-
"selectThumbnail('#{url_for :action => 'upload_feature_image', :id => @pg}');",
|
159
|
-
:class => 'form_button' %>
|
173
|
+
<%= text_field :pg, :feature_image_path, class: 'form', style: 'width: 100%; display: none;' %>
|
160
174
|
<%- end -%>
|
161
|
-
<%= text_field :pg, :feature_image_path, :class => 'form', :style => 'width: 100%; display: none;' %>
|
162
175
|
</td>
|
163
176
|
</tr>
|
164
177
|
<%- end -%>
|
@@ -175,16 +188,17 @@
|
|
175
188
|
<tr>
|
176
189
|
<td>Add an attribute: </td>
|
177
190
|
<td>
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
191
|
+
<div style="position: relative;">
|
192
|
+
<%= text_field_tag :custom_attribute_name, '', :class => 'form', :style => 'margin-bottom: 4px;', :placeholder => '[ attribute name ]' %>
|
193
|
+
<div id="custom_attribute_name_auto_complete" class="auto_complete" style="display: none;"></div>
|
194
|
+
<%= javascript_tag "$('custom_attribute_name').onkeydown = disableEnterKey; new Autocompleter.Local('custom_attribute_name', 'custom_attribute_name_auto_complete', attrlist, { frequency: 0.1, minChars: 1 });" %>
|
195
|
+
|
196
|
+
<%= button_to_function 'Add', "new Ajax.Updater('custom_attributes', '/manage/cms/page_attribute?name=' + $('custom_attribute_name').value, {asynchronous:true, method:'get', evalScripts:true, insertion:Insertion.Bottom}); $('custom_attribute_name').value = ''; return false;", :class => 'form_button', :style => 'margin-bottom: 5px;' %>
|
197
|
+
</div>
|
184
198
|
</td>
|
185
199
|
</tr>
|
186
200
|
</table>
|
187
|
-
<div id="custom_attributes" style="background-color: white; height:
|
201
|
+
<div id="custom_attributes" style="background-color: white; min-height: 40px; overflow: auto; border: 1px solid #aaaaaa">
|
188
202
|
<%- @page_objects.each do |key,val| -%>
|
189
203
|
<%- key =~ /^obj-(\w+?)-(.+?)$/ -%>
|
190
204
|
<%= render :partial => 'page_attribute', :locals => { :name => $2 } if $1 == 'attribute' %>
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<div id="images_container">
|
2
2
|
<div id="images">
|
3
|
-
<%= render :
|
3
|
+
<%= render partial: 'image', collection: @images, locals: { id: @pg, path: @pg.path, gallery_id: params[:gallery_id] } %>
|
4
4
|
</div>
|
5
5
|
</div>
|
6
6
|
|
7
|
-
<%= form_remote_tag(:
|
8
|
-
:
|
9
|
-
<%= text_field_tag :dirname, '', :
|
7
|
+
<%= form_remote_tag(update: 'gallery_container', html: { id: 'mainform_gallery' },
|
8
|
+
url: { action: 'gallery_management', id: @pg, gallery_id: params[:gallery_id] }) do -%>
|
9
|
+
<%= text_field_tag :dirname, '', style: 'display: none' %>
|
10
10
|
<%- end -%>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%-
|
2
2
|
thumb = "assets/content/#{path}/#{gallery_id}/management/#{image}.jpg"
|
3
3
|
-%>
|
4
|
-
<%= link_to_remote image_tag("/#{thumb}?#{File.mtime(File.join(Rails.root, 'public', thumb)).to_i}", :
|
5
|
-
:
|
6
|
-
:
|
4
|
+
<%= link_to_remote image_tag("/#{thumb}?#{File.mtime(File.join(Rails.root, 'public', thumb)).to_i}", size: '90x90'),
|
5
|
+
url: { action: 'image_details', id: id, gallery_id: gallery_id, image: "#{image}.jpg" },
|
6
|
+
update: 'gallery_window' %>
|
@@ -1,23 +1,24 @@
|
|
1
|
+
<%- img = "content/#{@pg.path}/#{params[:gallery_id]}/#{params[:image]}" -%>
|
1
2
|
<table>
|
2
3
|
<tr valign="top">
|
3
|
-
<td><%= image_tag "
|
4
|
+
<td><%= image_tag "#{img}?#{File.mtime(File.join(Rails.root, 'public', 'assets', img)).to_i}" %></td>
|
4
5
|
<td style="padding-left: 10px;">
|
5
6
|
<div id="caption_container" style="margin-bottom: 20px;">
|
6
7
|
<strong>Caption</strong><br/>
|
7
|
-
<%= form_remote_tag :
|
8
|
-
:
|
8
|
+
<%= form_remote_tag url: { action: 'update_caption', id: params[:id], gallery_id: params[:gallery_id], image: params[:image] },
|
9
|
+
update: 'gallery_container' do -%>
|
9
10
|
<%= text_area_tag "caption", @caption %><br/>
|
10
11
|
<%= submit_tag "Save" %> or <%= link_to_remote "cancel",
|
11
|
-
:
|
12
|
-
:
|
12
|
+
url: { action: 'gallery_management', id: params[:id], gallery_id: params[:gallery_id] },
|
13
|
+
update: 'gallery_container' %>
|
13
14
|
<%- end -%>
|
14
15
|
</div>
|
15
16
|
|
16
17
|
<div id="delete_container">
|
17
18
|
<strong>Delete Photo</strong><br/>
|
18
|
-
<%= form_remote_tag :
|
19
|
-
:
|
20
|
-
:
|
19
|
+
<%= form_remote_tag url: { action: 'delete_photo', id: params[:id], gallery_id: params[:gallery_id], image: params[:image] },
|
20
|
+
update: 'gallery_container',
|
21
|
+
confirm: "This action cannot be undone. Continue?" do -%>
|
21
22
|
<%= submit_tag "Delete" %>
|
22
23
|
<%- end -%>
|
23
24
|
</div>
|
@@ -1,7 +1,7 @@
|
|
1
|
-
<div id="<%= "cb_item_#{list_page.id}" %>" class="cb_item" style="width: 148px; overflow: hidden; margin: 2px; float: left; cursor: pointer" onclick="$('view_link').href = '<%= list_page.path.blank? ? '' : '/' + list_page.path %>/version/<%= list_page.published_version > 0 ? list_page.published_version : list_page.version %>'; $('new_link').onclick = function () { editProperties('<%=raw url_for :action => 'edit_page', :mode => 'ajax_new', :parent_id => list_page %>', 'Create New Page under /<%= list_page.path %>'); return false; }; $('edit_link').onclick = function () { editProperties('<%=raw url_for :action => 'edit_page', :id => list_page, :mode => 'ajax_edit' %>', 'Page Properties: <%= list_page.name %>'); return false; }; $('edit_content_link').href = '<%=raw url_for :action => 'edit_page_content', :id => list_page %>'; $('
|
1
|
+
<div id="<%= "cb_item_#{list_page.id}" %>" class="cb_item" style="width: 148px; overflow: hidden; margin: 2px; float: left; cursor: pointer" onclick="$('view_link').href = '<%= list_page.path.blank? ? '' : '/' + list_page.path %>/version/<%= list_page.published_version > 0 ? list_page.published_version : list_page.version %>'; $('new_link').onclick = function () { editProperties('<%=raw url_for :action => 'edit_page', :mode => 'ajax_new', :parent_id => list_page %>', 'Create New Page under /<%= list_page.path %>'); return false; }; $('edit_link').onclick = function () { editProperties('<%=raw url_for :action => 'edit_page', :id => list_page, :mode => 'ajax_edit' %>', 'Page Properties: <%= list_page.name %>'); return false; }; $('edit_content_link').href = '<%=raw url_for :action => 'edit_page_content', :id => list_page %>'; $('delete_link').href = '<%=raw url_for :action => 'delete_page', :id => list_page.id %>'; setTimeout('cbSelectItem(\'' + this.id + '\', <%= @page_level %>, \'<%=raw url_for :action => 'list_pages', :level => @page_level + 1, :parent_id => list_page.id %>\');', 200);" ondblclick="$('edit_content_link').click();">
|
2
2
|
<table cellpadding="0" cellspacing="0" border="0">
|
3
3
|
<tr>
|
4
|
-
<td valign="top"
|
4
|
+
<td valign="top"><%= image_tag 'management/icon_page.gif', style: 'margin: 2px 5px 0 0;' %></td>
|
5
5
|
<td<%= list_page.published_version >= 0 ? '' : ' style="color: gray"'.html_safe %>><%= list_page.name %></td>
|
6
6
|
</tr>
|
7
7
|
</table>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<div id="<%= "cb_item_#{list_page_select.id}" %>" class="cb_item" style="width: 148px; overflow: hidden; margin: 2px; float: left; cursor: pointer" onclick="$('page_browser_selection').value = '/<%= list_page_select.path %>'; setTimeout('cbSelectItem(\'' + this.id + '\', <%= @page_level %>, \'<%=raw url_for :action => 'list_pages_select', :level => @page_level + 1, :parent_id => list_page_select.id %>\');', 200);" ondblclick="return false;">
|
2
2
|
<table cellpadding="0" cellspacing="0" border="0">
|
3
3
|
<tr>
|
4
|
-
<td valign="top"
|
4
|
+
<td valign="top"><%= image_tag 'management/icon_page.gif', style: 'margin: 2px 5px 0 0;' %></td>
|
5
5
|
<td<%= list_page_select.published_version >= 0 ? '' : ' style="color: gray"'.html_safe %>><%= list_page_select.name %></td>
|
6
6
|
</tr>
|
7
7
|
</table>
|
@@ -1,11 +1,11 @@
|
|
1
|
-
|
1
|
+
<%- options ||= {} -%>
|
2
|
+
<div id="page_list_container_<%= key %>" class="page_list_dialog" style="border: 1px solid gray; padding: 8px; background-color: #dddddd; width: 170px; text-align: center;">
|
2
3
|
Page List: <%= name %><br/>
|
3
4
|
<button class="form_button" onclick="showDojoDialog('page_list_<%= key %>'); return false;">Configure</button>
|
4
5
|
</div>
|
5
|
-
|
6
6
|
<div dojoType="ModalFloatingPane" id="page_list_<%= key %>" title="Page List: <%= name %>"
|
7
7
|
hasShadow="true" resizable="true" followScroll="false" displayCloseAction="true" appendToBody="false"
|
8
|
-
style="width:
|
8
|
+
style="width: 620px; height: 600px; display: none">
|
9
9
|
<div class="ccs-page-list-form">
|
10
10
|
<fieldset>
|
11
11
|
<legend>Sources</legend>
|
@@ -14,29 +14,29 @@
|
|
14
14
|
|
15
15
|
<div id="page_list_<%= key %>-source-list" style="margin: 10px;">
|
16
16
|
<%- @page_objects["#{key}-sources-folder-count"].to_i.times do |i| -%>
|
17
|
-
<%= render :
|
17
|
+
<%= render partial: 'page_list_source_folder', locals: { i: i, key: key } %>
|
18
18
|
<%- end -%>
|
19
19
|
<%- @page_objects["#{key}-sources-tag-count"].to_i.times do |i| -%>
|
20
|
-
<%= render :
|
20
|
+
<%= render partial: 'page_list_source_tag', locals: { i: i, key: key } %>
|
21
21
|
<%- end -%>
|
22
22
|
<%-
|
23
23
|
@page_objects["#{key}-sources-tag-count"] ||= 0
|
24
24
|
@page_objects["#{key}-sources-folder-count"] ||= 0
|
25
25
|
-%>
|
26
|
-
<%= text_field
|
27
|
-
<%= text_field
|
26
|
+
<%= text_field :page_objects, "#{key}-sources-tag-count", style: 'display: none;' %>
|
27
|
+
<%= text_field :page_objects, "#{key}-sources-folder-count", style: 'display: none;' %>
|
28
28
|
</div>
|
29
29
|
|
30
30
|
<table>
|
31
31
|
<tr>
|
32
|
-
<td><%= button_to_function('Add Folder', "new Ajax.Updater('page_list_#{key}-source-list', '/manage/cms/page_list_add_folder?key=#{key}&i=' + $('page_objects_#{key}-sources-folder-count').value, {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom}); $('page_objects_#{key}-sources-folder-count').value++;", :class => 'form_button') %></td>
|
32
|
+
<td><%= button_to_function('Add Page/Folder', "new Ajax.Updater('page_list_#{key}-source-list', '/manage/cms/page_list_add_folder?key=#{key}&i=' + $('page_objects_#{key}-sources-folder-count').value, {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom}); $('page_objects_#{key}-sources-folder-count').value++;", :class => 'form_button') %></td>
|
33
33
|
<td><%= button_to_function('Add Tag', "new Ajax.Updater('page_list_#{key}-source-list', '/manage/cms/page_list_add_tag?key=#{key}&i=' + $('page_objects_#{key}-sources-tag-count').value, {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom}); $('page_objects_#{key}-sources-tag-count').value++;", :class => 'form_button') %></td>
|
34
34
|
<td>
|
35
|
-
<%= check_box
|
35
|
+
<%= check_box :page_objects, "#{key}-include-expired", { class: 'form', style: '' }, 'true', 'false' %>
|
36
36
|
<label for="page_objects_<%= key %>-include-expired">Include expired items</label>
|
37
37
|
</td>
|
38
38
|
<td>
|
39
|
-
<%= check_box
|
39
|
+
<%= check_box :page_objects, "#{key}-exclude-current", { class: 'form', style: '' }, 'true', 'false' %>
|
40
40
|
<label for="page_objects_<%= key %>-exclude-current">Exclude current page</label>
|
41
41
|
</td>
|
42
42
|
</tr>
|
@@ -52,28 +52,28 @@
|
|
52
52
|
<td>Format:</td>
|
53
53
|
<td colspan="2">
|
54
54
|
<%- @page_objects["#{key}-style-display-as"] ||= 'list' -%>
|
55
|
-
<%= radio_button :page_objects, "#{key}-style-display-as", 'list'
|
56
|
-
<%= radio_button :page_objects, "#{key}-style-display-as", 'calendar'
|
55
|
+
<%= radio_button :page_objects, "#{key}-style-display-as", 'list' %><label for="page_objects_<%= key %>-style-display-as_list">List</label>
|
56
|
+
<%= radio_button :page_objects, "#{key}-style-display-as", 'calendar' %><label for="page_objects_<%= key %>-style-display-as_calendar">Calendar</label>
|
57
57
|
</td>
|
58
58
|
</tr>
|
59
59
|
<tr class="page_list_<%= key %>_list_option">
|
60
|
-
<td>Number:</td>
|
60
|
+
<td valign="top"><div style="margin-top: 2px;">Number:</div></td>
|
61
61
|
<td>
|
62
|
-
Display <%= text_field
|
63
|
-
but skip the first <%= text_field
|
64
|
-
<br
|
62
|
+
Display <%= text_field :page_objects, "#{key}-max-item-count", placeholder: options[:item_count].to_s, class: 'form', style: 'margin: 0; width: 20px;' %> items,
|
63
|
+
but skip the first <%= text_field :page_objects, "#{key}-item-offset", placeholder: (options[:item_offset] || 0).to_s, class: 'form', style: 'margin: 0; width: 20px;' %>
|
64
|
+
<br>
|
65
65
|
|
66
66
|
<%= check_box :page_objects, "#{key}-use-pagination" %>
|
67
67
|
<label for="page_objects_<%= key %>-use-pagination">Show multiple list segments</label>
|
68
|
-
<br
|
68
|
+
<br>
|
69
69
|
|
70
70
|
<%= check_box :page_objects, "#{key}-use-randomization" %>
|
71
71
|
<label for="page_objects_<%= key %>-use-randomization">Select randomly from the top</label>
|
72
|
-
<%= text_field(:page_objects, "#{key}-random-pool-size", :
|
72
|
+
<%= text_field(:page_objects, "#{key}-random-pool-size", class: 'form', style: 'margin: 0; width: 20px') %> items
|
73
73
|
</td>
|
74
74
|
</tr>
|
75
75
|
<tr class="page_list_<%= key %>_list_option">
|
76
|
-
<td>Sort:</td>
|
76
|
+
<td>Sort Order:</td>
|
77
77
|
<td>
|
78
78
|
First by
|
79
79
|
<%= select(:page_objects, "#{key}-sort-first-field",
|
@@ -93,30 +93,21 @@
|
|
93
93
|
:class => 'form', :style => 'margin: 0; border: 1px solid gray;') %>
|
94
94
|
</td>
|
95
95
|
<tr class="page_list_<%= key %>_list_option">
|
96
|
-
<td>
|
96
|
+
<td>Dates:</td>
|
97
97
|
<td>
|
98
98
|
<%-
|
99
99
|
@page_objects["#{key}-date-range"] ||= 'all'
|
100
100
|
-%>
|
101
|
-
<%= radio_button :page_objects, "#{key}-date-range", 'all' %><label for="page_objects_<%= key %>-date-range_all">All Dates</label> 
|
102
|
-
<%= radio_button :page_objects, "#{key}-date-range", 'past' %><label for="page_objects_<%= key %>-date-range_past">Past</label> 
|
103
|
-
<%= radio_button :page_objects, "#{key}-date-range", 'future' %><label for="page_objects_<%= key %>-date-range_future">Future</label> 
|
101
|
+
<%= radio_button :page_objects, "#{key}-date-range", 'all' %><label for="page_objects_<%= key %>-date-range_all">All Dates</label>
|
102
|
+
<%= radio_button :page_objects, "#{key}-date-range", 'past' %><label for="page_objects_<%= key %>-date-range_past">Past</label>
|
103
|
+
<%= radio_button :page_objects, "#{key}-date-range", 'future' %><label for="page_objects_<%= key %>-date-range_future">Future</label>
|
104
104
|
<%= radio_button :page_objects, "#{key}-date-range", 'custom' %><label for="page_objects_<%= key %>-date-range_custom">Range:</label>
|
105
|
-
<%= date_picker :page_objects, "#{key}-date-range-custom-start", :
|
106
|
-
<%= date_picker :page_objects, "#{key}-date-range-custom-end", :
|
105
|
+
<%= date_picker :page_objects, "#{key}-date-range-custom-start", default_value: (@page_objects["#{key}-date-range-custom-start"] || Time.now), start_date: Time.utc(2006, 1, 1), end_date: 5.years.from_now %> –
|
106
|
+
<%= date_picker :page_objects, "#{key}-date-range-custom-end", default_value: (@page_objects["#{key}-date-range-custom-end"] || Time.now), start_date: Time.utc(2006, 1, 1), end_date: 5.years.from_now %>
|
107
107
|
</td>
|
108
108
|
</tr>
|
109
109
|
</table>
|
110
110
|
</fieldset>
|
111
|
-
<script type="text/javascript">
|
112
|
-
if ($('page_objects_<%= key %>-style-display-as_list').checked) {
|
113
|
-
$$('.page_list_<%= key %>_list_option').each(function(e) { Element.show(e) } );
|
114
|
-
$$('.page_list_<%= key %>_calendar_option').each(function(e) { Element.hide(e) } );
|
115
|
-
} else {
|
116
|
-
$$('.page_list_<%= key %>_calendar_option').each(function(e) { Element.show(e) } );
|
117
|
-
$$('.page_list_<%= key %>_list_option').each(function(e) { Element.hide(e) } );
|
118
|
-
}
|
119
|
-
</script>
|
120
111
|
|
121
112
|
<fieldset>
|
122
113
|
<legend>Item Template</legend>
|
@@ -126,21 +117,32 @@
|
|
126
117
|
</div>
|
127
118
|
|
128
119
|
<div style="float: right">
|
129
|
-
<%-
|
130
|
-
|
131
|
-
|
132
|
-
|
120
|
+
<%-
|
121
|
+
system_attrs = {
|
122
|
+
'article_date_month' => 'Article Date - Month',
|
123
|
+
'article_date_mon' => 'Article Date - Month Abbr',
|
124
|
+
'article_date_day' => 'Article Date - Day',
|
125
|
+
'article_date_year' => 'Article Date - Year',
|
126
|
+
'article_date_yr' => 'Article Date - Year Abbr',
|
127
|
+
'tags' => 'Tags',
|
128
|
+
'tags_as_css_classes' => 'Tags as CSS Classes',
|
129
|
+
}
|
130
|
+
@pg.attributes.each do |attr, value|
|
131
|
+
next if [ 'cms_template_id', 'cms_template_version' ].include?(attr)
|
132
|
+
system_attrs[attr] ||= attr.titleize
|
133
|
+
end
|
134
|
+
-%>
|
133
135
|
<select class="form" style="width: 150px;" onchange="insertAtCaret($('page_objects_<%= key %>-template'), '<# ' + this.value + ' #>'); this.value = '';">
|
134
136
|
<option value="">-- Insert Attribute --</option>
|
135
|
-
<%- system_attrs.each do |attr| -%>
|
136
|
-
<option value="<%=
|
137
|
+
<%- system_attrs.sort.each do |attr, label| -%>
|
138
|
+
<option value="<%= attr %>"><%= label %></option>
|
137
139
|
<%- end -%>
|
138
140
|
</select>
|
139
141
|
</div>
|
140
142
|
|
141
|
-
<br clear="all"
|
143
|
+
<br clear="all">
|
142
144
|
|
143
|
-
<%= text_area
|
145
|
+
<%= text_area :page_objects, "#{key}-template", placeholder: options[:template].to_s.gsub(/\s+/, ' '), style: 'border: 1px solid gray; width: 99%;', rows: '6' %>
|
144
146
|
</fieldset>
|
145
147
|
|
146
148
|
<div id="page_list_<%= key %>-advanced">
|
@@ -149,12 +151,12 @@
|
|
149
151
|
|
150
152
|
<table width="100%">
|
151
153
|
<tr>
|
152
|
-
<td valign="top">
|
153
|
-
<td><%= text_area
|
154
|
+
<td valign="top">Before:</td>
|
155
|
+
<td><%= text_area :page_objects, "#{key}-header", placeholder: options[:header].to_s.gsub(/\s+/, ' '), style: 'border: 1px solid gray; width: 99%; height: 32px;' %></td>
|
154
156
|
</tr>
|
155
157
|
<tr>
|
156
|
-
<td valign="top">
|
157
|
-
<td><%= text_area
|
158
|
+
<td valign="top">After:</td>
|
159
|
+
<td><%= text_area :page_objects, "#{key}-footer", placeholder: options[:footer].to_s.gsub(/\s+/, ' '), style: 'border: 1px solid gray; width: 99%; height: 32px;' %></td>
|
158
160
|
</tr>
|
159
161
|
</table>
|
160
162
|
</fieldset>
|
@@ -164,12 +166,31 @@
|
|
164
166
|
|
165
167
|
<p>This message is displayed when no pages match the search criteria.</p>
|
166
168
|
|
167
|
-
<%= text_area
|
169
|
+
<%= text_area :page_objects, "#{key}-empty_message", placeholder: options[:empty_message].to_s.gsub(/\s+/, ' '), style: 'border: 1px solid gray; width: 99%; height: 24px;' %>
|
168
170
|
</fieldset>
|
169
171
|
</div>
|
170
172
|
|
171
|
-
<br
|
173
|
+
<br>
|
172
174
|
|
173
175
|
<center><button class="form_button" onclick="hideDojoDialog('page_list_<%= key %>'); return false;">Close</button></center>
|
174
176
|
</div>
|
175
177
|
</div>
|
178
|
+
|
179
|
+
<script type="text/javascript">
|
180
|
+
var displayAsList = jQuery('#page_objects_<%= key %>-style-display-as_list').checked;
|
181
|
+
jQuery('.page_list_<%= key %>_list_option').toggle(displayAsList);
|
182
|
+
jQuery('.page_list_<%= key %>_calendar_option').toggle(!displayAsList);
|
183
|
+
|
184
|
+
// reattach to a safe place in the DOM (away from styled regions)
|
185
|
+
jQuery(document).ready(function () {
|
186
|
+
jQuery('#page_list_<%= key %>').appendTo(jQuery('#page_content_form')[0]);
|
187
|
+
jQuery('#page_objects_<%= key %>-style-display-as_list').click(function () {
|
188
|
+
jQuery('.page_list_<%= key %>_list_option').show();
|
189
|
+
jQuery('.page_list_<%= key %>_calendar_option').hide();
|
190
|
+
});
|
191
|
+
jQuery('#page_objects_<%= key %>-style-display-as_calendar').click(function () {
|
192
|
+
jQuery('.page_list_<%= key %>_list_option').hide();
|
193
|
+
jQuery('.page_list_<%= key %>_calendar_option').show();
|
194
|
+
});
|
195
|
+
});
|
196
|
+
</script>
|
@@ -4,9 +4,9 @@
|
|
4
4
|
-%>
|
5
5
|
<div style="border: 1px solid #f0f0f0;">
|
6
6
|
<table width="100%">
|
7
|
-
<col width="
|
7
|
+
<col width="100" /><col width="*" /><col width="80" />
|
8
8
|
<tr>
|
9
|
-
<td valign="top">Folder <%= i.to_i + 1 %>:</td>
|
9
|
+
<td valign="top">Page/Folder <%= i.to_i + 1 %>:</td>
|
10
10
|
<td>
|
11
11
|
<%= text_field(:page_objects, "#{key}-sources-folder#{i}", :class => 'form', :style => 'margin: 0; padding: 2px; border: 1px solid gray; width: 98%;') %><br/>
|
12
12
|
<%= check_box(:page_objects, "#{key}-sources-folder#{i}-expand-folders", { :class => 'form', :style => '' }, 'true', 'false') %>
|
@@ -3,16 +3,16 @@
|
|
3
3
|
<%- @template_options.each do |name, type| -%>
|
4
4
|
<%- key = name.gsub(/[^\w\d]/, '_') -%>
|
5
5
|
<table width="100%">
|
6
|
-
<col width="
|
6
|
+
<col width="55%" /><col width="45%" />
|
7
7
|
<tr>
|
8
8
|
<td><%= name %></td>
|
9
9
|
<td>
|
10
10
|
<%=
|
11
11
|
case type
|
12
12
|
when :checkbox
|
13
|
-
check_box :page_objects, "obj-option
|
14
|
-
|
15
|
-
text_field :page_objects, "obj-option
|
13
|
+
check_box :page_objects, "obj-option-#{type}-#{key}"
|
14
|
+
else
|
15
|
+
text_field :page_objects, "obj-option-#{type}-#{key}", :style => 'width: 96%;'
|
16
16
|
end
|
17
17
|
%>
|
18
18
|
</td>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<table width="100%">
|
2
|
-
<col width="
|
2
|
+
<col width="20" />
|
3
3
|
<tr>
|
4
4
|
<td></td>
|
5
5
|
<td>
|
@@ -10,28 +10,26 @@
|
|
10
10
|
<tr>
|
11
11
|
<td valign="top">
|
12
12
|
<pre>
|
13
|
-
<%=
|
14
|
-
<%=
|
15
|
-
<%=
|
16
|
-
:header
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:primary_sort_direction => 'asc',
|
23
|
-
:item_count => 5, :item_offset => 1) %>
|
13
|
+
<%= text_editor('Content') %>
|
14
|
+
<%= snippet('Top Nav') %>
|
15
|
+
<%= page_list('My Page List',
|
16
|
+
template: 'html', header: 'html', footer: 'html',
|
17
|
+
folders: 'f1,f2', include_tags: 't1,t2',
|
18
|
+
exclude_tags: 't3,t4', require_tags: 't5,t6',
|
19
|
+
primary_sort_key: 'article_date', primary_sort_direction: 'asc',
|
20
|
+
item_count: 5, item_offset: 1, use_pagination: 1,
|
21
|
+
empty_message: 'Coming soon!') %>
|
24
22
|
</pre>
|
25
23
|
</td>
|
26
24
|
<td valign="top">
|
27
25
|
<pre>
|
28
26
|
<%= template_option('Caption', :string) %>
|
29
27
|
|
30
|
-
<
|
28
|
+
<%- if template_option('Use sidebar?', :checkbox) -%>
|
31
29
|
...
|
32
|
-
<
|
30
|
+
<%- else -%>
|
33
31
|
...
|
34
|
-
<
|
32
|
+
<%- end -%>
|
35
33
|
</pre>
|
36
34
|
</td>
|
37
35
|
</tr>
|
@@ -1,6 +1,6 @@
|
|
1
|
-
<%= form_tag({}, :
|
2
|
-
<%= submit_tag 'Save', :
|
3
|
-
<%= render :
|
1
|
+
<%= form_tag({}, id: 'page_content_form') do %>
|
2
|
+
<%= submit_tag 'Save', id: 'btn_save', style: 'display: none' %>
|
3
|
+
<%= render inline: @template_content %>
|
4
4
|
<% end %>
|
5
5
|
|
6
6
|
<script type="text/javascript">
|
@@ -2,46 +2,24 @@
|
|
2
2
|
|
3
3
|
<h2>Edit Snippet</h2>
|
4
4
|
|
5
|
-
<%= form_tag
|
6
|
-
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
</
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
<td>
|
21
|
-
<%= submit_tag 'Save Snippet', :class => 'form_button' %>
|
22
|
-
<button onclick="$('preview_frame').scrollIntoView(); snip_content.toggleEditor(); $('preview_content').value = $('snip_content_cp').value; $('preview_form').submit(); snip_content.toggleEditor(); return false;" class="form_button">Preview</button>
|
23
|
-
<%= link_to 'Cancel', :action => 'snippets' %>
|
24
|
-
</td>
|
25
|
-
</tr>
|
26
|
-
</table>
|
27
|
-
<br/>
|
28
|
-
|
29
|
-
<%= render :partial => 'template_reference' %>
|
30
|
-
<br/>
|
31
|
-
|
32
|
-
<table width="100%">
|
33
|
-
<col width="100" />
|
34
|
-
<tr>
|
35
|
-
<td valign="top"><div style="margin-top: 2px">Preview:</div></td>
|
36
|
-
<td>
|
37
|
-
<iframe id="preview_frame" name="preview_frame" style="width: 100%; height: 600px; border: 1px solid gray;"></iframe>
|
38
|
-
<%= submit_tag 'Save Snippet', :class => 'form_button' %>
|
39
|
-
</td>
|
40
|
-
</tr>
|
41
|
-
</table>
|
5
|
+
<%= form_tag do %>
|
6
|
+
<%= text_field :snip, :name, :placeholder => 'Snippet Name', :size => '50' %>
|
7
|
+
<div class="codemirror-html-container">
|
8
|
+
<%= text_area :snip, :content, :class => 'codemirror-html autocomplete-off' %>
|
9
|
+
</div>
|
10
|
+
<%= submit_tag 'Save Snippet', :class => 'form_button' %>
|
11
|
+
<button onclick="jQuery('#preview_frame').show(); jQuery('#preview_frame')[0].scrollIntoView(); jQuery('#preview_content').val(jQuery('#snip_content').val()); jQuery('#preview_form').submit(); return false;" class="form_button">Preview</button>
|
12
|
+
<%= link_to 'Cancel', :action => 'sniplates' %>
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<br/>
|
16
|
+
<%= render :partial => 'template_reference' %>
|
17
|
+
<br/>
|
18
|
+
|
19
|
+
<iframe id="preview_frame" name="preview_frame"></iframe>
|
42
20
|
<% end %>
|
43
21
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
22
|
+
<%= form_tag({ :controller => '/cms/content', :action => 'preview_template' }, :id => 'preview_form', :target => 'preview_frame') do %>
|
23
|
+
<%= text_area_tag 'temp[content]', '', :id => 'preview_content', :style => 'display: none;' %>
|
24
|
+
<%= hidden_field_tag 'mode', 'preview' %>
|
25
|
+
<% end %>
|