casein 3.1.2 → 3.1.3

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.
@@ -1,4 +1,4 @@
1
1
  major: 3
2
2
  minor: 1
3
- patch: 2
3
+ patch: 3
4
4
  build:
@@ -68,23 +68,23 @@ module Casein
68
68
  # Styled form tag helpers
69
69
 
70
70
  def casein_text_field form, obj, attribute, options = {}
71
- casein_form_tag_wrapper(form.text_field(attribute, options.merge({:class => 'caseinTextField'})), form, obj, attribute, options).html_safe
71
+ casein_form_tag_wrapper(form.text_field(attribute, strip_casein_options(options.merge({:class => 'caseinTextField'}))), form, obj, attribute, options).html_safe
72
72
  end
73
73
 
74
74
  def casein_password_field form, obj, attribute, options = {}
75
- casein_form_tag_wrapper(form.password_field(attribute, options.merge({:class => 'caseinTextField'})), form, obj, attribute, options).html_safe
75
+ casein_form_tag_wrapper(form.password_field(attribute, strip_casein_options(options.merge({:class => 'caseinTextField'}))), form, obj, attribute, options).html_safe
76
76
  end
77
77
 
78
78
  def casein_text_area form, obj, attribute, options = {}
79
- casein_form_tag_wrapper(form.text_area(attribute, options.merge({:class => 'caseinTextArea'})), form, obj, attribute, options).html_safe
79
+ casein_form_tag_wrapper(form.text_area(attribute, strip_casein_options(options.merge({:class => 'caseinTextArea'}))), form, obj, attribute, options).html_safe
80
80
  end
81
81
 
82
82
  def casein_text_area_big form, obj, attribute, options = {}
83
- casein_form_tag_wrapper(form.text_area(attribute, options.merge({:class => 'caseinTextAreaBig'})), form, obj, attribute, options).html_safe
83
+ casein_form_tag_wrapper(form.text_area(attribute, strip_casein_options(options.merge({:class => 'caseinTextAreaBig'}))), form, obj, attribute, options).html_safe
84
84
  end
85
85
 
86
86
  def casein_check_box form, obj, attribute, options = {}
87
- form_tag = form.check_box(attribute, options)
87
+ form_tag = form.check_box(attribute, strip_casein_options(options))
88
88
 
89
89
  if options.key? :casein_box_label
90
90
  form_tag = "<div>" + form_tag + "<span class=\"rcText\">#{options[:casein_box_label]}</span></div>".html_safe
@@ -104,7 +104,7 @@ module Casein
104
104
  end
105
105
 
106
106
  def casein_radio_button form, obj, attribute, tag_value, options = {}
107
- form_tag = form.radio_button(obj, attribute, tag_value, options)
107
+ form_tag = form.radio_button(obj, attribute, tag_value, strip_casein_options(options))
108
108
 
109
109
  if options.key? :casein_button_label
110
110
  form_tag = "<div>" + form_tag + "<span class=\"rcText\">#{options[:casein_button_label]}</span></div>".html_safe
@@ -124,40 +124,44 @@ module Casein
124
124
  end
125
125
 
126
126
  def casein_select form, obj, attribute, option_tags, options = {}
127
- casein_form_tag_wrapper(form.select(attribute, option_tags, options, {:class => 'caseinSelect'}), form, obj, attribute, options).html_safe
127
+ casein_form_tag_wrapper(form.select(attribute, option_tags, strip_casein_options(options), {:class => 'caseinSelect'}), form, obj, attribute, options).html_safe
128
128
  end
129
129
 
130
130
  def casein_time_zone_select form, obj, attribute, option_tags, options = {}
131
- casein_form_tag_wrapper(form.time_zone_select(attribute, option_tags, options, {:class => 'caseinSelect'}), form, obj, attribute, options).html_safe
131
+ casein_form_tag_wrapper(form.time_zone_select(attribute, option_tags, strip_casein_options(options), {:class => 'caseinSelect'}), form, obj, attribute, options).html_safe
132
132
  end
133
133
 
134
134
  def casein_collection_select form, obj, object, attribute, collection, value_method, text_method, options = {}
135
- casein_form_tag_wrapper(collection_select(object, attribute, collection, value_method, text_method, options, {:class => 'caseinSelect'}), form, obj, attribute, options).html_safe
135
+ casein_form_tag_wrapper(collection_select(object, attribute, collection, value_method, text_method, strip_casein_options(options), {:class => 'caseinSelect'}), form, obj, attribute, options).html_safe
136
136
  end
137
137
 
138
138
  def casein_date_select form, obj, attribute, options = {}
139
- casein_form_tag_wrapper(form.date_select(attribute, options, {:class => 'caseinDateTimeSelect'}), form, obj, attribute, options).html_safe
139
+ casein_form_tag_wrapper(form.date_select(attribute, strip_casein_options(options), {:class => 'caseinDateTimeSelect'}), form, obj, attribute, options).html_safe
140
140
  end
141
141
 
142
142
  def casein_time_select form, obj, attribute, options = {}
143
- casein_form_tag_wrapper(form.time_select(attribute, options, {:class => 'caseinDateTimeSelect'}), form, obj, attribute, options).html_safe
143
+ casein_form_tag_wrapper(form.time_select(attribute, strip_casein_options(options), {:class => 'caseinDateTimeSelect'}), form, obj, attribute, options).html_safe
144
144
  end
145
145
 
146
146
  def casein_datetime_select form, obj, attribute, options = {}
147
- casein_form_tag_wrapper(form.datetime_select(attribute, options, {:class => 'caseinDateTimeSelect'}), form, obj, attribute, options).html_safe
147
+ casein_form_tag_wrapper(form.datetime_select(attribute, strip_casein_options(options), {:class => 'caseinDateTimeSelect'}), form, obj, attribute, options).html_safe
148
148
  end
149
149
 
150
150
  def casein_file_field form, obj, object_name, attribute, options = {}
151
- contents = '<div class="caseinFileFieldContainer">' + file_field(object_name, attribute, options) + '</div>'
151
+ contents = '<div class="caseinFileFieldContainer">' + file_field(object_name, attribute, strip_casein_options(options)) + '</div>'
152
152
  casein_form_tag_wrapper(contents, form, obj, attribute, options).html_safe
153
153
  end
154
154
 
155
155
  def casein_hidden_field form, obj, attribute, options = {}
156
- form.hidden_field(obj, attribute, options).html_safe
156
+ form.hidden_field(obj, attribute, strip_casein_options(options)).html_safe
157
157
  end
158
158
 
159
159
  protected
160
160
 
161
+ def strip_casein_options options
162
+ options.reject {|key, value| key.to_s.include? "casein_" }
163
+ end
164
+
161
165
  def casein_form_tag_wrapper form_tag, form, obj, attribute, options = {}
162
166
  unless options.key? :casein_label
163
167
  human_attribute_name = attribute.to_s.humanize
@@ -1,3 +1,2 @@
1
1
  // CASEIN CUSTOM
2
- // Use this file for your project specific Casein JavaScript
3
- // (c) Spoiled Milk ApS
2
+ // Use this file for your project-specific Casein JavaScript
@@ -1,3 +1,2 @@
1
1
  /* CASEIN CUSTOM */
2
- /* Use this file for your project specific Casein CSS */
3
- /* (c) Spoiled Milk ApS */
2
+ /* Use this file for your project-specific Casein CSS */
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: casein
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease: false
6
6
  segments:
7
7
  - 3
8
8
  - 1
9
- - 2
10
- version: 3.1.2
9
+ - 3
10
+ version: 3.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Russell Quinn
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-08-31 00:00:00 +02:00
19
+ date: 2010-09-01 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency