datagrid 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.markdown +1 -1
- data/VERSION +1 -1
- data/datagrid.gemspec +2 -2
- data/lib/datagrid/form_builder.rb +4 -2
- data/lib/datagrid/scaffold.rb +10 -1
- data/spec/datagrid/form_builder_spec.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8edc6a25bb802b852ce81f90623d3fca8b6fc5e4
|
4
|
+
data.tar.gz: 8ee50cd8e1a3f759fc5344262c73fc054a47e4d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 294214bffac7241ea3f36a40bdb20df4b9efbd9a80b908e352129faf1ca98721d5b9e32d3c857c2e00538d19efbd0a7ded3a08376587647502faa2244a08731e
|
7
|
+
data.tar.gz: a733509325684ddadd94e9feab83c3e475c8b00a577812da0b7b7d7a394df692f9790b1d87fc713df7b370afcdb7770de955aaa8baa83f47b264bcbf853f3f9c
|
data/Readme.markdown
CHANGED
@@ -159,9 +159,9 @@ create app/grids/skills_grid.rb
|
|
159
159
|
create app/controllers/skills_controller.rb
|
160
160
|
create app/views/skills/index.html.erb
|
161
161
|
route resources :skills
|
162
|
+
insert app/assets/stylesheet/application.css
|
162
163
|
```
|
163
164
|
|
164
|
-
|
165
165
|
### Customize Built-in partials
|
166
166
|
|
167
167
|
In order to get a control on datagrid built-in partials run:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.5
|
data/datagrid.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: datagrid 1.0.
|
5
|
+
# stub: datagrid 1.0.5 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "datagrid"
|
9
|
-
s.version = "1.0.
|
9
|
+
s.version = "1.0.5"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.authors = ["Bogdan Gusiev"]
|
@@ -11,15 +11,17 @@ module Datagrid
|
|
11
11
|
end
|
12
12
|
|
13
13
|
# Returns a form label html for the corresponding filter name
|
14
|
-
def datagrid_label(filter_or_attribute, options = {}, &block)
|
14
|
+
def datagrid_label(filter_or_attribute, options_or_text = {}, options = {}, &block)
|
15
15
|
filter = datagrid_get_filter(filter_or_attribute)
|
16
|
-
|
16
|
+
text, options = options_or_text.is_a?(Hash) ? [filter.header, options_or_text] : [options_or_text, options]
|
17
|
+
label(filter.name, text, options, &block)
|
17
18
|
end
|
18
19
|
|
19
20
|
protected
|
20
21
|
def datagrid_boolean_enum_filter(attribute_or_filter, options = {})
|
21
22
|
datagrid_enum_filter(attribute_or_filter, options)
|
22
23
|
end
|
24
|
+
|
23
25
|
def datagrid_extended_boolean_filter(attribute_or_filter, options = {})
|
24
26
|
datagrid_enum_filter(attribute_or_filter, options)
|
25
27
|
end
|
data/lib/datagrid/scaffold.rb
CHANGED
@@ -9,7 +9,16 @@ class Datagrid::Scaffold < Rails::Generators::NamedBase
|
|
9
9
|
template "index.html.erb", "app/views/#{grid_controller_short_name}/index.html.erb"
|
10
10
|
route("resources :#{grid_controller_short_name}")
|
11
11
|
in_root do
|
12
|
-
|
12
|
+
{
|
13
|
+
"css" => " *= require datagrid",
|
14
|
+
"css.sass" => " *= require datagrid",
|
15
|
+
"css.scss" => " *= require datagrid",
|
16
|
+
}.each do |extension, string|
|
17
|
+
file = "app/assets/stylesheets/application.#{extension}"
|
18
|
+
if File.exists?(Rails.root.join(file))
|
19
|
+
inject_into_file file, string + "\n", {:before => %r{.*require_self}} # before all
|
20
|
+
end
|
21
|
+
end
|
13
22
|
end
|
14
23
|
end
|
15
24
|
|
@@ -473,5 +473,10 @@ describe Datagrid::FormBuilder do
|
|
473
473
|
'<label class="foo" for="report_name">The Name</label>'
|
474
474
|
)
|
475
475
|
end
|
476
|
+
it "should support explicit label" do
|
477
|
+
view.datagrid_label(:name, "The Name").should equal_to_dom(
|
478
|
+
'<label for="report_name">The Name</label>'
|
479
|
+
)
|
480
|
+
end
|
476
481
|
end
|
477
482
|
end
|