imagine_cms 5.2.1 → 5.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8bcd149b6bf5e054f02e3e7e05914945359aa56a5e3886064a7a880c48277c4d
4
- data.tar.gz: 1d2e69ce6b6f4654788a81c5c2ec91f219932ce2a57fbfca0ae0addb780c174d
3
+ metadata.gz: 463afd9f9daba1b0c0a16f0df7fd8e70a0c990d9bfad455cd65fccfc2c06d71c
4
+ data.tar.gz: 515cb433392199c789c3557ab622c5819df8d851f4f165433bfd0e0bd6ca289c
5
5
  SHA512:
6
- metadata.gz: 52d088e7e5f6f5879c98aa933d3f0c8ccc59b077e38b83fdb909383a0cc1d8f8717bc98e8e9590b8e4f0d1a6119a313d7c5ebbfc3ba4332e313a04256e827dd8
7
- data.tar.gz: 36f21b1b084531fb055e0ff19efbc1b2d850d01e3ccbb0e312b74b6aeea611b64c49db5a0fe0268415260e54fd483ddb0a3fcc876272f56cab7d5c39d3ab1d26
6
+ metadata.gz: dbffc87ab7a4088661650784ba2114cf09d0533866f23b05be424ef3bd6fb39e0e646becae7e96026f4b3323a81b1a18d9768a5ba0e0ff2501d47cbbfc77415e
7
+ data.tar.gz: 6812f71fcff897f94907b4f101fdecdc3569f2f42a117cef95cd7c81bedd4e65b386c9ac478db788919953abc300504d06ddb8325fc6d14e5e76a29b2a6ffd66
data/Dockerfile CHANGED
@@ -10,10 +10,10 @@ RUN apt-get upgrade -y -o Dpkg::Options::="--force-confnew"
10
10
 
11
11
  # Install other packages we depend on
12
12
  RUN apt-get install -y mysql-client
13
+ RUN apt-get install -y memcached
13
14
  RUN apt-get install -y libmagickcore-dev libmagickwand-dev # for rmagick2 gem
14
15
  RUN apt-get install -y imagemagick # for mini-magick gem
15
- RUN apt-get install -y openjdk-8-jre-headless # java for fop
16
- RUN apt-get install -y cmake pkg-config # for rugged (git)
16
+ # RUN apt-get install -y openjdk-8-jre-headless # java for fop (rarely used; add to your own Dockerfile if you need it)
17
17
  RUN apt-get autoremove -y
18
18
 
19
19
  # apt clean up
@@ -27,7 +27,8 @@ COPY /docker/conf/nginx-vhost.conf.template /etc/nginx/
27
27
  RUN rm -f /etc/nginx/sites-enabled/default
28
28
 
29
29
  # Add custom services
30
- RUN mkdir /etc/service/memcached
30
+ RUN mkdir -p /etc/service/memcached
31
+ RUN rm -f /etc/service/memcached/down
31
32
  COPY docker/services/memcached /etc/service/memcached/run
32
33
 
33
34
  # For convenience
data/README.md CHANGED
@@ -48,3 +48,14 @@ Get paid support and hosting for Imagine CMS straight from the people who made i
48
48
  ## Contributing
49
49
 
50
50
  Imagine 7 (Crystal) will be a true open source project, but this project (Ruby-based Imagine) will remain more or less closed for the foreseeable future. If companies or individuals are willing to sponsor or co-develop new features, we can work something out.
51
+
52
+ ## Building Docker Image
53
+
54
+ (notes for myself)
55
+
56
+ ```bash
57
+ docker build -t anamba/imagine5-dev:latest .
58
+ docker tag anamba/imagine5-dev:latest anamba/imagine5-dev:5.2.1
59
+ docker tag anamba/imagine5-dev:latest anamba/imagine5-dev:5.2
60
+ docker push anamba/imagine5-dev
61
+ ```
@@ -9599,7 +9599,7 @@ var _8d9=dojo.html.getUnitValue(this.domNode,"line-height");
9599
9599
  if(_8d9.value&&_8d9.units==""){
9600
9600
  _8d8=_8d9.value;
9601
9601
  }
9602
- dojo.html.insertCssText("body,html{background:transparent;padding:0;margin:0;}"+"body{top:0;left:0;right:0;"+(((this.height)||(dojo.render.html.opera))?"":"position:fixed;")+"font:"+font+";"+"min-height:"+this.minHeight+";"+"line-height:"+_8d8+"}"+"p{margin: 1em 0 !important;}"+"body > *:first-child{padding-top:0 !important;margin-top:"+this._firstChildContributingMargin+"px !important;}"+"body > *:last-child{padding-bottom:0 !important;margin-bottom:"+this._lastChildContributingMargin+"px !important;}"+"li > ul:-moz-first-node, li > ol:-moz-first-node{padding-top:1.2em;}\n"+"li{min-height:1.2em;}"+"",this.document);
9602
+ dojo.html.insertCssText("body,html{background:transparent;padding:0;margin:5px;}"+"body{top:0;left:0;right:0;"+(((this.height)||(dojo.render.html.opera))?"":"position:fixed;")+"font:"+font+";"+"min-height:"+this.minHeight+";"+"line-height:"+_8d8+"}"+"p{margin: 1em 0 !important;}"+"body > *:first-child{padding-top:0 !important;margin-top:"+this._firstChildContributingMargin+"px !important;}"+"body > *:last-child{padding-bottom:0 !important;margin-bottom:"+this._lastChildContributingMargin+"px !important;}"+"li > ul:-moz-first-node, li > ol:-moz-first-node{padding-top:1.2em;}\n"+"li{min-height:1.2em;}"+"",this.document);
9603
9603
  dojo.html.removeNode(_8cd);
