imagine_cms 5.2.2 → 5.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/Dockerfile +2 -2
  4. data/README.md +18 -12
  5. data/app/assets/javascripts/imagine_cms/core.js +1 -1
  6. data/app/assets/stylesheets/imagine_cms.css.scss +15 -7
  7. data/app/controllers/manage/cms_pages_controller.rb +3 -5
  8. data/app/helpers/cms_application_helper.rb +22 -26
  9. data/app/helpers/cms_custom_helper.rb +13 -0
  10. data/app/views/imagine_cms/_dialogs.html.erb +3 -3
  11. data/app/views/imagine_cms/_header.html.erb +2 -2
  12. data/app/views/manage/cms_pages/_create_file_link.html.erb +16 -3
  13. data/app/views/manage/cms_pages/_crop_feature_image.html.erb +1 -1
  14. data/app/views/manage/cms_pages/_crop_image.html.erb +31 -29
  15. data/app/views/manage/cms_pages/_crop_thumb.html.erb +1 -1
  16. data/app/views/manage/cms_pages/_edit_page.html.erb +10 -1
  17. data/app/views/manage/cms_pages/_gallery_setup.html.erb +1 -1
  18. data/app/views/manage/cms_pages/_list_page_select.html.erb +17 -7
  19. data/app/views/manage/cms_pages/_list_pages_select.html.erb +1 -1
  20. data/app/views/manage/cms_pages/_upload_feature_image.html.erb +51 -11
  21. data/app/views/manage/cms_pages/_upload_file.html.erb +2 -2
  22. data/app/views/manage/cms_pages/_upload_image.html.erb +96 -23
  23. data/app/views/manage/cms_pages/_upload_thumb.html.erb +51 -11
  24. data/app/views/manage/cms_pages/gallery_management.html.erb +1 -1
  25. data/app/views/manage/cms_pages/index.html.erb +1 -1
  26. data/app/views/manage/cms_pages/select_page.html.erb +32 -27
  27. data/app/views/manage/cms_pages/toolbar_preview.html.erb +1 -1
  28. data/app/views/manage/cms_snippets/edit.html.erb +1 -1
  29. data/app/views/management/users/index.html.erb +1 -1
  30. data/docker-compose.override.yml.example +3 -17
  31. data/docker-compose.yml +1 -1
  32. data/lib/extensions/action_controller_extensions.rb +17 -16
  33. data/lib/imagine_cms/engine.rb +1 -0
  34. data/lib/imagine_cms/version.rb +1 -1
  35. metadata +4 -4
@@ -1,8 +1,18 @@
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
- <table cellpadding="0" cellspacing="0" border="0">
3
- <tr>
4
- <td valign="top"><%= image_tag 'management/icon_page.gif', style: 'margin: 2px 5px 0 0;' %></td>
5
- <td<%= list_page_select.published_version >= 0 ? '' : ' style="color: gray"'.html_safe %>><%= list_page_select.name %></td>
6
- </tr>
7
- </table>
1
+ <%- list_page = list_page_select -%>
2
+
3
+ <div id="cb_item_<%= list_page.id %>" class="cb_item<%= ' cb_item_offline' unless list_page.published_version >= 0 %>">
4
+ <%= image_tag 'management/icon_page.gif' %></td>
5
+ <span><%= list_page.name %></span>
8
6
  </div>
7
+
8
+ <script type="text/javascript">
9
+ jQuery('#cb_item_<%= list_page.id %>').on('click', () => {
10
+ jQuery('#page_browser_selection').val('/<%= list_page.path %>');
11
+ setTimeout(() => {
12
+ cbSelectItem('#cb_item_<%= list_page.id %>', <%= @page_level %>, '<%=raw url_for action: 'list_pages_select', level: @page_level + 1, parent_id: list_page.id %>');
13
+ }, 200);
14
+ });
15
+ jQuery('#cb_item_<%= list_page.id %>').on('dblclick', (event) => {
16
+ return false;
17
+ });
18
+ </script>
@@ -1 +1 @@
1
- <%= render :partial => 'list_page_select', :collection => @pages %>
1
+ <%= render partial: 'list_page_select', collection: @pages %>
@@ -5,31 +5,71 @@
5
5
  certain your image is already web-ready. Otherwise, click "Next" to crop and
6
6
  resize your image before using it.</p>
7
7
 
8
- <%= form_tag_with_upload_progress({ :action => 'receive_image', :id => @pg, :overwrite => 1 },
9
- { :finish => "if (arguments[0]) { $('filename').value = arguments[0]; $('mainform').onsubmit(); }" }) do -%>
8
+ <%= form_tag({ action: 'receive_image', id: @pg, overwrite: 1 }, { id: 'upload-image-form', multipart: true }) do %>
10
9
  <table>
11
10
  <tr>
12
11
  <td>File:</td>
13
12
  <td>
14
- <%= file_field 'file', 'data', :class => 'form', :style => 'margin-bottom: 0; width: 150px' %><br/>
13
+ <%= file_field 'file', 'data', :class => 'form', :style => 'margin-bottom: 0; min-width: 150px' %><br/>
15
14
  <span style="color: #888888">Valid image types: jpeg, png, gif</span>
16
15
  </td>
17
16
  </tr>
18
17
  <tr>
19
18
  <td></td>
20
19
  <td>
21
- <div id="upload_status_div" class="error"><%= upload_status_tag %></div>
22
- <%= submit_tag 'Next', :class => 'form_button', :style => 'width: 70px;', :onclick => "if ($('file_data').value == '') return false; $('next_clicked_upload').value = '1'; $('next_clicked').value = '1'; this.disabled = true; this.value = 'Uploading...';" %>
23
- <%= submit_tag 'Finish', :class => 'form_button', :style => 'width: 70px;', :onclick => "if ($('file_data').value == '') return false; this.disabled = true; this.value = 'Uploading...';" %>
24
- <%= link_to_function "Cancel", "cancelSelectThumbnail()" %>
20
+ <%= submit_tag 'Next', id: 'upload-image-next-button', class: 'form_button', style: 'min-width: 70px' %>
21
+ <%= submit_tag 'Finish', id: 'upload-image-finish-button', class: 'form_button', style: 'min-width: 70px' %>
25
22
  <%= text_field_tag 'next_clicked_upload', '0', :style => 'display: none' %>
26
23
  </td>
27
24
  </tr>
28
25
  </table>
29
26
  <%- end -%>
30
27
 
31
- <%= form_remote_tag(:update => 'select_thumbnail_dialog_content', :html => { :id => 'mainform' },
32
- :url => { :action => 'crop_feature_image', :id => @pg }) do -%>
33
- <%= text_field_tag 'next_clicked', '0', :style => 'display: none' %>
34
- <%= text_field_tag 'filename', '', :style => 'display: none' %>
28
+ <%= form_remote_tag(update: 'select_thumbnail_dialog_content', html: { id: 'mainform' },
29
+ url: { action: 'crop_feature_image', id: @pg }) do %>
30
+ <%= text_field_tag 'next_clicked', '0', style: 'display: none' %>
31
+ <%= text_field_tag 'filename', '', style: 'display: none' %>
35
32
  <%- end -%>
33
+
34
+ <script>
35
+ const uploadImageForm = document.getElementById("upload-image-form");
36
+ const nextButton = document.getElementById("upload-image-next-button");
37
+ const finishButton = document.getElementById("upload-image-finish-button");
38
+ const uploadFileField = document.getElementById("file_data");
39
+
40
+ nextButton.addEventListener("click", (e) => {
41
+ e.target.dataset.disableWith = "Uploading...";
42
+ document.getElementById("next_clicked").value = "1";
43
+ });
44
+ finishButton.addEventListener("click", (e) => {
45
+ e.target.dataset.disableWith = "Uploading...";
46
+ });
47
+
48
+ uploadImageForm.addEventListener("submit", async (e) => {
49
+ e.preventDefault();
50
+
51
+ if (uploadFileField.value == "") {
52
+ setTimeout(() => {
53
+ nextButton.value = "Next";
54
+ finishButton.value = "Finish";
55
+ nextButton.dataset.disableWith = null;
56
+ finishButton.dataset.disableWith = null;
57
+ nextButton.disabled = false;
58
+ finishButton.disabled = false;
59
+ });
60
+ return;
61
+ }
62
+
63
+ let file = uploadFileField.files[0];
64
+ let formData = new FormData(uploadImageForm);
65
+
66
+ let resp = await fetch(uploadImageForm.action, {
67
+ method: 'POST',
68
+ body: formData
69
+ });
70
+ let data = await resp.json();
71
+
72
+ document.getElementById("filename").value = data.filename;
73
+ document.getElementById("mainform").onsubmit();
74
+ });
75
+ </script>
@@ -11,14 +11,14 @@
11
11
  <tr>
12
12
  <td>File:</td>
13
13
  <td>
14
- <%= file_field 'file', 'data', :class => 'form', :style => 'margin-bottom: 0; width: 150px' %>
14
+ <%= file_field 'file', 'data', class: 'form', style: 'margin-bottom: 0; min-width: 150px' %>
15
15
  </td>
16
16
  </tr>
17
17
  <tr>
18
18
  <td></td>
19
19
  <td>
20
20
  <div id="upload_status_div" class="error"><%= upload_status_tag %></div>
21
- <%= submit_tag 'Finish', :class => 'form_button', :style => 'width: 70px;', :onclick => "if ($('file_data').value == '') return false; this.disabled = true; this.value = 'Uploading...';" %>
21
+ <%= submit_tag 'Finish', class: 'form_button', style: 'width: 70px;', data: { disable_with: 'Uploading...' } %>
22
22
  <%= link_to_function "Cancel", "cancelInsertFile()" %>
23
23
  </td>
24
24
  </tr>
@@ -1,4 +1,8 @@
1
- <%= javascript_tag "try { $('insert_file_dialog_content').innerHTML = ''; } catch (e) {}" %>
1
+ <script>
2
+ try {
3
+ document.getElementById("insert_file_dialog_content").innerHTML = "";
4
+ } catch (e) { }
5
+ </script>
2
6
 
3
7
  <div id="save_errors" class="error"></div>
4
8
  <h3 style="margin-bottom: 10px;">Insert Image</h3>
@@ -10,12 +14,11 @@
10
14
  certain your image is already web-ready. Otherwise, click "Next" to crop and
11
15
  resize your image before using it.</p>
12
16
 
13
- <%= form_tag_with_upload_progress({ :action => 'receive_image', :id => @pg },
14
- { :finish => "if (arguments[0]) { $('filename').value = arguments[0]; $('mainform').onsubmit(); }" }) do -%>
17
+ <%= form_tag({ action: 'receive_image', id: @pg }, { id: 'upload-image-form', multipart: true }) do %>
15
18
  <table>
16
19
  <tr>
17
20
  <td width="70">Image file:</td>
18
- <td><%= file_field 'file', 'data', :class => 'form', :style => 'margin-bottom: 0; width: 150px' %></td>
21
+ <td><%= file_field 'file', 'data', class: 'form', style: 'margin-bottom: 0; min-width: 250px' %></td>
19
22
  </tr>
20
23
  <tr>
21
24
  <td></td>
@@ -24,50 +27,120 @@
24
27
  <tr>
25
28
  <td></td>
26
29
  <td>
27
- <div id="upload_status_div" class="error"><%= upload_status_tag %></div>
28
- <%= submit_tag 'Next', :class => 'form_button', :style => 'width: 70px;', :onclick => "if ($('file_data').value == '') return false; $('next_clicked_upload').value = '1'; $('next_clicked').value = '1'; this.disabled = true; this.value = 'Uploading...';" %>
29
- <%= submit_tag 'Finish', :class => 'form_button', :style => 'width: 70px;', :onclick => "if ($('file_data').value == '') return false; this.disabled = true; this.value = 'Uploading...';" %>
30
+ <%= submit_tag 'Next', id: 'upload-image-next-button', class: 'form_button', style: 'min-width: 70px' %>
31
+ <%= submit_tag 'Finish', id: 'upload-image-finish-button', class: 'form_button', style: 'min-width: 70px' %>
30
32
  <%= link_to_function "Cancel", "cancelInsertImage()" %>
31
- <%= text_field_tag 'next_clicked_upload', '0', :style => 'display: none' %>
32
33
  </td>
33
34
  </tr>
34
35
  </table>
35
- <%- end -%>
36
- </fieldset><br/>
36
+ <% end %>
37
+ </fieldset><br>
37
38
 
38
39
  <fieldset>
39
40
  <legend>New Photo Gallery</legend>
40
41
 
41
42
  <p>Upload a zip file of images to create a photo gallery.</p>
42
43
 
43
- <%= form_tag_with_upload_progress({ :action => 'receive_gallery', :id => @pg },
44
- { :finish => "if (arguments[0]) { $('dirname').value = arguments[0]; $('mainform_gallery').onsubmit(); }" }) do -%>
44
+ <%= form_tag({ action: 'receive_gallery', id: @pg }, { id: 'upload-gallery-form', multipart: true }) do %>
45
45
  <table>
