radiant-find_replace-extension 1.0.5 → 1.0.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.
@@ -3,15 +3,15 @@ class Admin::SearchController < ApplicationController
3
3
  :when => [:designer, :admin],
4
4
  :denied_url => { :controller => 'admin/pages', :action => 'index' },
5
5
  :denied_message => 'You must have designer privileges to perform this action.'
6
-
6
+
7
7
  def results
8
8
  if params[:doReplace]
9
- params.select{|k, v| k =~ /(page|snippet|layout)_(\d)/ }.map do |k,v|
9
+ params.select{|k, v| k =~ /(page|snippet|layout)_(\d)/ }.map do |k,v|
10
10
  class_name, id = k.to_s.split('_')
11
11
  to_replace = class_name.titlecase.constantize.find(id)
12
12
  qry = params[:regex_mode] ? params[:query] : Regexp.quote(params[:query])
13
13
  srch = Regexp.new(qry, params[:case_insensitive])
14
-
14
+
15
15
  if class_name == 'page'
16
16
  if params[:include_page_title_fields]
17
17
  [:slug, :title, :breadcrumb].each do |attr|
@@ -54,7 +54,7 @@ class Admin::SearchController < ApplicationController
54
54
  end
55
55
  end
56
56
  end
57
-
57
+
58
58
  if query = params[:query]
59
59
  like = case Page.connection.adapter_name.downcase
60
60
  when 'postgresql'
@@ -70,9 +70,9 @@ class Admin::SearchController < ApplicationController
70
70
  sqlike = params[:case_insensitive] ? "LIKE" : "LIKE BINARY"
71
71
  end
72
72
  end
73
-
73
+
74
74
  pages_with_matching_slug = Page.find(:all, :conditions => ["slug #{like} ?", match])
75
-
75
+
76
76
  includes = [ :parts, :fields ]
77
77
  cols = []
78
78
  cols += %w(pages.slug pages.breadcrumb pages.title) if params[:include_page_title_fields]
@@ -88,32 +88,32 @@ class Admin::SearchController < ApplicationController
88
88
  else
89
89
  []
90
90
  end
91
-
91
+
92
92
  snippet_cols = []
93
93
  snippet_cols << "content" if params[:include_snippet_contents]
94
94
  snippet_cols << "name" if params[:include_snippet_names]
95
95
  @snippet_results = if snippet_cols.size > 0
96
- Snippet.find(:all, :conditions => [snippet_cols.map{|c| "#{c} #{like} ?"}.join(' OR '), [match]*snippet_cols.size])
96
+ Snippet.find(:all, :conditions => [snippet_cols.map{|c| "#{c} #{like} ?"}.join(' OR '), [match]*snippet_cols.size].flatten)
97
97
  else
98
98
  []
99
99
  end
100
-
100
+
101
101
  layout_cols = []
102
102
  layout_cols << "content" if params[:include_layout_contents]
103
103
  layout_cols << "name" if params[:include_layout_names]
104
104
  @layout_results = if layout_cols.size > 0
105
- Layout.find(:all, :conditions => [layout_cols.map{|c| "#{c} #{like} ?"}.join(' OR '), [match]*layout_cols.size])
105
+ Layout.find(:all, :conditions => [layout_cols.map{|c| "#{c} #{like} ?"}.join(' OR '), [match]*layout_cols.size].flatten)
106
106
  else
107
107
  []
108
108
  end
109
109
  end
110
-
110
+
111
111
  end
112
-
112
+
113
113
  private
114
-
114
+
115
115
  def match
116
116
  qry = params[:regex_mode] ? params[:query] : "%#{params[:query]}%"
117
117
  params[:case_insensitive] ? qry.downcase : qry
118
118
  end
119
- end
119
+ end
@@ -1,5 +1,5 @@
1
1
  module RadiantFindReplaceExtension
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  SUMMARY = "Find Replace for Radiant CMS"
4
4
  DESCRIPTION = "Adds backend search and replace functionality to Radiant CMS!"
5
5
  URL = "https://github.com/jomz/radiant-find_replace-extension"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-find_replace-extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
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: 2017-11-28 00:00:00.000000000 Z
12
+ date: 2018-06-25 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Adds backend search and replace functionality to Radiant CMS!
15
15
  email:
@@ -18,28 +18,29 @@ executables: []
18
18
  extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
- - app/controllers/admin/search_controller.rb
22
- - app/views/admin/search/results.html.haml
23
21
  - config/initializers/radiant_config.rb
24
- - config/locales/en.yml
25
22
  - config/routes.rb
26
- - cucumber.yml
27
- - features/support/env.rb
28
- - features/support/paths.rb
29
- - find_replace_extension.rb
30
- - lib/radiant-find_replace-extension.rb
31
- - lib/tasks/find_replace_extension_tasks.rake
32
- - public/stylesheets/sass/admin/find_replace.sass
33
- - radiant-find_replace-extension-1.0.0.gem
23
+ - config/locales/en.yml
34
24
  - radiant-find_replace-extension-1.0.1.gem
35
- - radiant-find_replace-extension-1.0.2.gem
36
- - radiant-find_replace-extension-1.0.3.gem
25
+ - public/stylesheets/sass/admin/find_replace.sass
37
26
  - radiant-find_replace-extension-1.0.4.gem
27
+ - features/support/env.rb
28
+ - features/support/paths.rb
38
29
  - radiant-find_replace-extension.gemspec
39
- - Rakefile
30
+ - radiant-find_replace-extension-1.0.2.gem
31
+ - cucumber.yml
40
32
  - README.md
33
+ - find_replace_extension.rb
34
+ - radiant-find_replace-extension-1.0.5.gem
35
+ - Rakefile
36
+ - radiant-find_replace-extension-1.0.3.gem
37
+ - lib/tasks/find_replace_extension_tasks.rake
38
+ - lib/radiant-find_replace-extension.rb
41
39
  - spec/spec.opts
42
40
  - spec/spec_helper.rb
41
+ - app/views/admin/search/results.html.haml
42
+ - app/controllers/admin/search_controller.rb
43
+ - radiant-find_replace-extension-1.0.0.gem
43
44
  homepage: https://github.com/jomz/radiant-find_replace-extension
44
45
  licenses: []
45
46
  post_install_message:
@@ -69,4 +70,3 @@ test_files:
69
70
  - spec/spec_helper.rb
70
71
  - features/support/env.rb
71
72
  - features/support/paths.rb
72
- has_rdoc: