corn_starch 1.1.20 → 1.1.21
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 297383f34b6145554c6f05258d3a1b8352d911db
|
4
|
+
data.tar.gz: de6071b28f21cf57d1d8b5d8baeefc16bdb68133
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8234f99b90f4371e90a212bd17a79f8ed7a8dbe30c79e32984c3d575abfae3ed94b725a3b9eaba4cdcef37693ca7b7d5699a9f2a4d22bb06e51c787a03083f77
|
7
|
+
data.tar.gz: 6ad237ce5a9d90cdb0bec49a4ac5e8b23492306369c28a743bf06e43c84c8427ba1e8f714ae6bf72f026fbce9282a8672f6940e9c0f2b419ff9e28ba7be26151
|
@@ -107,7 +107,7 @@ module CornStarch
|
|
107
107
|
@pagination[:pg_count] = 0
|
108
108
|
|
109
109
|
# Acquire Records per Page from Session / Configuration
|
110
|
-
@pagination[:recs_per_page] = (session[:pagination][:recs_per_page] || CORNSTARCH_CONF[
|
110
|
+
@pagination[:recs_per_page] = (session[:pagination][:recs_per_page] || CORNSTARCH_CONF[:pagination][:records_per_page][:default]).to_i
|
111
111
|
end
|
112
112
|
|
113
113
|
##################
|
@@ -116,12 +116,12 @@ module CornStarch
|
|
116
116
|
|
117
117
|
# User Model
|
118
118
|
def user_model
|
119
|
-
Kernel.const_get CORNSTARCH_CONF[
|
119
|
+
Kernel.const_get CORNSTARCH_CONF[:authentication][:user_model][:name]
|
120
120
|
end
|
121
121
|
|
122
122
|
# UID Field
|
123
123
|
def uid_field
|
124
|
-
CORNSTARCH_CONF[
|
124
|
+
CORNSTARCH_CONF[:authentication][:user_model][:uid_field]
|
125
125
|
end
|
126
126
|
|
127
127
|
# Current User
|
@@ -151,9 +151,9 @@ module CornStarch
|
|
151
151
|
@pagination[:pg_count] = (total / @pagination[:recs_per_page]) + (((total % @pagination[:recs_per_page]) > 0) ? 1 : 0)
|
152
152
|
|
153
153
|
# Compute Page Range
|
154
|
-
range_start = current - (CORNSTARCH_CONF[
|
154
|
+
range_start = current - (CORNSTARCH_CONF[:pagination][:page_range] / 2)
|
155
155
|
range_start = 0 if range_start < 0
|
156
|
-
range_end = current + (CORNSTARCH_CONF[
|
156
|
+
range_end = current + (CORNSTARCH_CONF[:pagination][:page_range] / 2)
|
157
157
|
range_end = @pagination[:pg_count] - 1 if range_end >= @pagination[:pg_count]
|
158
158
|
|
159
159
|
# Create Page Links
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<div class='form-group'>
|
15
15
|
<%= label_tag :records_per_page, 'Records per page', class: 'control-label' %>
|
16
16
|
<div class='input-group'>
|
17
|
-
<%= select_tag :records_per_page, options_for_select(CORNSTARCH_CONF[
|
17
|
+
<%= select_tag :records_per_page, options_for_select(CORNSTARCH_CONF[:pagination][:records_per_page][:opts], @pagination[:recs_per_page]), class: 'form-control' %>
|
18
18
|
</div>
|
19
19
|
</div>
|
20
20
|
<%= submit_tag 'Go', name: nil, class: 'btn btn-primary' %>
|
data/lib/corn_starch/version.rb
CHANGED