46
46
  <tr>
47
47
  <td width="70">Zip file:</td>
48
48
  <td>
49
- <%= file_field 'gallery_file', 'data', :class => 'form', :style => 'margin-bottom: 0; width: 150px' %><br/>
49
+ <%= file_field 'gallery_file', 'data', class: 'form', style: 'margin-bottom: 0; min-width: 250px' %><br/>
50
50
  </td>
51
51
  </tr>
52
52
  <tr>
53
53
  <td></td>
54
54
  <td>
55
- <div id="upload_status_div" class="error"><%= upload_status_tag %></div>
56
- <%= submit_tag 'Next', :class => 'form_button', :style => 'width: 70px;', :onclick => "if ($('gallery_file_data').value == '') return false; this.disabled = true; this.value = 'Uploading...';" %>
55
+ <%= submit_tag 'Next', id: 'upload-gallery-next-button', class: 'form_button', style: 'min-width: 70px' %>
57
56
  <%= link_to_function "Cancel", "cancelInsertImage()" %>
58
57
  </td>
59
58
  </tr>
60
59
  </table>
61
- <%- end -%>
60
+ <% end %>
62
61
  </fieldset><br>
63
62
 
64
- <%= form_remote_tag(:update => 'insert_image_dialog_content', :html => { :id => 'mainform' },
65
- :url => { :action => 'crop_image', :id => @pg }) do -%>
66
- <%= text_field_tag 'next_clicked', '0', :style => 'display: none' %>
67
- <%= text_field_tag 'filename', '', :style => 'display: none' %>
63
+ <%= form_remote_tag(update: 'insert_image_dialog_content', html: { id: 'mainform' },
64
+ url: { action: 'crop_image', id: @pg }) do %>
65
+ <%= text_field_tag 'next_clicked', '0', style: 'display: none' %>
66
+ <%= text_field_tag 'filename', '', style: 'display: none' %>
68
67
  <%- end -%>
69
68
 
70
- <%= form_remote_tag(:update => 'insert_image_dialog_content', :html => { :id => 'mainform_gallery' },
71
- :url => { :action => 'gallery_setup', :id => @pg }) do -%>
72
- <%= text_field_tag :dirname, '', :style => 'display: none' %>
69
+ <%= form_remote_tag(update: 'insert_image_dialog_content', html: { id: 'mainform_gallery' },
70
+ url: { action: 'gallery_setup', id: @pg }) do %>
71
+ <%= text_field_tag :dirname, '', style: 'display: none' %>
73
72
  <%- end -%>
73
+
74
+ <script>
75
+ const uploadImageForm = document.getElementById("upload-image-form");
76
+ const uploadGalleryForm = document.getElementById("upload-gallery-form");
77
+ const nextButton = document.getElementById("upload-image-next-button");
78
+ const finishButton = document.getElementById("upload-image-finish-button");
79
+ const uploadFileField = document.getElementById("file_data");
80
+ const galleryFileField = document.getElementById("gallery_file_data");
81
+ const galleryNextButton = document.getElementById("upload-gallery-next-button");
82
+
83
+ nextButton.addEventListener("click", (e) => {
84
+ e.target.dataset.disableWith = "Uploading...";
85
+ document.getElementById("next_clicked").value = "1";
86
+ });
87
+ finishButton.addEventListener("click", (e) => {
88
+ e.target.dataset.disableWith = "Uploading...";
89
+ });
90
+ galleryNextButton.addEventListener("click", (e) => {
91
+ e.target.dataset.disableWith = "Uploading...";
92
+ });
93
+
94
+ uploadImageForm.addEventListener("submit", async (e) => {
95
+ e.preventDefault();
96
+
97
+ if (uploadFileField.value == "") {
98
+ setTimeout(() => {
99
+ nextButton.value = "Next";
100
+ finishButton.value = "Finish";
101
+ nextButton.dataset.disableWith = null;
102
+ finishButton.dataset.disableWith = null;
103
+ nextButton.disabled = false;
104
+ finishButton.disabled = false;
105
+ });
106
+ return;
107
+ }
108
+
109
+ let file = uploadFileField.files[0];
110
+ let formData = new FormData(uploadImageForm);
111
+
112
+ let resp = await fetch(uploadImageForm.action, {
113
+ method: 'POST',
114
+ body: formData
115
+ });
116
+ let data = await resp.json();
117
+
118
+ document.getElementById("filename").value = data.filename;
119
+ document.getElementById("mainform").onsubmit();
120
+ });
121
+
122
+ uploadGalleryForm.addEventListener("submit", async (e) => {
123
+ e.preventDefault();
124
+
125
+ if (galleryFileField.value == "") {
126
+ setTimeout(() => {
127
+ galleryNextButton.value = "Next";
128
+ galleryNextButton.dataset.disableWith = null;
129
+ galleryNextButton.disabled = false;
130
+ });
131
+ return;
132
+ }
133
+
134
+ let file = galleryFileField.files[0];
135
+ let formData = new FormData(uploadGalleryForm);
136
+
137
+ let resp = await fetch(uploadGalleryForm.action, {
138
+ method: 'POST',
139
+ body: formData
140
+ });
141
+ let data = await resp.json();
142
+
143
+ document.getElementById("dirname").value = data.filename;
144
+ document.getElementById("mainform_gallery").onsubmit();
145
+ });
146
+ </script>
@@ -5,31 +5,71 @@
5
5
  certain your image is already web-ready. Otherwise, click "Next" to crop and
6
6
  resize your image before using it.</p>
7
7
 
8
- <%= form_tag_with_upload_progress({ :action => 'receive_image', :id => @pg, :overwrite => 1 },
9
- { :finish => "if (arguments[0]) { $('filename').value = arguments[0]; $('mainform').onsubmit(); }" }) do -%>
8
+ <%= form_tag({ action: 'receive_image', id: @pg, overwrite: 1 }, { id: 'upload-image-form', multipart: true }) do %>
10
9
  <table>
11
10
  <tr>
12
11
  <td>File:</td>
13
12
  <td>
14
- <%= file_field 'file', 'data', :class => 'form', :style => 'margin-bottom: 0; width: 150px' %><br/>
13
+ <%= file_field 'file', 'data', :class => 'form', :style => 'margin-bottom: 0; min-width: 150px' %><br>
15
14
  <span style="color: #888888">Valid image types: jpeg, png, gif</span>
16
15
  </td>
17
16
  </tr>
18
17
  <tr>
19
18
  <td></td>
20
19
  <td>
21
- <div id="upload_status_div" class="error"><%= upload_status_tag %></div>
22
- <%= submit_tag 'Next', :class => 'form_button', :style => 'width: 70px;', :onclick => "if ($('file_data').value == '') return false; $('next_clicked_upload').value = '1'; $('next_clicked').value = '1'; this.disabled = true; this.value = 'Uploading...';" %>
23
- <%= submit_tag 'Finish', :class => 'form_button', :style => 'width: 70px;', :onclick => "if ($('file_data').value == '') return false; this.disabled = true; this.value = 'Uploading...';" %>
20
+ <%= submit_tag 'Next', id: 'upload-image-next-button', class: 'form_button', style: 'min-width: 70px' %>
21
+ <%= submit_tag 'Finish', id: 'upload-image-finish-button', class: 'form_button', style: 'min-width: 70px' %>
24
22
  <%= link_to_function "Cancel", "cancelSelectThumbnail()" %>
25
- <%= text_field_tag 'next_clicked_upload', '0', :style => 'display: none' %>
26
23
  </td>
27
24
  </tr>
28
25
  </table>
29
26
  <%- end -%>
30
27
 
31
- <%= form_remote_tag(:update => 'select_thumbnail_dialog_content', :html => { :id => 'mainform' },
32
- :url => { :action => 'crop_thumb', :id => @pg }) do -%>
33
- <%= text_field_tag 'next_clicked', '0', :style => 'display: none' %>
34
- <%= text_field_tag 'filename', '', :style => 'display: none' %>
28
+ <%= form_remote_tag(update: 'select_thumbnail_dialog_content', html: { id: 'mainform' },
29
+ url: { action: 'crop_thumb', id: @pg }) do %>
30
+ <%= text_field_tag 'next_clicked', '0', style: 'display: none' %>
31
+ <%= text_field_tag 'filename', '', style: 'display: none' %>
35
32
  <%- end -%>
33
+
34
+ <script>
35
+ const uploadImageForm = document.getElementById("upload-image-form");
36
+ const nextButton = document.getElementById("upload-image-next-button");
37
+ const finishButton = document.getElementById("upload-image-finish-button");
38
+ const uploadFileField = document.getElementById("file_data");
39
+
40
+ nextButton.addEventListener("click", (e) => {
41
+ e.target.dataset.disableWith = "Uploading...";
42
+ document.getElementById("next_clicked").value = "1";
43
+ });
44
+ finishButton.addEventListener("click", (e) => {
45
+ e.target.dataset.disableWith = "Uploading...";
46
+ });
47
+
48
+ uploadImageForm.addEventListener("submit", async (e) => {
49
+ e.preventDefault();
50
+
51
+ if (uploadFileField.value == "") {
52
+ setTimeout(() => {
53
+ nextButton.value = "Next";
54
+ finishButton.value = "Finish";
55
+ nextButton.dataset.disableWith = null;
56
+ finishButton.dataset.disableWith = null;
57
+ nextButton.disabled = false;
58
+ finishButton.disabled = false;
59
+ });
60
+ return;
61
+ }
62
+
63
+ let file = uploadFileField.files[0];
64
+ let formData = new FormData(uploadImageForm);
65
+
66
+ let resp = await fetch(uploadImageForm.action, {
67
+ method: 'POST',
68
+ body: formData
69
+ });
70
+ let data = await resp.json();
71
+
72
+ document.getElementById("filename").value = data.filename;
73
+ document.getElementById("mainform").onsubmit();
74
+ });
75
+ </script>
@@ -95,7 +95,7 @@
95
95
  <td></td>
96
96
  <td>
97
97
  <div id="upload_status_div" class="error"><%= upload_status_tag %></div>
98
- <%= submit_tag 'Next', :class => 'form_button', :style => 'width: 70px;', :onclick => "if ($('gallery_file_data').value == '') return false; this.disabled = true; this.value = 'Uploading...';" %>
98
+ <%= submit_tag 'Next', class: 'form_button', style: 'width: 70px;', data: { disable_with: 'Uploading...' } %>
99
99
  </td>
100
100
  </tr>
101
101
  </table>
@@ -70,7 +70,7 @@
70
70
  jQuery('#edit_content_link').prop('href', '<%=raw url_for action: 'edit_page_content', id: list_page, authenticity_token: form_authenticity_token.to_s %>');
71
71
  jQuery('#delete_link').prop('href', '<%=raw url_for action: 'delete_page', id: list_page.id %>');
72
72
  </script>
73
- <script type="text/javascript" async>
73
+ <script type="text/javascript" defer>
74
74
  dojo.require("dojo.widget.*");
75
75
  dojo.require("dojo.widget.Dialog");
76
76
  </script>
@@ -1,52 +1,57 @@
1
- <%
1
+ <%-
2
2
  cbNumColumns = 0;
3
3
  cbColWidth = 200;
4
- cbColHeight = 200;
4
+ cbColHeight = 343;
5
5
  -%>
6
6
  <script type="text/javascript">
7
- dojo.require("dojo.widget.*");
8
- dojo.require("dojo.widget.Dialog");
9
-
10
7
  window.cbColWidth = <%= cbColWidth %>;
11
8
  window.cbColHeight = <%= cbColHeight %>;
12
9
  </script>
10
+ <style type="text/css">
11
+ .cb_column {
12
+ width: <%= cbColWidth %>px;
13
+ height: <%= cbColHeight %>px;
14
+ }
15
+ </style>
13
16
 
14
- <div id="columnBrowserContainer" style="width: 100%; height: <%= cbColHeight + 20 %>px; overflow: auto;">
17
+ <div id="columnBrowserContainer" style="height: <%= cbColHeight + 2 %>px;">
15
18
  <div id="columnBrowser" style="width: <%= (cbColWidth+1) * @page_levels.size %>px;">
16
- <% @page_levels.each_with_index do |name, i| %>
17
- <%
18
- if !name.blank?
19
- @path << '/' if !@path.blank?
19
+ <%- @page_levels.each_with_index do |name, i| -%>
20
+ <%-
21
+ if name.present?
22
+ @path << '/' if @path.present?
20
23
  @path << name
21
24
  end
22
25
  @parent = @page
23
26
  @page = CmsPage.find_by_path @path
24
27
  @page_level = i
25
28
  @pages = @parent.children if @parent
26
-
29
+
27
30
  break_flag = false
28
-
31
+
29
32
  if !@page
30
- if @parent && @parent.children.first
31
- @page = @parent.children.first
32
- elsif @parent
33
- @page = @parent
34
- else
35
- @page = CmsPage.find(:first)
36
- end
33
+ @page = @parent.children.first || @parent || CmsPage.first
37
34
  break_flag = true
38
35
  end
39
36
  -%>
40
37
  <div id="columnBrowserLevel<%= i %>" class="cb_column">
41
- <% if i == 0 -%>
42
- <%= render :partial => 'list_page_select', :locals => { :list_page_select => CmsPage.find(1) } %>
43
- <% else -%>
44
- <%= render :partial => 'list_pages_select' %>
45
- <% end -%>
46
- <%= javascript_tag "$('cb_item_#{@parent.id}').className = 'cb_item cb_item_selected';" if @parent %>
38
+ <%- if i == 0 -%>
39
+ <%= render partial: 'list_page_select', locals: { list_page_select: CmsPage.first } %>
40
+ <%- else -%>
41
+ <%= render partial: 'list_pages_select' %>
42
+ <%- end -%>
43
+ <%= javascript_tag "jQuery('#cb_item_#{@parent.id}').addClass('cb_item_selected')[0].scrollIntoView();" if @parent %>
47
44
  </div>
48
45
  <%- break if break_flag -%>
49
- <% end -%>
46
+ <%- end -%>
50
47
  </div>
51
48
  </div>
52
- <%= javascript_tag "cbNumColumns = #{@page_levels.size - 1}; try { $('columnBrowserContainer').scrollLeft = $('columnBrowserContainer').scrollWidth; } catch (e) {}; $('page_browser_selection').value = '/#{@page.path}';" %>
49
+
50
+ <%- list_page = @page -%>
51
+
52
+ <script type="text/javascript">
53
+ cbNumColumns = <%= @page_levels.size - 1 %>;
54
+ jQuery('#columnBrowserLevel' + cbNumColumns)[0].scrollIntoView();
55
+
56
+ jQuery('#page_browser_selection').val('/<%= @page.path %>');
57
+ </script>
@@ -1,4 +1,4 @@
1
- <div class="ccs-toolbar EditorToolbarDomNode EditorToolbarSmallBg" style="height: 25px;">
1
+ <div class="ccs-toolbar EditorToolbarDomNode EditorToolbarSmallBg" style="height: 25px; min-width: 900px;">
2
2
  <table cellpadding="1" cellspacing="0" border="0">
3
3
  <tbody>
4
4
  <tr valign="top" align="left">
@@ -2,7 +2,7 @@
2
2
 
3
3
  <h2><%= params[:action].titlecase %> Snippet</h2>
4
4
 
5
- <%= form_with(model: ['manage', @cms_snippet], local: true) do |f| %>
5
+ <%= form_with(model: [:manage, @cms_snippet], local: true) do |f| %>
6
6
  <%= f.text_field :name, placeholder: 'Snippet Name', :size => '50' %>
7
7
  <div class="codemirror-html-container">
8
8
  <%= f.text_area :content, class: 'codemirror-html autocomplete-off' %>
@@ -20,7 +20,7 @@
20
20
  <td><%= u.last_name %></td>
21
21
  <td><%= u.active? ? 'Y' : 'N' %>
22
22
  <td><%= button_to(u.active? ? 'Disable' : 'Enable', { :action => (u.active? ? 'disable' : 'enable'), :id => u}, :class => 'form_button') if u.username != session[:user_username] %></td>
23
- <td><%= button_to('Delete', { :action => 'destroy', :id => u }, :method => :delete, :class => 'form_button', :onclick => "return confirm('Are you sure you want to delete #{u.username}?');") if u.username != session[:user_username] %></td>
23
+ <td><%= button_to('Delete', { action: 'destroy', id: u }, method: :delete, class: 'form_button', data: { confirm: "Are you sure you want to delete #{u.username}?" }) if u.username != session[:user_username] %></td>
24
24
  </tr>
25
25
  <% end %>
26
26
  </table>
@@ -11,34 +11,20 @@ services:
11
11
  volumes:
12
12
  - ../mysite:/home/app/myapp:delegated # set to (relative) path to site you want to run
13
13
  # - .:/home/app/imagine_cms:delegated # when working on imagine itself
14
- # - ./prototype-rails:/home/app/prototype-rails:delegated # when working on imagine dependency prototype-rails
15
- - log:/home/app/myapp/log
16
- - node_modules:/home/app/myapp/node_modules
14
+ - /home/app/myapp/log
15
+ - /home/app/myapp/tmp
17
16
  - gems:/usr/local/rvm/gems
18
17
  - ~/.gitconfig:/home/app/.gitconfig # if you want to commit from within the container
19
18
  # environment:
20
19
  # PASSENGER_APP_ENV: production
21
- # networks: # to use traefik, uncomment this along with the networks section at the bottom
22
- # - traefik
23
- # - default
24
- # labels:
25
- # traefik.docker.network: traefik
26
20
 
27
21
  db:
28
22
  ports: # access using mysql -P (not -p), ex: mysql -h 127.0.0.1 -P 33060 -u root
29
23
  # - '33060:3306' # <---- change the first number to set your local port
30
24
  - '3306' # <---- or omit the first number entirely to use a random local port (use `docker ps`)
31
25
  volumes:
32
- - db-data:/var/lib/mysql
26
+ - /var/lib/mysql
33
27
 
34
28
  volumes:
35
- db-data:
36
- log:
37
- node_modules:
38
- tmp:
39
29
  gems:
40
30
  external: true
41
-
42
- # networks:
43
- # traefik:
44
- # external: true
data/docker-compose.yml CHANGED
@@ -16,4 +16,4 @@ services:
16
16
  MYSQL_ALLOW_EMPTY_PASSWORD: 1
17
17
 
18
18
  # redis:
19
- # image: redis:4.0-32bit # not really 32-bit, just compiled that way to reduce memory usage
19
+ # image: redis:5.0-32bit # not really 32-bit, just compiled that way to reduce memory usage
@@ -233,29 +233,30 @@ module ActionControllerExtensions
233
233
  content << '</div>'
234
234
  content << <<-EOT
235
235
  <script type="text/javascript">
236
- jQuery('##{key}').css({ opacity: '1', cursor: 'default' });
237
- jQuery('.imagine_cms-paginator-link').not('.imagine_cms-paginator-link-selected').mouseover(function () {
238
- jQuery(this).addClass('imagine_cms-paginator-link-selected');
239
- }).mouseout(function () {
240
- jQuery(this).removeClass('imagine_cms-paginator-link-selected');
241
- });
242
-
236
+ setTimeout(() => {
237
+ jQuery('##{key}').css({ opacity: '1', cursor: 'default' });
238
+ jQuery('.imagine_cms-paginator-link').not('.imagine_cms-paginator-link-selected').mouseover(function () {
239
+ jQuery(this).addClass('imagine_cms-paginator-link-selected');
240
+ }).mouseout(function () {
241
+ jQuery(this).removeClass('imagine_cms-paginator-link-selected');
242
+ });
243
243
  EOT
244
244
  num_segments.times do |seg|
245
245
  start = seg * limit
246
246
  content << <<-EOT
247
- jQuery('##{key}-segment-#{seg}').click(function () {
248
- jQuery('##{key}').css({ cursor: 'wait', opacity: '0.5' });
249
- jQuery('html,body').animate({ scrollTop: jQuery('##{key}').position().top }, 200);
250
- jQuery.get('#{url_for(:content_path => @pg.path.split('/').concat([ 'segment', start.to_s, name ]), :only_path => true)}', function (data) {
251
- jQuery('##{key}').html(data);
252
- jQuery('##{key}').css({ cursor: 'default', opacity: '1' });
253
- });
254
- return false;
255
- })
247
+ jQuery('##{key}-segment-#{seg}').click(function () {
248
+ jQuery('##{key}').css({ cursor: 'wait', opacity: '0.5' });
249
+ jQuery('html,body').animate({ scrollTop: jQuery('##{key}').position().top }, 200);
250
+ jQuery.get('#{url_for(:content_path => @pg.path.split('/').concat([ 'segment', start.to_s, name ]), :only_path => true)}', function (data) {
251
+ jQuery('##{key}').html(data);
252
+ jQuery('##{key}').css({ cursor: 'default', opacity: '1' });
253
+ });
254
+ return false;
255
+ })
256
256
  EOT
257
257
  end
258
258
  content << <<-EOT
259
+ });
259
260
  </script>
260
261
  EOT
261
262
  end
@@ -51,6 +51,7 @@ module ImagineCms
51
51
  end
52
52
 
53
53
  initializer 'imagine_cms.load_helpers' do |app|
54
+ ActionController::Base.send :include, CmsCustomHelper
54
55
  ActionController::Base.send :include, CmsApplicationHelper
55
56
  end
56
57
 
@@ -1,3 +1,3 @@
1
1
  module ImagineCms
2
- VERSION = "5.2.2"
2
+ VERSION = "5.2.6"
3
3
  end