9604
9604
  this.document.body.innerHTML=html;
9605
9605
  if(_8ca||dojo.render.html.safari){
@@ -83,19 +83,14 @@ function dpNextMonth(object, method_prefix, max_year) {
83
83
  ********************************/
84
84
 
85
85
  var cbNumColumns = 0;
86
- var cbColWidth = '200px';
87
- var cbColHeight = '240px';
88
- var cbBorderWidth = '1px';
89
- var cbColWidthFull = 202;
86
+ var cbColWidth = 200;
87
+ var cbColHeight = 240;
90
88
 
91
89
  function cbAddColumn() {
92
- var currentWidth = parseInt($('columnBrowser').style.width, 10);
93
- // if (currentWidth < ((cbNumColumns+1) * cbColWidthFull)) {
94
- $('columnBrowser').style.width = '' + ((cbNumColumns+1) * cbColWidthFull) + 'px';
95
- $('columnBrowserContainer').scrollLeft = $('columnBrowserContainer').scrollWidth;
96
- // }
97
- $('columnBrowser').innerHTML += "<div id=\"columnBrowserLevel" + cbNumColumns + "\" style=\"width: " + cbColWidth + "; height: " + cbColHeight + "; overflow: auto; float: left; border-width: " + cbBorderWidth + " " + cbBorderWidth + " " + cbBorderWidth + " " + (cbNumColumns == 0 ? cbBorderWidth : '0') + "; border-style: solid; border-color: gray;\">Loading...</div>";
90
+ jQuery('#columnBrowser').append('<div id="columnBrowserLevel' + cbNumColumns + '" class="cb_column">Loading...</div>');
91
+ jQuery('#columnBrowserContainer').scrollLeft(jQuery('#columnBrowserContainer')[0].scrollWidth);
98
92
  cbNumColumns++;
93
+ jQuery('#columnBrowser').css({ width: '' + ((cbColWidth+1) * cbNumColumns) + 'px' });
99
94
  }
100
95
 
101
96
  function getScrollbarPosition(el) {
@@ -110,31 +105,25 @@ function setScrollbarPosition(el, coords) {
110
105
  }
111
106
 
112
107
  function cbSelectItem(el, currentLevel, urlForNextLevel) {
113
- var el = $(el);
114
- coords = getScrollbarPosition(el.parentNode);
108
+ var el = jQuery(el);
109
+ // coords = getScrollbarPosition(el.parentNode);
115
110
 
116
- // remove all higher levels and unselect all other same-level divs
111
+ // remove all higher levels
117
112
  for (var i = currentLevel + 1; i <= cbNumColumns; i++) {
118
- d = $('columnBrowserLevel' + i);
119
- if (d) d.parentNode.removeChild(d);
113
+ jQuery('#columnBrowserLevel' + i).remove();
120
114
  }
121
115
  cbNumColumns = currentLevel + 1;
122
-
123
- prefix = 'cb_item_';
124
- $A(el.parentNode.childNodes).each(function (d) {
125
- if (d.id && d.id.substring(0, prefix.length) == prefix) {
126
- d.className = 'cb_item';
127
- }
128
- })
129
-
130
- // select and expand current dept div
131
- el.className = 'cb_item cb_item_selected';
132
-
116
+
117
+ // unselect all other same-level divs and select target
118
+ // prefix = 'cb_item_';
119
+ el.siblings().removeClass('cb_item_selected');
120
+ el.addClass('cb_item_selected');
121
+
122
+ // display children
133
123
  cbAddColumn();
134
- el = $(el.id);
135
- new Ajax.Updater('columnBrowserLevel' + (currentLevel+1), urlForNextLevel, {method: 'GET', asynchronous:true, evalScripts:true});
136
-
137
- setScrollbarPosition(el.parentNode, coords);
124
+ new Ajax.Updater('columnBrowserLevel' + (currentLevel+1), urlForNextLevel, {method: 'GET', asynchronous: true, evalScripts: true});
125
+
126
+ // setScrollbarPosition(el.parentNode, coords);
138
127
  }
139
128
 
140
129
 
@@ -346,13 +335,15 @@ function closePageBrowser() {
346
335
  $(pageBrowserFieldID).value = $('page_browser_selection').value;
347
336
  }
348
337
 
349
-
338
+ // first level of this hash is parent_key below
350
339
  var cmsPageObjects = {};
340
+
351
341
  function scanForPageObjects(page_id, parent_key, version) {
352
342
  if (jQuery('#page_objects_' + parent_key).val().length == 0) return;
353
-
343
+
354
344
  var found = {};
355
-
345
+ if (!cmsPageObjects[parent_key]) cmsPageObjects[parent_key] = {};
346
+
356
347
  var regex = /<%=\s*insert_object\(?\s*['"]([-\w\s\d]+)['"],\s*:(\w+)\s*(.*?)\)?\s*%>/gm;
357
348
  var matches = jQuery('#page_objects_' + parent_key).val().match(regex);
358
349
  if (matches) {
@@ -367,7 +358,7 @@ function scanForPageObjects(page_id, parent_key, version) {
367
358
  }
368
359
  });
369
360
  }
370
-
361
+
371
362
  var regex = /<%=\s*(?:page_list|pagelist)\(?\s*['"]([-\w\s\d]+)['"](.*?)\)?\s*%>/gm;
372
363
  var matches = jQuery('#page_objects_' + parent_key).val().match(regex);
373
364
  if (matches) {
@@ -382,22 +373,22 @@ function scanForPageObjects(page_id, parent_key, version) {
382
373
  }
383
374
  });
384
375
  }
385
-
376
+
386
377
  // remove the cruft
387
378
  jQuery.each(cmsPageObjects, function(key, val) {
388
- if (cmsPageObjects[key] != found[key]) {
379
+ if (cmsPageObjects[parent_key][key] != found[key]) {
389
380
  obj_key = val + '_container_obj-' + val + '-' + key.replace(/[^\w]/g, '_');
390
381
  while (jQuery('#' + obj_key).length > 0) {
391
382
  jQuery('#' + obj_key).remove();
392
383
  }
393
- cmsPageObjects[key] = null;
384
+ cmsPageObjects[parent_key][key] = null;
394
385
  }
395
386
  });
396
387
 
397
388
  // bring in the new
398
389
  jQuery.each(found, function (key, val) {
399
- if (!cmsPageObjects[key]) {
400
- cmsPageObjects[key] = val;
390
+ if (!cmsPageObjects[parent_key][key]) {
391
+ cmsPageObjects[parent_key][key] = val;
401
392
  jQuery.get('/manage/cms_pages/' + page_id + '/insert_page_object_config?version= ' + version +
402
393
  '&name=' + key + '&type=' + val + '&parent_key=' + parent_key);
403
394
  }
@@ -34,13 +34,56 @@ div.auto_complete ul strong.highlight {
34
34
 
35
35
 
36
36
  /** column browser **/
37
+ #columnBrowserContainer {
38
+ width: 100%; max-height: 90vh;
39
+ overflow: auto;
40
+ border: 1px solid gray;
41
+ border-width: 0 0 0 1px;
42
+ }
43
+ #columnBrowserToolbar {
44
+ background-color: #ddd;
45
+ padding: 5px 4px 0;
46
+ margin: 0 0 5px;
37
47
 
48
+ a {
49
+ margin-left: 2px;
50
+ }
51
+ a:first-child { margin-left: 0; }
52
+ }
53
+ .cb_column {
54
+ overflow: auto;
55
+ float: left;
56
+ border: 1px solid gray;
57
+ border-width: 1px 1px 1px 0;
58
+ }
38
59
  .cb_item {
60
+ position: relative;
39
61
  color: black;
40
- padding-left: 2px;
41
- }
62
+ padding: 2px;
63
+ width: calc(100% - 22px);
64
+ overflow: hidden;
65
+ float: left;
66
+ cursor: pointer;
67
+
68
+ img { position: absolute; left: 5px; top: 5px; }
69
+ span {
70
+ display: block;
71
+ padding: 2px 0px 2px 20px;
72
+ -webkit-user-select: none;
73
+ -moz-user-select: none;
74
+ -ms-user-select: none;
75
+ user-select: none;
76
+ }
77
+ }
42
78
 
43
79
  .cb_item.cb_item_selected {
44
80
  color: white;
45
81
  background-color: #506D91;
46
82
  }
83
+
84
+ .cb_item.cb_item_offline {
85
+ color: gray;
86
+ }
87
+ .cb_item.cb_item_offline.cb_item_selected {
88
+ color: lightgray;
89
+ }
@@ -268,7 +268,7 @@ module Cms # :nodoc:
268
268
  def rss_feed
269
269
  min_time = Time.rfc2822(request.env["HTTP_IF_MODIFIED_SINCE"]) rescue nil
270
270
  if min_time && (Time.now - min_time) < 5.minutes
271
- render text: '', status: '304 Not Modified' and return
271
+ render plain: '', status: '304 Not Modified' and return
272
272
  end
273
273
 
274
274
  @@cms_page_table_exists ||= CmsPage.table_exists?
@@ -292,7 +292,7 @@ module Cms # :nodoc:
292
292
 
293
293
  if min_time && @most_recent_pub_date.published_date && @most_recent_pub_date.published_date <= min_time
294
294
  # use cached version
295
- render text: '', status: '304 Not Modified' and return
295
+ render plain: '', status: '304 Not Modified' and return
296
296
  end
297
297
 
298
298
  @pages.each_with_index do |page, index|
@@ -448,10 +448,10 @@ class Manage::CmsPagesController < Manage::ApplicationController
448
448
  logger.error(e)
449
449
  end
450
450
  end
451
-
452
- render nothing: true
451
+
452
+ render plain: 'success'
453
453
  end
454
-
454
+
455
455
  #
456
456
  # helpers
457
457
  #
@@ -475,12 +475,23 @@ class Manage::CmsPagesController < Manage::ApplicationController
475
475
  focusOnLoad = !defined?(@cms_text_editor_placed)
476
476
  @cms_text_editor_placed = true
477
477
  content = ''.html_safe
478
- content << text_area(:page_objects, key, { :dojoType => 'Editor2', :toolbarGroup => 'main', :isToolbarGroupLeader => 'false',
479
- :focusOnLoad => focusOnLoad.to_s, :style => 'border: 2px dashed gray; padding: 5px',
480
- :minHeight => '100px' }.update(html_options))
481
- content << content_tag(:div, ''.html_safe, :id => "page_object_config_#{key}")
482
- content << javascript_tag("jQuery(document).ready(function () { scanForPageObjects(#{@pg.id}, '#{key}', #{@pg.version}); });")
483
- content << observe_field("page_objects_#{key}", :function => "scanForPageObjects(#{@pg.id}, '#{key}', #{@pg.version});", :frequency => 2)
478
+ content << text_area(:page_objects, key,
479
+ { dojoType: 'Editor2', toolbarGroup: 'main', isToolbarGroupLeader: 'false',
480
+ focusOnLoad: focusOnLoad.to_s, style: 'border: 2px dashed gray; padding: 5px',
481
+ minHeight: '100px' }.update(html_options))
482
+ content << content_tag(:div, '', id: "page_object_config_#{key}")
483
+ script_tag = <<-EOT
484
+ <script type="text/javascript">
485
+ window.addEventListener('load', (event) => {
486
+ scanForPageObjects(#{@pg.id}, '#{key}', #{@pg.version});
487
+ setInterval(function() {
488
+ scanForPageObjects(#{@pg.id}, '#{key}', #{@pg.version});
489
+ }, 1000);
490
+ });
491
+ </script>
492
+ EOT
493
+ content << script_tag.html_safe
494
+ # content << observe_field("page_objects_#{key}", function: "scanForPageObjects(#{@pg.id}, '#{key}', #{@pg.version});", frequency: 2)
484
495
  content
485
496
  when :page_list
486
497
  # set defaults unless values are present in template
@@ -1275,35 +1286,35 @@ class Manage::CmsPagesController < Manage::ApplicationController
1275
1286
  protected
1276
1287
 
1277
1288
  def check_permissions
1278
- if !user_has_permission?(:manage_cms)
1279
- render '/imagine_cms/errors/permission_denied', :layout => false
1289
+ unless user_has_permission?(:manage_cms)
1290
+ render '/imagine_cms/errors/permission_denied', layout: false
1280
1291
  return false
1281
1292
  end
1282
1293
  end
1283
1294
 
1284
1295
  def validate_user_access
1285
- unless @user.cms_allowed_sections.to_s.strip.blank?
1286
- allowed_sections = @user.cms_allowed_sections.split(',').map { |s| s.strip }.reject { |s| s.blank? }
1296
+ unless (allowed_sections_str = @user.cms_allowed_sections.to_s.strip).blank?
1297
+ allowed = false
1298
+ allowed_sections = allowed_sections_str.split(',').map(&:strip).reject(&:blank?)
1287
1299
  if @pg
1288
1300
  path = '/' + @pg.path
1301
+ allowed_sections.each { |s| allowed ||= (path =~ /^#{s}/) }
1289
1302
  else
1290
- parent = CmsPage.find_by_id(params[:parent_id] || params[:pg][:parent_id]) rescue nil
1291
- return false if !parent
1292
- path = '/' + parent.path
1303
+ if (parent = CmsPage.find_by_id(params[:parent_id] || params[:pg][:parent_id]) rescue nil)
1304
+ path = '/' + parent.path
1305
+ allowed_sections.each { |s| allowed ||= (path =~ /^#{s}/) }
1306
+ end
1293
1307
  end
1294
-
1295
- allowed = false
1296
- allowed_sections.each { |s| allowed ||= (path =~ /^#{s}/) }
1297
-
1298
- if !allowed
1308
+
1309
+ unless allowed
1299
1310
  respond_to do |wants|
1300
- wants.js { render :text => "Sorry, you don't have permission to edit this page." }
1301
- wants.html { redirect_to "/#{@pg.path}#{@pg.path == '' ? '' : '/'}version/#{@pg.version}" }
1311
+ wants.js { render plain: 'Sorry, you don\'t have permission to edit this page.' }
1312
+ wants.html { redirect_to "/#{@pg.path}#{@pg.path == '' ? '' : '/'}version/#{@pg.version}" }
1302
1313
  end
1303
1314
  return false
1304
1315
  end
1305
1316
  end
1306
-
1317
+
1307
1318
  true
1308
1319
  end
1309
1320
 
@@ -813,17 +813,21 @@ module CmsApplicationHelper
813
813
  default_value = Time.parse(default_value) if default_value.is_a?(String)
814
814
  default_value ||= start_date
815
815
 
816
- draw_calendar = "new Ajax.Updater('date_picker_#{object}_#{method_prefix}_days', '" + date_picker_url + "?" +
817
- "month=' + $('#{object}_#{method_prefix}_month_sel').value + " +
818
- "'&year=' + $('#{object}_#{method_prefix}_year_sel').value + " +
819
- "'&min_time=' + #{start_date.to_i} + " +
820
- "'&max_time=' + #{end_date.to_i} + " +
821
- "'&exclude_days=#{exclude_days.join(',')}' + " +
822
- "'&onchange=#{escape_javascript(options[:onchange])}' + " +
823
- "'&object=#{object}' + " +
824
- "'&method_prefix=#{method_prefix}', {method:'get', asynchronous:true, evalScripts:true})"
825
-
826
- ret = <<EOF
816
+ draw_calendar = <<-EOT
817
+ window.addEventListener('DOMContentLoaded', (event) => {
818
+ new Ajax.Updater('date_picker_#{object}_#{method_prefix}_days',
819
+ '#{date_picker_url}?month=' + $('#{object}_#{method_prefix}_month_sel').value +
820
+ '&year=' + $('#{object}_#{method_prefix}_year_sel').value +
821
+ '&min_time=' + #{start_date.to_i} +
822
+ '&max_time=' + #{end_date.to_i} +
823
+ '&exclude_days=#{exclude_days.join(',')}' +
824
+ '&onchange=#{escape_javascript(options[:onchange])}' +
825
+ '&object=#{object}' +
826
+ '&method_prefix=#{method_prefix}', {method:'get', asynchronous:true, evalScripts:true})
827
+ });
828
+ EOT
829
+
830
+ ret = <<-EOT
827
831
  <span><a href="#" onclick="showDatePicker('#{object}', '#{method_prefix}'); return false;"><span id="date_picker_#{object}_#{method_prefix}_value" style="font-weight: normal;">#{default_value.strftime('%a %m/%d/%y')}</span></a></span>
828
832
  <span id="date_picker_#{object}_#{method_prefix}icon"><a href="#" onclick="showDatePicker('#{object}', '#{method_prefix}'); return false;"><img src="/assets/management/icon_time.gif" style="float: none" alt="date picker" /></a></span>
829
833
  <div id="date_picker_#{object}_#{method_prefix}main" style="display: none; background-color: white; border: 1px solid gray; padding: 3px; z-index: 101;" class="date-picker-main">
@@ -847,7 +851,7 @@ module CmsApplicationHelper
847
851
  <a href="#" onclick="hideDatePicker('#{object}', '#{method_prefix}'); return false;">Close</a>
848
852
  </div>
849
853
  </div>
850
- EOF
854
+ EOT
851
855
  ret += javascript_tag(draw_calendar)
852
856
  ret.html_safe
853
857
  end
@@ -6,7 +6,7 @@ class ImagineCmsMailer < ActionMailer::Base
6
6
  @page_version = page_version
7
7
  @recipient = recipient
8
8
  @sender = sender
9
- @change_description = change_description
9
+ @change_description = change_description # not currently used
10
10
 
11
11
  mail(to: recipient.email_address, reply_to: (sender.email_address.blank? ? nil : sender.email_address),
12
12
  from: "#{sender.first_name} #{sender.last_name} <#{CmsRequestReviewEmailSender}>",
@@ -1,11 +1,6 @@
1
1
  <%#= javascript_tag 'var djConfig = { isDebug: true };' %>
2
2
 
3
- <script type="text/javascript">
4
- var load_dojo = false;
5
- if (<%= @load_dojo || 'false' %>) {
6
- load_dojo = true;
7
- }
8
-
3
+ <script>
9
4
  function readCookie(name) {
10
5
  var ca = document.cookie.split(';');
11
6
  for (var i=0; i < ca.length; i++) {
@@ -19,14 +14,19 @@
19
14
  function loggedIn() {
20
15
  return readCookie('user_auth_status') == 'authenticated';
21
16
  }
22
-
17
+ </script>
18
+ <script type="text/javascript" async>
19
+ var load_dojo = false;
20
+ if (<%= @load_dojo || 'false' %>) {
21
+ load_dojo = true;
22
+ }
23
+
23
24
  if (loggedIn() || load_dojo) {
24
25
  document.writeln('<scr' + 'ipt src="/assets/dojo/dojo.js" type="text/javascript"></scr' + 'ipt>');
25
26
  document.writeln('<link href="/assets/imagine_controls.css" media="screen" rel="stylesheet" type="text/css" />')
26
27
  }
27
28
  </script>
28
-
29
- <script type="text/javascript">
29
+ <script type="text/javascript" async>
30
30
  if (loggedIn()) {
31
31
  dojo.require("dojo.widget.Editor2");
32
32
  dojo.require("dojo.widget.Editor2Plugin.TableOperation");
@@ -3,8 +3,6 @@
3
3
  Title: <%= @page_title %>
4
4
  URL: <%= @page_url %>
5
5
  Version: <%= @page_version %>
6
- Description of change:
7
- <%= @change_description %>
8
6
 
9
7
  View/approve this change:
10
8
  <%= @page_url %>/version/<%= @page_version %>
@@ -47,13 +47,14 @@
47
47
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
48
48
 
49
49
  <title><%= controller.controller_path.split('/').concat([ params[:action] ]).map { |s| s.titlecase }.join(' > ') %></title>
50
- <%- if is_logged_in_user? -%>
51
- <script src="/assets/dojo/dojo.js" type="text/javascript"></script>
52
- <%- end -%>
53
50
  <%= stylesheet_link_tag "application", media: "all" %>
54
51
  <%= stylesheet_link_tag "management", media: "all" %>
55
52
  <%= javascript_include_tag "application" %>
56
-
53
+
54
+ <%- if is_logged_in_user? -%>
55
+ <script src="/assets/dojo/dojo.js" type="text/javascript"></script>
56
+ <%- end -%>
57
+
57
58
  <%= csrf_meta_tag %>
58
59
  </head>
59
60
 
@@ -172,8 +172,13 @@
172
172
  <div style="position: relative;">
173
173
  <%= text_field_tag :custom_attribute_name, '', class: 'form', style: 'margin-bottom: 4px;', placeholder: '[ attribute name ]' %>
174
174
  <div id="custom_attribute_name_auto_complete" class="auto_complete" style="display: none;"></div>
175
- <%= javascript_tag "$('custom_attribute_name').onkeydown = disableEnterKey; new Autocompleter.Local('custom_attribute_name', 'custom_attribute_name_auto_complete', attrlist, { frequency: 0.1, minChars: 1 });" %>
176
-
175
+ <script type="text/javascript">
176
+ window.addEventListener('DOMContentLoaded', (event) => {
177
+ $('custom_attribute_name').onkeydown = disableEnterKey;
178
+ new Autocompleter.Local('custom_attribute_name', 'custom_attribute_name_auto_complete', attrlist, { frequency: 0.1, minChars: 1 });
179
+ });
180
+ </script>
181
+
177
182
  <%= button_to_function 'Add', "new Ajax.Updater('custom_attributes', '#{url_for(controller: '/manage/cms_pages', action: '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;' %>
178
183
  </div>
179
184
  </td>
@@ -196,7 +201,7 @@
196
201
  </tr>
197
202
  </table>
198
203
  <% end -%>
199
- <<script type="text/javascript">
204
+ <script type="text/javascript">
200
205
  jQuery('#pg_cms_template_id').change(function () {
201
206
  jQuery.get('<%= url_for(action: 'show_template_options', id: @pg) %>?template_id=' + jQuery(this).val(), null, function (data) {
202
207
  jQuery('#edit_page_template_options').html(data);
@@ -1,8 +1,29 @@
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: 'new', 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
- <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.published_version >= 0 ? '' : ' style="color: gray"'.html_safe %>><%= list_page.name %></td>
6
- </tr>
7
- </table>
1
+ <div id="cb_item_<%= list_page.id %>" class="cb_item<%= ' cb_item_offline' unless list_page.published_version >= 0 %>">
2
+ <%= image_tag 'management/icon_page.gif' %></td>
3
+ <span><%= list_page.name %></span>
8
4
  </div>
5
+
6
+ <script type="text/javascript">
7
+ jQuery('#cb_item_<%= list_page.id %>').on('click', () => {
8
+ jQuery('#view_link').prop('href', '<%= list_page.path.blank? ? '' : '/' + list_page.path %>/version/<%= list_page.published_version > 0 ? list_page.published_version : list_page.version %>');
9
+ jQuery('#new_link').off('click');
10
+ jQuery('#new_link').on('click', () => {
11
+ editProperties('<%=raw url_for action: 'new', mode: 'ajax_new', parent_id: list_page %>', 'Create New Page under /<%= list_page.path %>');
12
+ return false;
13
+ });
14
+ jQuery('#edit_link').off('click');
15
+ jQuery('#edit_link').on('click', () => {
16
+ editProperties('<%=raw url_for action: 'edit_page', id: list_page, mode: 'ajax_edit' %>', 'Page Properties: <%= list_page.name %>');
17
+ return false;
18
+ });
19
+ jQuery('#edit_content_link').prop('href', '<%=raw url_for action: 'edit_page_content', id: list_page %>');
20
+ jQuery('#delete_link').prop('href', '<%=raw url_for action: 'delete_page', id: list_page.id %>');
21
+ setTimeout(() => {
22
+ cbSelectItem('#cb_item_<%= list_page.id %>', <%= @page_level %>, '<%=raw url_for action: 'list_pages', level: @page_level + 1, parent_id: list_page.id %>');
23
+ }, 200);
24
+ });
25
+ jQuery('#cb_item_<%= list_page.id %>').on('dblclick', (event) => {
26
+ location.href = jQuery('#edit_content_link')[0].href;
27
+ return false;
28
+ });
29
+ </script>
@@ -1 +1 @@
1
- <%= render :partial => 'list_page', :collection => @pages %>
1
+ <%= render partial: 'list_page', collection: @pages %>
@@ -177,12 +177,12 @@
177
177
  </div>
178
178
 
179
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
180
  // reattach to a safe place in the DOM (away from styled regions)
185
- jQuery(document).ready(function () {
181
+ window.addEventListener('DOMContentLoaded', (event) => {
182
+ var displayAsList = jQuery('#page_objects_<%= key %>-style-display-as_list').checked;
183
+ jQuery('.page_list_<%= key %>_list_option').toggle(displayAsList);
184
+ jQuery('.page_list_<%= key %>_calendar_option').toggle(!displayAsList);
185
+
186
186
  jQuery('#page_list_<%= key %>').appendTo(jQuery('#page_content_form')[0]);
187
187
  jQuery('#page_objects_<%= key %>-style-display-as_list').click(function () {
188
188
  jQuery('.page_list_<%= key %>_list_option').show();
@@ -8,11 +8,15 @@
8
8
  <%= text_field(:page_objects, "#{key}-sources-tag#{i}", :class => 'form', :style => 'margin: 0; padding: 2px; border: 1px solid gray; width: 98%;') %>
9
9
 
10
10
  <div id="page_objects_<%= key %>-sources-tag<%= i %>_auto_complete" class="auto_complete" style="display: none;"></div>
11
- <%= javascript_tag "new Autocompleter.Local('page_objects_#{key}-sources-tag#{i}', 'page_objects_#{key}-sources-tag#{i}_auto_complete', taglist, { frequency: 0.1, minChars: 1 })" %>
11
+ <script type="text/javascript">
12
+ window.addEventListener('DOMContentLoaded', (event) => {
13
+ new Autocompleter.Local('page_objects_<%= key %>-sources-tag<%= i %>', 'page_objects_<%= key %>-sources-tag<%= i %>_auto_complete', taglist, { frequency: 0.1, minChars: 1 });
14
+ });
15
+ </script>
12
16
  </td>
13
17
  <td>
14
18
  <%= select(:page_objects, "#{key}-sources-tag#{i}-behavior", [ 'include', 'exclude', 'require' ], {}, :class => 'form', :style => 'margin: 0; padding: 1px; border: 1px solid gray; width: 100%;') %>
15
19
  </td>
16
20
  </tr>
17
21
  </table>
18
- </div>
22
+ </div>
@@ -1,36 +1,33 @@
1
- <%
1
+ <%-
2
2
  cbNumColumns = 0;
3
- cbColWidth = 170;
4
- cbColHeight = 300;
5
- cbBorderWidth = 1;
6
- cbColWidthFull = 172;
3
+ cbColWidth = 200;
4
+ cbColHeight = 400;
7
5
  -%>
8
- <%= javascript_tag <<-EOF
9
- dojo.require("dojo.widget.*");
10
- dojo.require("dojo.widget.Dialog");
11
-
12
- cbColWidth = '#{cbColWidth}px';
13
- cbColHeight = '#{cbColHeight}px';
14
- cbBorderWidth = '#{cbBorderWidth}px';
15
- cbColWidthFull = '#{cbColWidthFull}';
16
- EOF
17
- %>
6
+ <script type="text/javascript">
7
+ window.cbColWidth = <%= cbColWidth %>;
8
+ window.cbColHeight = <%= cbColHeight %>;
9
+ </script>
10
+ <style type="text/css">
11
+ .cb_column {
12
+ width: <%= cbColWidth %>px;
13
+ height: <%= cbColHeight %>px;
14
+ }
15
+ </style>
18
16
 
19
17
  <h2>CMS &raquo; Pages</h2>
20
18
 
21
19
  <%= flash_message %>
22
20
 
23
- <div id="columnBrowserToolbar" style="background-color: #ddd; padding: 5px 4px 0; margin: 0 0 5px;">
24
- <%= link_to image_tag('management/btn-top-new.png', style: 'margin-right: 2px;'), '#', id: 'new_link' %>
25
- <%= link_to image_tag('management/btn-top-edit.png', style: 'margin-right: 2px;'), '#', id: 'edit_content_link', target: '_blank' %>
26
- <%= link_to image_tag('management/btn-top-properties.png', style: 'margin-right: 2px;'), '#', id: 'edit_link' %>
27
- <%= link_to image_tag('management/btn-top-preview.png', style: 'margin-right: 2px;'), '#', id: 'view_link', target: '_blank' %>
28
- <%= link_to image_tag('management/btn-top-delete.png', style: 'margin: 0;'), '#', id: 'delete_link', target: '_blank', method: :post, data: { confirm: 'Are you sure you want to delete the selected page?' } %>
29
- <div class="clearer"></div>
21
+ <div id="columnBrowserToolbar">
22
+ <%= link_to image_tag('management/btn-top-new.png'), '#', id: 'new_link' %>
23
+ <%= link_to image_tag('management/btn-top-edit.png'), '#', id: 'edit_content_link' %>
24
+ <%= link_to image_tag('management/btn-top-properties.png'), '#', id: 'edit_link' %>
25
+ <%= link_to image_tag('management/btn-top-preview.png'), '#', id: 'view_link', target: '_blank' %>
26
+ <%= link_to image_tag('management/btn-top-delete.png'), '#', id: 'delete_link', method: :post, data: { confirm: 'Are you sure you want to delete the selected page?' } %>
30
27
  </div>
31
28
 
32
- <div id="columnBrowserContainer" style="width: 100%; height: <%= cbColHeight + 20 %>px; overflow: auto;">
33
- <div id="columnBrowser" style="width: <%= cbColWidthFull * (@page_levels.size) %>px;">
29
+ <div id="columnBrowserContainer" style="height: <%= cbColHeight + 2 %>px;">
30
+ <div id="columnBrowser" style="width: <%= (cbColWidth+1) * @page_levels.size %>px;">
34
31
  <%- @page_levels.each_with_index do |name, i| -%>
35
32
  <%-
36
33
  if name.present?
@@ -41,21 +38,21 @@ EOF
41
38
  @page = CmsPage.find_by_path @path
42
39
  @page_level = i
43
40
  @pages = @parent.children if @parent
44
-
41
+
45
42
  break_flag = false
46
-
43
+
47
44
  if !@page
48
45
  @page = @parent.children.first || @parent || CmsPage.first
49
46
  break_flag = true
50
47
  end
51
48
  -%>
52
- <div id="columnBrowserLevel<%= i %>" style="width: <%= cbColWidth %>px; height: <%= cbColHeight %>px; overflow: auto; float: left; border-width: <%= cbBorderWidth %>px <%= cbBorderWidth %>px <%= cbBorderWidth %>px <%= i == 0 ? "#{cbBorderWidth}px" : '0' %>; border-style: solid; border-color: gray;">
49
+ <div id="columnBrowserLevel<%= i %>" class="cb_column">
53
50
  <%- if i == 0 -%>
54
51
  <%= render partial: 'list_page', locals: { list_page: CmsPage.first } %>
55
52
  <%- else -%>
56
53
  <%= render partial: 'list_pages' %>
57
54
  <%- end -%>
58
- <%= javascript_tag "jQuery('#cb_item_#{@parent.id}').addClass('cb_item_selected');" if @parent %>
55
+ <%= javascript_tag "jQuery('#cb_item_#{@parent.id}').addClass('cb_item_selected')[0].scrollIntoView();" if @parent %>
59
56
  </div>
60
57
  <%- break if break_flag -%>
61
58
  <%- end -%>
@@ -65,13 +62,17 @@ EOF
65
62
  <%- list_page = @page -%>
66
63
 
67
64
  <script type="text/javascript">
68
- cbNumColumns = <%= @page_levels.size - 1 %>;
69
- $('columnBrowserLevel' + cbNumColumns).scrollIntoView();
70
- $('view_link').href = '<%= list_page.path.blank? ? '' : '/' + list_page.path %>/version/<%= list_page.published_version > 0 ? list_page.published_version : list_page.version %>';
71
- $('new_link').onclick = function () { editProperties('<%=raw url_for(action: 'new', mode: 'ajax_new', parent_id: list_page, authenticity_token: form_authenticity_token.to_s) %>', 'Create New Page under /<%= list_page.path %>'); return false; };
72
- $('edit_link').onclick = function () { editProperties('<%=raw url_for action: 'edit_page', id: list_page, mode: 'ajax_edit', authenticity_token: form_authenticity_token.to_s %>', 'Page Properties: <%= list_page.name %>'); return false; };
73
- $('edit_content_link').href = '<%=raw url_for action: 'edit_page_content', id: list_page, authenticity_token: form_authenticity_token.to_s %>';
74
- $('delete_link').href = '<%=raw url_for action: 'delete_page', id: list_page.id %>';
65
+ cbNumColumns = <%= @page_levels.size - 1 %>;
66
+ jQuery('#columnBrowserLevel' + cbNumColumns)[0].scrollIntoView();
67
+ jQuery('#view_link').prop('href', '<%= list_page.path.blank? ? '' : '/' + list_page.path %>/version/<%= list_page.published_version > 0 ? list_page.published_version : list_page.version %>');
68
+ jQuery('#new_link').on('click', () => { editProperties('<%=raw url_for(action: 'new', mode: 'ajax_new', parent_id: list_page, authenticity_token: form_authenticity_token.to_s) %>', 'Create New Page under /<%= list_page.path %>'); return false; });
69
+ jQuery('#edit_link').on('click', () => { editProperties('<%=raw url_for action: 'edit_page', id: list_page, mode: 'ajax_edit', authenticity_token: form_authenticity_token.to_s %>', 'Page Properties: <%= list_page.name %>'); return false; });
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
+ jQuery('#delete_link').prop('href', '<%=raw url_for action: 'delete_page', id: list_page.id %>');
72
+ </script>
73
+ <script type="text/javascript" async>
74
+ dojo.require("dojo.widget.*");
75
+ dojo.require("dojo.widget.Dialog");
75
76
  </script>
76
77
 
77
78
  <%= render '/imagine_cms/dialogs' %>
@@ -1,23 +1,18 @@
1
1
  <%
2
2
  cbNumColumns = 0;
3
- cbColWidth = 170;
3
+ cbColWidth = 200;
4
4
  cbColHeight = 200;
5
- cbBorderWidth = 1;
6
- cbColWidthFull = 172;
7
5
  -%>
8
- <%= javascript_tag <<-EOF
6
+ <script type="text/javascript">
9
7
  dojo.require("dojo.widget.*");
10
8
  dojo.require("dojo.widget.Dialog");
11
9
 
12
- cbColWidth = '#{cbColWidth}px';
13
- cbColHeight = '#{cbColHeight}px';
14
- cbBorderWidth = '#{cbBorderWidth}px';
15
- cbColWidthFull = '#{cbColWidthFull}';
16
- EOF
17
- %>
10
+ window.cbColWidth = <%= cbColWidth %>;
11
+ window.cbColHeight = <%= cbColHeight %>;
12
+ </script>
18
13
 
19
14
  <div id="columnBrowserContainer" style="width: 100%; height: <%= cbColHeight + 20 %>px; overflow: auto;">
20
- <div id="columnBrowser" style="width: <%= cbColWidthFull * (@page_levels.size) %>px;">
15
+ <div id="columnBrowser" style="width: <%= (cbColWidth+1) * @page_levels.size %>px;">
21
16
  <% @page_levels.each_with_index do |name, i| %>
22
17
  <%
23
18
  if !name.blank?
@@ -42,7 +37,7 @@ EOF
42
37
  break_flag = true
43
38
  end
44
39
  -%>
45
- <div id="columnBrowserLevel<%= i %>" style="width: <%= cbColWidth %>px; height: <%= cbColHeight %>px; overflow: auto; float: left; border: <%= cbBorderWidth %>px solid gray;">
40
+ <div id="columnBrowserLevel<%= i %>" class="cb_column">
46
41
  <% if i == 0 -%>
47
42
  <%= render :partial => 'list_page_select', :locals => { :list_page_select => CmsPage.find(1) } %>
48
43
  <% else -%>
data/docker-compose.yml CHANGED
@@ -5,11 +5,11 @@ services:
5
5
  build: .
6
6
  environment:
7
7
  PASSENGER_APP_ENV: development
8
- MYSQL_HOST: db # if this is changed, update nginx-vhost.conf as well
9
- REDIS_URL: redis://redis:6379/1 # if this is changed, update nginx-vhost.conf as well
10
-
8
+ MYSQL_HOST: db
9
+ REDIS_URL: redis://redis:6379/1
10
+
11
11
  db:
12
- image: mariadb:10.3
12
+ image: mariadb:10.4
13
13
  volumes:
14
14
  - ./docker/conf/my.local.cnf:/etc/mysql/conf.d/my.local.cnf
15
15
  environment:
@@ -6,7 +6,7 @@ server {
6
6
  passenger_enabled on;
7
7
  passenger_user app;
8
8
 
9
- passenger_ruby /usr/bin/ruby2.5;
9
+ passenger_ruby /usr/bin/ruby2.6;
10
10
  passenger_env_var MYSQL_HOST '$MYSQL_HOST';
11
11
  passenger_env_var REDIS_URL '$REDIS_URL';
12
12
 
@@ -144,7 +144,7 @@ module ActionControllerExtensions
144
144
 
145
145
  pages = page_list_items(@pg, key, options).compact.uniq
146
146
 
147
- options[:wrapper_div] = true
147
+ options[:wrapper_div] = true unless options.has_key?(:wrapper_div)
148
148
 
149
149
  render_page_list_segment(name, pages, options, html_options)
150
150
  end
@@ -1,3 +1,3 @@
1
1
  module ImagineCms
2
- VERSION = "5.2.1"
2
+ VERSION = "5.2.2"
3
3
  end
@@ -20,7 +20,7 @@
20
20
  #
21
21
  # class UploadController < ApplicationController
22
22
  # def upload_status
23
- # render :text => "Percent complete: " + @session[:uploads]['SOMEIDYOUSET'].completed_percent"
23
+ # render :plain => "Percent complete: " + @session[:uploads]['SOMEIDYOUSET'].completed_percent"
24
24
  # end
25
25
  # end
26
26
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imagine_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.1
4
+ version: 5.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Namba
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-10 00:00:00.000000000 Z
11
+ date: 2019-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails