browsercms 3.3.3 → 3.3.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -127,6 +127,7 @@ class Cms::ContentBlockController < Cms::BaseController
|
|
127
127
|
options[:page] = params[:page]
|
128
128
|
options[:order] = model_class.default_order if model_class.respond_to?(:default_order)
|
129
129
|
options[:order] = params[:order] unless params[:order].blank?
|
130
|
+
|
130
131
|
scope = model_class.respond_to?(:list) ? model_class.list : model_class
|
131
132
|
@blocks = scope.searchable? ? scope.search(params[:search]).paginate(options) : scope.paginate(options)
|
132
133
|
check_permissions
|
data/app/models/html_block.rb
CHANGED
@@ -4,10 +4,11 @@ class HtmlBlock < ActiveRecord::Base
|
|
4
4
|
|
5
5
|
validates_presence_of :name
|
6
6
|
|
7
|
-
# Override of search scope from searching behavior to deal with include_body
|
7
|
+
# Override of search scope from searching behavior to deal with include_body
|
8
|
+
# @todo - This might not be necessary. When cucumber is updated, verify if i can just override '"#searchable_columns' instead
|
9
|
+
# which will be more DRY.
|
8
10
|
scope :search, lambda{|search_params|
|
9
11
|
term = search_params.is_a?(Hash) ? search_params[:term] : search_params
|
10
|
-
order = search_params.is_a?(Hash) && search_params[:order] ? search_params[:order] : "html_blocks.name"
|
11
12
|
include_body = search_params.is_a?(Hash) ? search_params[:include_body] : false
|
12
13
|
conditions = []
|
13
14
|
columns = ["name"]
|
@@ -25,7 +26,6 @@ class HtmlBlock < ActiveRecord::Base
|
|
25
26
|
end
|
26
27
|
scope = {}
|
27
28
|
scope[:conditions] = conditions if conditions
|
28
|
-
scope[:order] = order if order
|
29
29
|
scope
|
30
30
|
}
|
31
31
|
|
@@ -66,8 +66,7 @@
|
|
66
66
|
<th<%= attrs %>>
|
67
67
|
<div class="dividers">
|
68
68
|
<% if column[:order] %>
|
69
|
-
<%= link_to column[:label],
|
70
|
-
:order => determine_order(params[:order], column[:order])) %>
|
69
|
+
<%= link_to column[:label], params.merge(:order => determine_order(params[:order], column[:order])) %>
|
71
70
|
<% else %>
|
72
71
|
<%= column[:label] %>
|
73
72
|
<% end %>
|
@@ -14,9 +14,8 @@ module Cms
|
|
14
14
|
extend ClassMethods
|
15
15
|
|
16
16
|
#This is in a method to allow classes to override it
|
17
|
-
scope :search, lambda{|search_params|
|
18
|
-
term = search_params.is_a?(Hash) ? search_params[:term] : search_params
|
19
|
-
order = search_params.is_a?(Hash) && search_params[:order] ? search_params[:order] : default_order_for_search
|
17
|
+
scope :search, lambda{|search_params|
|
18
|
+
term = search_params.is_a?(Hash) ? search_params[:term] : search_params
|
20
19
|
conditions = []
|
21
20
|
unless term.blank?
|
22
21
|
searchable_columns.each do |c|
|
@@ -31,8 +30,7 @@ module Cms
|
|
31
30
|
end
|
32
31
|
scope = {}
|
33
32
|
scope[:conditions] = conditions if conditions
|
34
|
-
scope
|
35
|
-
scope
|
33
|
+
scope
|
36
34
|
}
|
37
35
|
end
|
38
36
|
end
|
@@ -40,9 +38,6 @@ module Cms
|
|
40
38
|
def searchable_columns
|
41
39
|
@searchable_columns
|
42
40
|
end
|
43
|
-
def default_order_for_search
|
44
|
-
"#{table_name}.#{searchable_columns.first}"
|
45
|
-
end
|
46
41
|
end
|
47
42
|
end
|
48
43
|
end
|
data/lib/cms/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browsercms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-04-09 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &70173086668180 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.0.7
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70173086668180
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: ancestry
|
27
|
-
requirement: &
|
27
|
+
requirement: &70173086667720 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.2.4
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70173086667720
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: term-ansicolor
|
38
|
-
requirement: &
|
38
|
+
requirement: &70173086667340 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70173086667340
|
47
47
|
description: Web Content Management in Rails.
|
48
48
|
email: github@browsermedia.com
|
49
49
|
executables:
|
@@ -1363,7 +1363,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1363
1363
|
version: '0'
|
1364
1364
|
segments:
|
1365
1365
|
- 0
|
1366
|
-
hash: -
|
1366
|
+
hash: -3760733705692600221
|
1367
1367
|
requirements: []
|
1368
1368
|
rubyforge_project:
|
1369
1369
|
rubygems_version: 1.8.15
|