imagine_cms 3.0.22 → 3.0.23

Sign up to get free protection for your applications and to get access to all the features.
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ imagine_cms
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-1.9.3-p429
@@ -3,6 +3,9 @@
3
3
  * in application.js *
4
4
  ********************************/
5
5
 
6
+ // Fixes gallery reordering (Scriptaculous Sortable)
7
+ Position.includeScrollOffsets = true;
8
+
6
9
  var defaultXMenuOffset = 0;
7
10
  var defaultYMenuOffset = 0;
8
11
  var defaultXOffset = 0;
@@ -259,6 +259,9 @@ module Cms # :nodoc:
259
259
  render :text => '', :status => '304 Not Modified' and return
260
260
  end
261
261
 
262
+ @@cms_page_table_exists ||= CmsPage.table_exists?
263
+ return not_found unless @@cms_page_table_exists
264
+
262
265
  @pg = CmsPage.find_by_id(params[:page_id])
263
266
  render :nothing => true and return unless @pg && params[:page_list_name]
264
267
  key = "obj-page_list-#{params[:page_list_name].gsub(/[^\w]/, '_')}"
@@ -1004,7 +1004,7 @@ class Management::CmsController < Management::ApplicationController # :nodoc:
1004
1004
  captions = YAML.load_file(File.join(gallery_dir, 'captions.yml')).to_a
1005
1005
  captions[image_id] = params[:caption]
1006
1006
 
1007
- File.open(File.join(gallery_dir, 'captions.yml'), "w") { |f| YAML.dump(captions, f) }
1007
+ File.open(File.join(gallery_dir, 'captions.yml'), "w") { |f| f << captions.to_yaml }
1008
1008
  end
1009
1009
 
1010
1010
  redirect_to :action => 'gallery_management', :id => params[:id], :gallery_id => params[:gallery_id]
@@ -1177,11 +1177,12 @@ class Management::CmsController < Management::ApplicationController # :nodoc:
1177
1177
  @pg = CmsPage.find_by_id(params[:id])
1178
1178
  localfile = File.join(Rails.root, 'public', 'assets', 'content', @pg.path, File.basename(params[:filename]))
1179
1179
 
1180
- @filename = localfile + "?#{File.mtime(localfile).to_i}"
1181
1180
  bucket = ImagineCmsConfig['amazon_s3'][Rails.env]['file_bucket'] rescue nil
1182
1181
  prefix = ImagineCmsConfig['amazon_s3']['file_prefix'] rescue nil
1183
1182
  upload_to_s3(localfile, @pg, bucket, prefix)
1184
1183
 
1184
+ @filename = localfile.split('/').map { |s| CGI::escape(s) }.join('/') + "?#{File.mtime(localfile).to_i}"
1185
+
1185
1186
  render :partial => 'create_file_link'
1186
1187
  end
1187
1188
 
@@ -150,7 +150,7 @@ module ActionControllerExtensions
150
150
  content << '<td>Page:&nbsp;</td>'
151
151
  num_segments.times do |seg|
152
152
  start = seg * limit
153
- content << "<td><div"
153
+ content << "<td><a href=\"#\""
154
154
  if offset >= start && offset < (start + limit)
155
155
  content << " class=\"page_list_segment page_list_segment_selected\""
156
156
  else
@@ -161,7 +161,7 @@ module ActionControllerExtensions
161
161
  content << remote_function(:update => key, :url => { :content_path => @pg.path.split('/').concat([ 'segment', start.to_s, name ]) })
162
162
  content << "; return false;\""
163
163
  end
164
- content << ">#{seg+1}</div></td>"
164
+ content << ">#{seg+1}</a></td>"
165
165
  end
166
166
  content << '</tr></table>'
167
167
  end
@@ -1,3 +1,3 @@
1
1
  module ImagineCms
2
- VERSION = "3.0.22"
2
+ VERSION = "3.0.23"
3
3
  end
@@ -7,8 +7,12 @@ namespace :imagine_cms do
7
7
  include ActionDispatch::Routing::UrlFor
8
8
  include Rails.application.routes.url_helpers
9
9
 
10
- CmsPage.find_each do |page|
11
- ActionController::Base.expire_page url_for(:controller => 'cms/content', :action => 'show', :content_path => page.path, :only_path => true)
10
+ # expire home page
11
+ ActionController::Base.expire_page url_for(:controller => 'cms/content', :action => 'show', :content_path => nil, :only_path => true)
12
+
13
+ # expire all other pages
14
+ CmsPage.select([ :id, :path ]).find_each do |page|
15
+ ActionController::Base.expire_page url_for(:controller => 'cms/content', :action => 'show', :content_path => page.path.split('/'), :only_path => true)
12
16
  end
13
17
 
14
18
  puts "Cache cleared."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imagine_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.22
4
+ version: 3.0.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-04 00:00:00.000000000 Z
12
+ date: 2013-06-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -178,7 +178,8 @@ extensions: []
178
178
  extra_rdoc_files: []
179
179
  files:
180
180
  - .gitignore
181
- - .rvmrc
181
+ - .ruby-gemset
182
+ - .ruby-version
182
183
  - Gemfile
183
184
  - README.rdoc
184
185
  - Rakefile
data/.rvmrc DELETED
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- ruby_string="ruby-1.9.3-p392"
4
- gemset_name="imagine_cms"
5
-
6
- alias rails='bundle exec rails'
7
-
8
- if rvm list strings | grep -q "${ruby_string}" ; then
9
- # Load or create the specified environment
10
- if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
11
- && -s "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}" ]] ; then
12
- \. "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}"
13
- else
14
- rvm --create "${ruby_string}@${gemset_name}"
15
- fi
16
- else
17
- # Notify the user to install the desired interpreter before proceeding.
18
- echo "${ruby_string} was not found, please run 'rvm install ${ruby_string}' and then cd back into the project directory."
19
- fi