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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a33a74ea728f66eb12ea5cc90b17d9be026ac0c1
4
- data.tar.gz: fa60a6ba1ff9812693f313604a6e35a39ad0b84c
3
+ metadata.gz: 8edc6a25bb802b852ce81f90623d3fca8b6fc5e4
4
+ data.tar.gz: 8ee50cd8e1a3f759fc5344262c73fc054a47e4d9
5
5
  SHA512:
6
- metadata.gz: cb4e447b826333a3034cbcf6fc44a95e3ff3fa4266c9868295aa12bc0222391bdb458e8ea45568970b85363fd28944dfe4ed2f3550c60c0faa34c7749aacdd52
7
- data.tar.gz: 2f1bcbe542567a33be0583b8f6c285d249e0c3d9fd88d0e9fa9a0ea1e573f51ba2050954d0cd4b8a6e2e334f8c152f0fdefacf205665cf019c7d6134972b288a
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.4
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.4 ruby lib
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.4"
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
- label(filter.name, filter.header, options, &block)
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
@@ -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
- inject_into_file "app/assets/stylesheets/application.css", " *= require datagrid", {:before => %r{require_self}} # before all
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datagrid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bogdan Gusiev