casein 5.1.1.1 → 5.1.1.2
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 +4 -4
- data/README.rdoc +17 -13
- data/app/helpers/casein/casein_helper.rb +32 -55
- data/lib/casein/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7354f9f7e65cbd596a76c098c53dacfc571a4b36
|
4
|
+
data.tar.gz: 9becab574370ce29dd7954ec25d642d3b1c148cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 368154bd219b3504def38ef38312bb394b576e340145e9c2dd3c6538ce1d613f70283d45eef0b0ce80a0810fe82f3fa07ae49d5db3de364fef2066d5e16be410
|
7
|
+
data.tar.gz: 60a13f4858a138462c413b3dbcc532751a2458dbc3dd512f42942c295b6dd91903e71c7b9ccbec01d036e44bef3c6f9a51440be435576fc753268ade8a163c19
|
data/README.rdoc
CHANGED
@@ -220,20 +220,24 @@ All of the standard Rails form helpers are available, but the Casein versions ar
|
|
220
220
|
casein_datetime_select form, obj, attribute, options = {}
|
221
221
|
casein_file_field form, obj, object_name, attribute, options = {}
|
222
222
|
casein_hidden_field form, obj, attribute, options = {}
|
223
|
+
casein_color_field form, obj, attribute, options = {}
|
224
|
+
casein_search_field form, obj, attribute, options = {}
|
225
|
+
casein_telephone_field form, obj, attribute, options = {}
|
226
|
+
casein_url_field form, obj, attribute, options = {}
|
227
|
+
casein_email_field form, obj, attribute, options = {}
|
228
|
+
casein_date_field form, obj, attribute, options = {}
|
229
|
+
casein_datetime_field form, obj, attribute, options = {}
|
230
|
+
casein_datetime_local_field form, obj, attribute, options = {}
|
231
|
+
casein_month_field form, obj, attribute, options = {}
|
232
|
+
casein_week_field form, obj, attribute, options = {}
|
233
|
+
casein_time_field form, obj, attribute, options = {}
|
234
|
+
casein_number_field form, obj, attribute, options = {}
|
235
|
+
casein_range_field form, obj, attribute, options = {}
|
236
|
+
|
237
|
+
|
238
|
+
You can also add custom contents:
|
239
|
+
|
223
240
|
casein_custom_field form, obj, attribute, custom_contents, options = {}
|
224
|
-
casein_color_field form, obj, attribute, options = nil
|
225
|
-
casein_search_field form, obj, attribute, options = nil
|
226
|
-
casein_telephone_field form, obj, attribute, options = nil
|
227
|
-
casein_url_field form, obj, attribute, options = nil
|
228
|
-
casein_email_field form, obj, attribute, options = nil
|
229
|
-
casein_date_field form, obj, attribute, options = nil
|
230
|
-
casein_datetime_field form, obj, attribute, options = nil
|
231
|
-
casein_datetime_local_field form, obj, attribute, options = nil
|
232
|
-
casein_month_field form, obj, attribute, options = nil
|
233
|
-
casein_week_field form, obj, attribute, options = nil
|
234
|
-
casein_time_field form, obj, attribute, options = nil
|
235
|
-
casein_number_field form, obj, attribute, range, step, options = nil
|
236
|
-
casein_range_field form, obj, attribute, range, options = nil
|
237
241
|
|
238
242
|
|
239
243
|
For more information on each function, check the app/helpers/casein/casein_helper.rb file within the project. The method parameters are typically the same as the Rails form tag helpers. There are some extra Casein options that can be passed through as part of the options hash:
|
@@ -3,9 +3,9 @@ module Casein
|
|
3
3
|
|
4
4
|
def casein_get_footer_string include_version = false
|
5
5
|
if include_version
|
6
|
-
"Running on #{link_to 'Casein', 'http://www.
|
6
|
+
"Running on #{link_to 'Casein', 'http://www.caseincms.com'} #{casein_get_full_version_string}, an open-source project.".html_safe
|
7
7
|
else
|
8
|
-
"Running on #{link_to 'Casein', 'http://www.
|
8
|
+
"Running on #{link_to 'Casein', 'http://www.caseincms.com'}, an open-source project.".html_safe
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
@@ -212,88 +212,66 @@ module Casein
|
|
212
212
|
form.hidden_field(attribute, strip_casein_options(options)).html_safe
|
213
213
|
end
|
214
214
|
|
215
|
-
def
|
216
|
-
|
215
|
+
def casein_color_field form, obj, attribute, options = {}
|
216
|
+
casein_form_tag_wrapper(form.color_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
|
217
217
|
end
|
218
218
|
|
219
|
-
def
|
220
|
-
options
|
221
|
-
casein_wrapped_field :color_field, form, obj, attribute, options
|
219
|
+
def casein_search_field form, obj, attribute, options = {}
|
220
|
+
casein_form_tag_wrapper(form.search_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
|
222
221
|
end
|
223
222
|
|
224
|
-
def
|
225
|
-
options
|
226
|
-
casein_wrapped_field :search_field, form, obj, attribute, options
|
223
|
+
def casein_telephone_field form, obj, attribute, options = {}
|
224
|
+
casein_form_tag_wrapper(form.telephone_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
|
227
225
|
end
|
228
226
|
|
229
|
-
def
|
230
|
-
options
|
231
|
-
casein_wrapped_field :telephone_field, form, obj, attribute, options
|
227
|
+
def casein_url_field form, obj, attribute, options = {}
|
228
|
+
casein_form_tag_wrapper(form.url_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
|
232
229
|
end
|
233
230
|
|
234
|
-
def
|
235
|
-
options
|
236
|
-
casein_wrapped_field :url_field, form, obj, attribute, options
|
231
|
+
def casein_email_field form, obj, attribute, options = {}
|
232
|
+
casein_form_tag_wrapper(form.email_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
|
237
233
|
end
|
238
234
|
|
239
|
-
def
|
240
|
-
options
|
241
|
-
casein_wrapped_field :email_field, form, obj, attribute, options
|
235
|
+
def casein_date_field form, obj, attribute, options = {}
|
236
|
+
casein_form_tag_wrapper(form.date_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
|
242
237
|
end
|
243
238
|
|
244
|
-
def
|
245
|
-
options
|
246
|
-
casein_wrapped_field :date_field, form, obj, attribute, options
|
239
|
+
def casein_datetime_field form, obj, attribute, options = {}
|
240
|
+
casein_form_tag_wrapper(form.datetime_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
|
247
241
|
end
|
248
242
|
|
249
|
-
def
|
250
|
-
options
|
251
|
-
casein_wrapped_field :datetime_field, form, obj, attribute, options
|
243
|
+
def casein_datetime_local_field form, obj, attribute, options = {}
|
244
|
+
casein_form_tag_wrapper(form.datetime_local_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
|
252
245
|
end
|
253
246
|
|
254
|
-
def
|
255
|
-
options
|
256
|
-
casein_wrapped_field :datetime_local_field, form, obj, attribute, options
|
247
|
+
def casein_month_field form, obj, attribute, options = {}
|
248
|
+
casein_form_tag_wrapper(form.month_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
|
257
249
|
end
|
258
250
|
|
259
|
-
def
|
260
|
-
options
|
261
|
-
casein_wrapped_field :month_field, form, obj, attribute, options
|
251
|
+
def casein_week_field form, obj, attribute, options = {}
|
252
|
+
casein_form_tag_wrapper(form.week_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
|
262
253
|
end
|
263
254
|
|
264
|
-
def
|
265
|
-
options
|
266
|
-
casein_wrapped_field :week_field, form, obj, attribute, options
|
255
|
+
def casein_time_field form, obj, attribute, options = {}
|
256
|
+
casein_form_tag_wrapper(form.time_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
|
267
257
|
end
|
268
258
|
|
269
|
-
def
|
270
|
-
options
|
271
|
-
casein_wrapped_field :time_field, form, obj, attribute, options
|
259
|
+
def casein_number_field form, obj, attribute, options = {}
|
260
|
+
casein_form_tag_wrapper(form.number_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
|
272
261
|
end
|
273
262
|
|
274
|
-
def
|
275
|
-
options
|
276
|
-
casein_wrapped_field :number_field, form, obj, attribute, {in: range, step: step}.merge(options)
|
263
|
+
def casein_range_field form, obj, attribute, options = {}
|
264
|
+
casein_form_tag_wrapper(form.range_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
|
277
265
|
end
|
278
266
|
|
279
|
-
def
|
280
|
-
|
281
|
-
casein_wrapped_field :range_field, form, obj, attribute, {in: range}.merge(options)
|
267
|
+
def casein_custom_field form, obj, attribute, custom_contents, options = {}
|
268
|
+
casein_form_tag_wrapper(custom_contents, form, obj, attribute, options).html_safe
|
282
269
|
end
|
283
270
|
|
284
|
-
|
285
271
|
protected
|
286
272
|
|
287
|
-
def casein_wrapped_field field_helper_method, form, obj, attribute, options
|
288
|
-
clz = "casein-" + field_helper_method.to_s.gsub(/_field$/,'').gsub('_', '-')
|
289
|
-
contents = content_tag 'div', class: clz do
|
290
|
-
form.send(field_helper_method, attribute, strip_casein_options(options))
|
291
|
-
end
|
292
|
-
casein_form_tag_wrapper(contents.html_safe, form, obj, attribute, options).html_safe
|
293
|
-
end
|
294
|
-
|
295
273
|
def strip_casein_options options
|
296
|
-
|
274
|
+
options.reject {|key, value| key.to_s.include? "casein_" }
|
297
275
|
end
|
298
276
|
|
299
277
|
def merged_class_hash options, new_class
|
@@ -312,8 +290,7 @@ module Casein
|
|
312
290
|
options
|
313
291
|
end
|
314
292
|
|
315
|
-
def casein_form_tag_wrapper form_tag, form, obj, attribute, options =
|
316
|
-
options ||= {}
|
293
|
+
def casein_form_tag_wrapper form_tag, form, obj, attribute, options = {}
|
317
294
|
unless options.key? :casein_label
|
318
295
|
human_attribute_name = attribute.to_s.humanize
|
319
296
|
else
|
data/lib/casein/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: casein
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.1.
|
4
|
+
version: 5.1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Russell Quinn
|
@@ -101,7 +101,7 @@ dependencies:
|
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '3.0'
|
104
|
-
type: :
|
104
|
+
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
@@ -115,7 +115,7 @@ dependencies:
|
|
115
115
|
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
|
-
type: :
|
118
|
+
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
@@ -129,7 +129,7 @@ dependencies:
|
|
129
129
|
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
|
-
type: :
|
132
|
+
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|