casein 3.1.5 → 3.1.6

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: 5
3
+ patch: 6
4
4
  build:
@@ -68,19 +68,19 @@ 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, strip_casein_options(options.merge({:class => 'caseinTextField'}))), form, obj, attribute, options).html_safe
71
+ casein_form_tag_wrapper(form.text_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, '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, strip_casein_options(options.merge({:class => 'caseinTextField'}))), form, obj, attribute, options).html_safe
75
+ casein_form_tag_wrapper(form.password_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, '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, strip_casein_options(options.merge({:class => 'caseinTextArea'}))), form, obj, attribute, options).html_safe
79
+ casein_form_tag_wrapper(form.text_area(attribute, strip_casein_options(options_hash_with_merged_classes(options, '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, strip_casein_options(options.merge({:class => 'caseinTextAreaBig'}))), form, obj, attribute, options).html_safe
83
+ casein_form_tag_wrapper(form.text_area(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'caseinTextAreaBig'))), form, obj, attribute, options).html_safe
84
84
  end
85
85
 
86
86
  def casein_check_box form, obj, attribute, options = {}
@@ -124,31 +124,32 @@ 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, strip_casein_options(options), {:class => 'caseinSelect'}), form, obj, attribute, options).html_safe
127
+ casein_form_tag_wrapper(form.select(attribute, option_tags, strip_casein_options(options), merged_class_hash(options, '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, strip_casein_options(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), merged_class_hash(options, '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, strip_casein_options(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), merged_class_hash(options, '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, strip_casein_options(options), {:class => 'caseinDateTimeSelect'}), form, obj, attribute, options).html_safe
139
+ casein_form_tag_wrapper(form.date_select(attribute, strip_casein_options(options), merged_class_hash(options, '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, strip_casein_options(options), {:class => 'caseinDateTimeSelect'}), form, obj, attribute, options).html_safe
143
+ casein_form_tag_wrapper(form.time_select(attribute, strip_casein_options(options), merged_class_hash(options, '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, strip_casein_options(options), {:class => 'caseinDateTimeSelect'}), form, obj, attribute, options).html_safe
147
+ casein_form_tag_wrapper(form.datetime_select(attribute, strip_casein_options(options), merged_class_hash(options, '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, strip_casein_options(options)) + '</div>'
151
+ class_hash = merged_class_hash(options, 'caseinFileFieldContainer')
152
+ contents = "<div class='#{class_hash['class']}'>" + file_field(object_name, attribute, strip_casein_options(options)) + '</div>'
152
153
  casein_form_tag_wrapper(contents, form, obj, attribute, options).html_safe
153
154
  end
154
155
 
@@ -161,6 +162,22 @@ module Casein
161
162
  def strip_casein_options options
162
163
  options.reject {|key, value| key.to_s.include? "casein_" }
163
164
  end
165
+
166
+ def merged_class_hash options, new_class
167
+ if options.key? :class
168
+ new_class += " #{options[:class]}"
169
+ end
170
+
171
+ {:class => new_class}
172
+ end
173
+
174
+ def options_hash_with_merged_classes options, new_class
175
+ if options.key? :class
176
+ new_class += " #{options[:class]}"
177
+ end
178
+ options[:class] = new_class
179
+ options
180
+ end
164
181
 
165
182
  def casein_form_tag_wrapper form_tag, form, obj, attribute, options = {}
166
183
  unless options.key? :casein_label
@@ -11,6 +11,10 @@ body {
11
11
  font-family: "Lucida Grande", "Trebuchet MS", Helvetica, Arial, sans-serif;
12
12
  }
13
13
 
14
+ a {
15
+ outline: none;
16
+ }
17
+
14
18
  #header {
15
19
  background: #efefef url(/casein/images/login/top.png) repeat-x bottom left;
16
20
  padding: 80px 0 40px 0;
@@ -25,6 +25,7 @@ img {
25
25
  a {
26
26
  color: #333333;
27
27
  text-decoration: underline;
28
+ outline: none;
28
29
  }
29
30
 
30
31
  a:hover {
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: 9
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 3
8
8
  - 1
9
- - 5
10
- version: 3.1.5
9
+ - 6
10
+ version: 3.1.6
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-09-06 00:00:00 +02:00
19
+ date: 2010-09-08 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency