Permalink
Browse files

Checkboxes in default stylesheet

  • Loading branch information...
1 parent a74c129 commit 05c33e11195385bf3ce54e1a7c420adb3ebf80ed @bogdan committed Dec 6, 2013
Showing with 9 additions and 2 deletions.
  1. +6 −0 app/assets/stylesheets/datagrid.css.sass
  2. +1 −0 lib/datagrid/form_builder.rb
  3. +2 −2 spec/datagrid/form_builder_spec.rb
@@ -96,6 +96,12 @@ table.datagrid
.separator
float: left
margin: 6px 4px 0
+ .enum_filter.checkboxes
+ float: none
+ display: block
+ input
+ margin: 7px
+ margin-left: 150px
.datagrid-actions
@@ -37,6 +37,7 @@ def datagrid_default_filter(attribute_or_filter, options = {})
def datagrid_enum_filter(attribute_or_filter, options = {})
filter = datagrid_get_filter(attribute_or_filter)
if filter.checkboxes?
+ options = add_html_classes(options, 'checkboxes')
filter.select(object).map do |element|
text, value = @template.send(:option_text_and_value, element)
id = [object_name, filter.name, value].join('_').underscore
@@ -236,8 +236,8 @@ class MyTemplate
let(:_filter) { :category }
it { should equal_to_dom(
'
-<label class="category enum_filter" for="report_category_first"><input id="report_category_first" name="report[category][]" type="checkbox" value="first" />first</label>
-<label class="category enum_filter" for="report_category_second"><input id="report_category_second" name="report[category][]" type="checkbox" value="second" />second</label>
+<label class="category enum_filter checkboxes" for="report_category_first"><input id="report_category_first" name="report[category][]" type="checkbox" value="first" />first</label>
+<label class="category enum_filter checkboxes" for="report_category_second"><input id="report_category_second" name="report[category][]" type="checkbox" value="second" />second</label>
'
)}
end

0 comments on commit 05c33e1

Please sign in to comment.