imagine_cms 4.2.3 → 4.2.4

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
  SHA1:
3
- metadata.gz: 19a7593edf968b6e0d372fc908c82db4c7e604fb
4
- data.tar.gz: c18d992a9ec86684edcf29f5ac8b63299d4b035b
3
+ metadata.gz: d5f39688f4ce0db4088dcb9a9fd335d8559cc8b2
4
+ data.tar.gz: f17c64bc6b869b8bb6ebd43f0ccb8f4a40ea8569
5
5
  SHA512:
6
- metadata.gz: 2ddd8575abab07976f71573ae4fbd943657c3684bcd9ee3e13e7ffc0568f9855f03bb9ebbe430414e366d46b21dafcb55d721868f5713bb4f0edc542e5351e50
7
- data.tar.gz: 48adb3ff7855eb1600bd22f3ba702b0effab15fc915e1e8ac3a9c1645fbfdfa25e643839a22b1104a1a16770a33b440436184652fe03cd15a620dea725aa8895
6
+ metadata.gz: 1c346d09b43132531d39927c97f3747099980b5fb662900897ea0252975e2380192818aef42705f24be8579ec5dfb85d87c4c18249ce477f726143a6151bf990
7
+ data.tar.gz: 3b5953c978eb5b1de34ef12e8ab469689791571d38ecfd89c246b610762f883c5f6ae4ee677ec0ae24c5a0f86b7f1083a995a51a0c96ddf229b1bca2053adf3e
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.2
1
+ 2.2.4
@@ -296,8 +296,8 @@ function changeGalleryImage(galleryName, index) {
296
296
  $(galleryName + '_caption').style.display = 'none';
297
297
  }
298
298
 
299
- prevIndex = index == 0 ? gallerySize[galleryName] - 1 : index-1;
300
- nextIndex = index == gallerySize[galleryName] - 1 ? 0 : index+1;
299
+ var prevIndex = index == 0 ? gallerySize[galleryName] - 1 : index-1;
300
+ var nextIndex = index == gallerySize[galleryName] - 1 ? 0 : index+1;
301
301
  $(galleryName + '_prev_button').onclick = function () { changeGalleryImage(galleryName, prevIndex) };
302
302
  $(galleryName + '_next_button').onclick = function () { changeGalleryImage(galleryName, nextIndex) };
303
303
  }
@@ -93,7 +93,7 @@ module Cms # :nodoc:
93
93
  else
94
94
  flash[:notice] = "Please log in now in order to switch to Preview Mode on the page you were just viewing."
95
95
  session[:saved_user_uri] = '/' + db_path.join('/')
96
- redirect_to :controller => '/management/user', :action => 'login' and return true
96
+ redirect_to controller: '/management/user', action: 'login' and return true
97
97
  end
98
98
  end
99
99
  end
@@ -151,7 +151,7 @@ module Cms # :nodoc:
151
151
 
152
152
  if @pg = CmsPage.includes(:template).find_by_path(db_path.join('/'))
153
153
  if edit_mode
154
- redirect_to :controller => '/management/cms', :action => 'edit_page_content', :id => @pg and return true
154
+ redirect_to controller: '/management/cms', action: 'edit_page_content', id: @pg and return true
155
155
  else
156
156
  # return if page is offline and viewer is not an admin
157
157
  if @pg.published_version < 0
@@ -191,11 +191,11 @@ module Cms # :nodoc:
191
191
  if @page_list_segment
192
192
  name = params[:page_list_name]
193
193
  key = "obj-page_list-#{name.gsub(/[^\w]/, '_')}"
194
- render :inline => render_page_list_segment(name, @page_list_pages[key]) and return true
194
+ render inline: render_page_list_segment(name, @page_list_pages[key]) and return true
195
195
  end
196
196
  # end of page list segment code
197
197
 
198
- render :inline => template_content
198
+ render inline: template_content
199
199
 
200
200
  if UseCmsPageCaching && @allow_caching && perform_caching && request.format == Mime::HTML
201
201
  cache_page
@@ -250,27 +250,30 @@ module Cms # :nodoc:
250
250
  end
251
251
  @pages = @pages.first(100)
252
252
 
253
+ logger.debug "Search returned #{@pages.size} matching pages for terms #{@terms}"
254
+
253
255
  @pg = CmsPage.new
254
256
  @pg.template = CmsTemplate.find_by_name('Search') || CmsTemplate.new
255
257
  @page_title = 'Search Results'
256
258
 
257
259
  load_page_objects or return
258
- @page_objects['obj-text-search_results'] = render_to_string(:partial => 'search')
259
260
 
260
- render :inline => render_cms_page_to_string(@pg)
261
+ @page_objects['obj-text-search_results'] = render_to_string(partial: 'search')
262
+
263
+ render inline: render_cms_page_to_string(@pg)
261
264
  end
262
265
 
263
266
  def rss_feed
264
267
  min_time = Time.rfc2822(request.env["HTTP_IF_MODIFIED_SINCE"]) rescue nil
265
268
  if min_time && (Time.now - min_time) < 5.minutes
266
- render :text => '', :status => '304 Not Modified' and return
269
+ render text: '', status: '304 Not Modified' and return
267
270
  end
268
271
 
269
272
  @@cms_page_table_exists ||= CmsPage.table_exists?
270
273
  return not_found unless @@cms_page_table_exists
271
274
 
272
275
  @pg = CmsPage.find_by_id(params[:page_id])
273
- render :nothing => true and return unless @pg && params[:page_list_name]
276
+ render nothing: true and return unless @pg && params[:page_list_name]
274
277
  key = "obj-page_list-#{params[:page_list_name].gsub(/[^\w]/, '_')}"
275
278
 
276
279
  load_page_objects or return false
@@ -287,7 +290,7 @@ module Cms # :nodoc:
287
290
 
288
291
  if min_time && @most_recent_pub_date.published_date && @most_recent_pub_date.published_date <= min_time
289
292
  # use cached version
290
- render :text => '', :status => '304 Not Modified' and return
293
+ render text: '', status: '304 Not Modified' and return
291
294
  end
292
295
 
293
296
  @pages.each_with_index do |page, index|
@@ -1463,8 +1463,9 @@ class Management::CmsController < Management::ApplicationController # :nodoc:
1463
1463
  end
1464
1464
 
1465
1465
  # set a few defaults
1466
- ret[:slide_duration] ||= 0
1467
- ret[:show_thumbs] ||= true
1466
+ ret['slide_duration'] ||= 0
1467
+ ret['autoplay'] ||= true
1468
+ ret['show_thumbs'] ||= true
1468
1469
 
1469
1470
  return HashObject.new(ret)
1470
1471
  end
@@ -384,10 +384,6 @@ module CmsApplicationHelper
384
384
  pages.reject! { |page| page.tags.reject { |t| t.name != tag } == [] }
385
385
  end
386
386
 
387
- if pg && (options[:exclude_current] === true || @page_objects["#{key}-exclude-current"] == 'true')
388
- pages.reject! { |page| page == pg }
389
- end
390
-
391
387
  # set some reasonable defaults in case the sort keys are nil
392
388
  pages.each { |pg| pg.article_date ||= Time.now; pg.position ||= 0; pg.title ||= '' }
393
389
  pri_sort_key = first_non_empty(@page_objects["#{key}-sort-first-field"], options[:primary_sort_key], 'article_date')
@@ -426,12 +422,18 @@ module CmsApplicationHelper
426
422
  offset = first_non_empty(@page_objects["#{key}-item-offset"], options[:item_offset], 0).to_i
427
423
  @page_objects["#{key}-item-offset"] = offset
428
424
 
425
+ # exclude current page if box is checked (even for single_pages)
426
+ if pg && (options[:exclude_current] === true || @page_objects["#{key}-exclude-current"] == 'true')
427
+ pages.reject! { |page| page == pg }
428
+ single_pages.reject! { |page| page == pg }
429
+ end
430
+
429
431
  logger.debug "Page List Offset: #{offset} / #{pages.size} #{pages.map(&:id)}"
430
432
  pages = pages[offset, pages.size] || []
431
433
 
432
434
  # since the user selected these pages individually, they expect them to be included (and prioritized!), no matter what
433
435
  # (but make sure they are unique)
434
- pages = (single_pages + pages).uniq
436
+ pages = (single_pages + pages).uniq unless single_pages.empty?
435
437
 
436
438
  # randomize if requested
437
439
  randomize = first_non_empty(@page_objects["#{key}-use-randomization"], options[:use_randomization], 'false').to_s == 'true'
@@ -1,7 +1,7 @@
1
- <%- img = "content/#{@pg.path}/#{params[:gallery_id]}/#{params[:image]}" -%>
1
+ <%- img = "assets/content/#{@pg.path}/#{params[:gallery_id]}/#{params[:image]}" -%>
2
2
  <table>
3
3
  <tr valign="top">
4
- <td><%= image_tag "#{img}?#{File.mtime(File.join(Rails.root, 'public', 'assets', img)).to_i}" %></td>
4
+ <td><%= image_tag "/#{img}?#{File.mtime(File.join(Rails.root, 'public', img)).to_i}" %></td>
5
5
  <td style="padding-left: 10px;">
6
6
  <div id="caption_container" style="margin-bottom: 20px;">
7
7
  <strong>Caption</strong><br/>
@@ -57,15 +57,15 @@
57
57
  <tr>
58
58
  <td width="100">Slideshow Autoplay?</td>
59
59
  <td>
60
- <%= radio_button :gallery, :autoplay, true, :onclick => "$('btn_save_settings').disabled = false;" %> <label for="gallery_autoplay_true">Yes</label><br/>
61
- <%= radio_button :gallery, :autoplay, false, :onclick => "$('btn_save_settings').disabled = false;" %> <label for="gallery_autoplay_false">No</label>
60
+ <%= radio_button :gallery, :autoplay, 'true', :onclick => "$('btn_save_settings').disabled = false;" %> <label for="gallery_autoplay_true">Yes</label><br/>
61
+ <%= radio_button :gallery, :autoplay, 'false', :onclick => "$('btn_save_settings').disabled = false;" %> <label for="gallery_autoplay_false">No</label>
62
62
  </td>
63
63
  </tr>
64
64
  <tr>
65
65
  <td>Show Thumbnails?</td>
66
- <td>
67
- <%= radio_button :gallery, :show_thumbs, true, :onclick => "$('btn_save_settings').disabled = false;" %> <label for="gallery_show_thumbs_true">Yes</label><br/>
68
- <%= radio_button :gallery, :show_thumbs, false, :onclick => "$('btn_save_settings').disabled = false;" %> <label for="gallery_show_thumbs_false">No</label>
66
+ <td><%= @gallery.show_thumbs %>
67
+ <%= radio_button :gallery, :show_thumbs, 'true', :onclick => "$('btn_save_settings').disabled = false;" %> <label for="gallery_show_thumbs_true">Yes</label><br/>
68
+ <%= radio_button :gallery, :show_thumbs, 'false', :onclick => "$('btn_save_settings').disabled = false;" %> <label for="gallery_show_thumbs_false">No</label>
69
69
  </td>
70
70
  </tr>
71
71
  <tr>
@@ -1,3 +1,35 @@
1
+ require 'safe_yaml'
2
+
3
+ require 'rails-observers'
4
+ require 'actionpack/action_caching'
5
+ require 'actionpack/page_caching'
6
+
7
+ require 'prototype-rails'
8
+ require 'prototype_legacy_helper/lib/prototype_legacy_helper'
9
+
10
+ require 'non-stupid-digest-assets'
11
+
12
+ require 'upload_progress/lib/multipart_progress'
13
+ require 'upload_progress/lib/progress'
14
+ require 'upload_progress/lib/upload_progress'
15
+ require 'upload_progress/lib/upload_progress_helper'
16
+
17
+ require 'acts_as_versioned/lib/acts_as_versioned'
18
+ require 'aws-sdk'
19
+ require 'zip'
20
+ require 'rails_rinku'
21
+ require 'acts_as_tree'
22
+ require 'net/dns'
23
+ require 'codemirror-rails'
24
+ require 'RMagick'
25
+ require 'mini_magick'
26
+
27
+ require 'auto_link_email_addresses'
28
+ require 'extensions/array_extensions'
29
+ require 'hash_object'
30
+ require 'hash_wrapper'
31
+
32
+
1
33
  module ImagineCms
2
34
 
3
35
  class Engine < Rails::Engine
@@ -6,12 +38,20 @@ module ImagineCms
6
38
  config.app_root = root
7
39
  middleware.use ::ActionDispatch::Static, "#{root}/public"
8
40
 
9
- initializer "imagine_cms.assets.precompile" do |config|
10
- Rails.application.config.assets.precompile += %w( dojo/** management.css imagine_controls.css reset.css )
11
- Rails.application.config.assets.precompile += ["codemirror*", "codemirror/**/*"]
41
+ initializer "imagine_cms.assets.precompile" do |app|
42
+ app.config.assets.precompile += %w( dojo/** management.css imagine_controls.css reset.css cropper/* interface/* management/* )
43
+ app.config.assets.precompile += ["codemirror*", "codemirror/**/*"]
12
44
  # Rails.application.config.load_paths << File.dirname(__FILE__) + "/../app/helpers"
13
45
  end
14
46
 
47
+ initializer 'imagine_cms.legacy_support' do |app|
48
+ ActionController::Base.send :include, PrototypeHelper
49
+ ActionController::Base.send :helper, PrototypeHelper
50
+
51
+ ActionController::Base.send(:include, UploadProgress)
52
+ ActionView::Base.send(:include, UploadProgress::UploadProgressHelper)
53
+ end
54
+
15
55
  initializer 'imagine_cms.load_helpers' do |app|
16
56
  ActionController::Base.send :include, CmsApplicationHelper
17
57
  end
@@ -32,69 +72,17 @@ module ImagineCms
32
72
  ActionController::Base.send :before_filter, :expire_session_data
33
73
  end
34
74
 
35
- initializer 'imagine_cms.prototype_legacy_helper' do |app|
36
- require 'prototype_legacy_helper/lib/prototype_legacy_helper'
37
- ActionController::Base.send :include, PrototypeHelper
38
- ActionController::Base.send :helper, PrototypeHelper
39
- end
40
-
41
- initializer 'imagine_cms.acts_as_versioned' do |app|
42
- require 'acts_as_versioned/lib/acts_as_versioned'
43
- end
44
-
45
- initializer 'imagine_cms.upload_progress' do |app|
46
- require 'upload_progress/lib/multipart_progress'
47
- require 'upload_progress/lib/progress'
48
- require 'upload_progress/lib/upload_progress'
49
- require 'upload_progress/lib/upload_progress_helper'
50
- ActionController::Base.send(:include, UploadProgress)
51
- ActionView::Base.send(:include, UploadProgress::UploadProgressHelper)
52
- end
53
-
54
- initializer 'imagine_cms.auto_link_email_addresses' do |app|
55
- require 'auto_link_email_addresses'
56
- end
57
-
58
- initializer 'imagine_cms.array_extensions' do |app|
59
- require 'extensions/array_extensions'
60
- end
61
-
62
- initializer 'imagine_cms.hash_classes' do |app|
63
- require 'hash_object'
64
- require 'hash_wrapper'
65
- end
66
-
67
75
 
68
76
  def self.activate
69
77
  Dir.glob(File.join(Rails.root, "app/overrides/*.rb")) do |c|
70
- Rails.application.config.cache_classes ? require(c) : load(c)
78
+ require_dependency(c)
71
79
  end
72
80
  Dir.glob(File.join(Rails.root, "app/**/*_decorator*.rb")) do |c|
73
- Rails.configuration.cache_classes ? require(c) : load(c)
81
+ require_dependency(c)
74
82
  end
75
83
  end
76
84
 
77
85
  config.to_prepare &method(:activate).to_proc
78
-
79
- #
80
- # activate gems as needed
81
- #
82
- require 'rails-observers'
83
- require 'actionpack/action_caching'
84
- require 'actionpack/page_caching'
85
- require 'aws-sdk'
86
- require 'zip'
87
- require 'rails_rinku'
88
- require 'safe_yaml'
89
- require 'acts_as_tree'
90
- require 'net/dns'
91
- require 'codemirror-rails'
92
-
93
- # on the way out, but still needed for now
94
- require 'prototype-rails'
95
- require 'RMagick'
96
- require 'mini_magick'
97
- require 'non-stupid-digest-assets'
98
86
  end
99
87
 
100
88
  end
@@ -1,3 +1,3 @@
1
1
  module ImagineCms
2
- VERSION = "4.2.3"
2
+ VERSION = "4.2.4"
3
3
  end
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: 4.2.3
4
+ version: 4.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Namba
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-14 00:00:00.000000000 Z
11
+ date: 2017-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -591,7 +591,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
591
591
  version: 1.8.11
592
592
  requirements: []
593
593
  rubyforge_project: imagine_cms
594
- rubygems_version: 2.4.6
594
+ rubygems_version: 2.4.8
595
595
  signing_key:
596
596
  specification_version: 4
597
597
  summary: Imagine Content Management System for Rails