caboose-cms 0.2.47 → 0.2.48
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 +8 -8
- data/app/models/caboose/page_bar_generator.rb +19 -8
- data/lib/caboose/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDUzMTk2MWQ2ZmU5YmFjYzUwODdhMGI3ZjgyNzFmYzhkMDc3ZmUzYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmVkODUwZjhmYmEwYmJiMzkwMTNkZGNmYmQ5NGIxMjJiMmNlNmZhNA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODlmY2VlZjczODY3YjUwMmZmY2Q0NTkwNjg1OWFmNjczMzY2NjkzN2Q5YjA5
|
10
|
+
MGU5MGZiOTlkNWIxNGNlOTkxNjliY2I5YzA2YjEzNzRiZjUxMDY3ZmEyMzIz
|
11
|
+
N2ExMDVlNzAyMGY1MWU0YTNjZTE1NjZlODg5NWMwNmVkMjZjYTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmI1M2FhOTc4NDRhYjkxZTNhZWUwYjBlNzU0NDM1ZjFkYTZjZGE1NGY3Zjk0
|
14
|
+
OTYwNjEwMzQ2NGQ2M2ViZTg3ODg5N2FmNTY5ZDNiYjU2NjY1Y2YyN2VmZjAw
|
15
|
+
MmVlZDYyOGRiNjNjYjcyMjEyZWYyNWRmMDhkYTMxYjIwNjdmOTk=
|
@@ -34,10 +34,22 @@ module Caboose
|
|
34
34
|
options.each { |key, val| @options[key] = val }
|
35
35
|
@params.each { |key, val| @params[key] = post_get[key].nil? ? val : post_get[key] }
|
36
36
|
@options.each { |key, val| @options[key] = post_get[key].nil? ? val : post_get[key] }
|
37
|
-
|
38
|
-
@options['
|
39
|
-
|
40
|
-
|
37
|
+
fix_desc
|
38
|
+
@options['item_count'] = @options['model'].constantize.where(where).count
|
39
|
+
end
|
40
|
+
|
41
|
+
def fix_desc
|
42
|
+
return if @options['desc'] == 1
|
43
|
+
return if @options['desc'] == 0
|
44
|
+
if @options['desc'] == 'true'
|
45
|
+
@options['desc'] = 1
|
46
|
+
return
|
47
|
+
end
|
48
|
+
if @options['desc'] == 'false'
|
49
|
+
@options['desc'] = 1
|
50
|
+
return
|
51
|
+
end
|
52
|
+
@options['desc'] = @options['desc'].to_i
|
41
53
|
end
|
42
54
|
|
43
55
|
def ok(val)
|
@@ -131,10 +143,9 @@ module Caboose
|
|
131
143
|
str = ''
|
132
144
|
|
133
145
|
# key = sort field, value = text to display
|
134
|
-
cols.each do |sort, text|
|
135
|
-
|
136
|
-
|
137
|
-
link = @options['base_url'] + "?#{vars}&sort=#{sort}&desc=" + (desc == 1 ? "0" : "1")
|
146
|
+
cols.each do |sort, text|
|
147
|
+
arrow = @options['sort'] == sort ? (@options['desc'] == 1 ? ' ↑' : ' ↓') : ''
|
148
|
+
link = @options['base_url'] + "?#{vars}&sort=#{sort}&desc=" + (@options['desc'] == 1 ? "0" : "1")
|
138
149
|
str += "<th><a href='#{link}'>#{text}#{arrow}</a></th>\n"
|
139
150
|
end
|
140
151
|
return str
|
data/lib/caboose/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.48
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|