datagrid 1.3.5 → 1.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/views/datagrid/_row.html.erb +1 -1
- data/datagrid.gemspec +6 -5
- data/lib/datagrid/filters/boolean_enum_filter.rb +1 -1
- data/lib/datagrid/form_builder.rb +0 -2
- data/lib/datagrid/locale/en.yml +0 -4
- data/lib/datagrid/renderer.rb +1 -1
- data/spec/datagrid/form_builder_spec.rb +1 -1
- data/spec/datagrid/helper_spec.rb +25 -4
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdb4b360ee72ca1cb7506bcc9cce315dfd3b8088
|
4
|
+
data.tar.gz: 48bea2ce4e237383bc9dae59cf34a6e8df40e6b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 528d0971df683ae4bef8e677f54d0b4344500bd3a8a560863135908cad2c56966bc96acdbe46563527cd30469717c459c88e53619e0912df241886674ecede49
|
7
|
+
data.tar.gz: 3d510e71bef9a64f68b7f09c3afca21d60f3c4187fe1634e8b31ade014a3843370a67dcee9d87e02c1c9b81cbb3e065d932861ef4a45db826d2a08ab67ca7e09
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.6
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<tr class="<%= options[:cycle] && cycle(*options[:cycle]) %>">
|
2
2
|
<% grid.html_columns(*options[:columns]).each do |column| %>
|
3
|
-
<td class="<%= datagrid_column_classes(grid, column) %>"><%=
|
3
|
+
<td class="<%= datagrid_column_classes(grid, column) %>"><%= datagrid_value(grid, column, asset) %></td>
|
4
4
|
<% end %>
|
5
5
|
</tr>
|
data/datagrid.gemspec
CHANGED
@@ -2,20 +2,21 @@
|
|
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.3.
|
5
|
+
# stub: datagrid 1.3.6 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "datagrid"
|
9
|
-
s.version = "1.3.
|
9
|
+
s.version = "1.3.6"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Bogdan Gusiev"]
|
14
|
-
s.date = "2015-
|
14
|
+
s.date = "2015-02-05"
|
15
15
|
s.description = "This allows you to easily build datagrid aka data tables with sortable columns and filters"
|
16
16
|
s.email = "agresso@gmail.com"
|
17
17
|
s.extra_rdoc_files = [
|
18
|
-
"LICENSE.txt"
|
18
|
+
"LICENSE.txt",
|
19
|
+
"Readme.markdown"
|
19
20
|
]
|
20
21
|
s.files = [
|
21
22
|
".document",
|
@@ -120,7 +121,7 @@ Gem::Specification.new do |s|
|
|
120
121
|
]
|
121
122
|
s.homepage = "http://github.com/bogdan/datagrid"
|
122
123
|
s.licenses = ["MIT"]
|
123
|
-
s.rubygems_version = "2.
|
124
|
+
s.rubygems_version = "2.4.5"
|
124
125
|
s.summary = "Ruby gem to create datagrids"
|
125
126
|
|
126
127
|
if s.respond_to? :specification_version then
|
@@ -5,7 +5,7 @@ class Datagrid::Filters::BooleanEnumFilter < Datagrid::Filters::EnumFilter #:nod
|
|
5
5
|
|
6
6
|
def initialize(report, attribute, options = {}, &block)
|
7
7
|
options[:select] = [YES, NO].map do |key, value|
|
8
|
-
[I18n.t("datagrid.filters.eboolean.#{key.downcase}"), key]
|
8
|
+
[I18n.t("datagrid.filters.eboolean.#{key.downcase}", :default => key.downcase.capitalize), key]
|
9
9
|
end
|
10
10
|
super(report, attribute, options, &block)
|
11
11
|
end
|
data/lib/datagrid/locale/en.yml
CHANGED
data/lib/datagrid/renderer.rb
CHANGED
@@ -365,6 +365,25 @@ describe Datagrid::Helper do
|
|
365
365
|
)
|
366
366
|
end
|
367
367
|
end
|
368
|
+
|
369
|
+
it "should escape html" do
|
370
|
+
entry.update_attributes!(:name => "<div>hello</div>")
|
371
|
+
expect(subject.datagrid_rows(grid, [entry], :columns => [:name])).to equal_to_dom(<<-HTML)
|
372
|
+
<tr class=""><td class="name"><div>hello</div></td></tr>
|
373
|
+
HTML
|
374
|
+
end
|
375
|
+
|
376
|
+
it "should not escape safe html" do
|
377
|
+
entry.update_attributes!(:name => "<div>hello</div>")
|
378
|
+
grid.column(:safe_name) do |model|
|
379
|
+
model.name.html_safe
|
380
|
+
end
|
381
|
+
expect(subject.datagrid_rows(grid, [entry], :columns => [:safe_name])).to equal_to_dom(<<-HTML)
|
382
|
+
<tr class=""><td class="safe_name"><div>hello</div></td></tr>
|
383
|
+
HTML
|
384
|
+
|
385
|
+
end
|
386
|
+
|
368
387
|
end
|
369
388
|
|
370
389
|
describe ".datagrid_order_for" do
|
@@ -374,8 +393,8 @@ describe Datagrid::Helper do
|
|
374
393
|
scope { Entry }
|
375
394
|
column(:category)
|
376
395
|
end
|
377
|
-
|
378
|
-
expect(subject.datagrid_order_for(
|
396
|
+
object = OrderedGrid.new(:descending => true, :order => :category)
|
397
|
+
expect(subject.datagrid_order_for(object, object.column_by_name(:category))).to equal_to_dom(<<-HTML)
|
379
398
|
<div class="order">
|
380
399
|
<a href="/location?ordered_grid%5Bdescending%5D=false&ordered_grid%5Border%5D=category" class="asc">↑</a>
|
381
400
|
<a href="/location?ordered_grid%5Bdescending%5D=true&ordered_grid%5Border%5D=category" class="desc">↓</a>
|
@@ -398,8 +417,8 @@ describe Datagrid::Helper do
|
|
398
417
|
scope { Entry }
|
399
418
|
filter(:category)
|
400
419
|
end
|
401
|
-
|
402
|
-
expect(subject.datagrid_form_for(
|
420
|
+
object = FormForGrid.new(:category => "hello")
|
421
|
+
expect(subject.datagrid_form_for(object, :url => "/grid")).to match_css_pattern(
|
403
422
|
"form.datagrid-form.form_for_grid[action='/grid']" => 1,
|
404
423
|
"form input[name=utf8]" => 1,
|
405
424
|
"form .filter label" => "Category",
|
@@ -482,6 +501,7 @@ describe Datagrid::Helper do
|
|
482
501
|
"<b>#{e.name}</b>"
|
483
502
|
end
|
484
503
|
end
|
504
|
+
|
485
505
|
expect(subject.datagrid_value(report, :name, entry)).to eq("<b>Star</b>")
|
486
506
|
end
|
487
507
|
it "should support format in column" do
|
@@ -493,6 +513,7 @@ describe Datagrid::Helper do
|
|
493
513
|
end
|
494
514
|
end
|
495
515
|
end
|
516
|
+
expect(subject.datagrid_value(report, :name, entry)).to be_html_safe
|
496
517
|
expect(subject.datagrid_value(report, :name, entry)).to eq("<a href=\"/profile\">Star</a>")
|
497
518
|
end
|
498
519
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datagrid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bogdan Gusiev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -213,6 +213,7 @@ executables: []
|
|
213
213
|
extensions: []
|
214
214
|
extra_rdoc_files:
|
215
215
|
- LICENSE.txt
|
216
|
+
- Readme.markdown
|
216
217
|
files:
|
217
218
|
- ".document"
|
218
219
|
- ".rspec"
|
@@ -333,7 +334,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
333
334
|
version: '0'
|
334
335
|
requirements: []
|
335
336
|
rubyforge_project:
|
336
|
-
rubygems_version: 2.
|
337
|
+
rubygems_version: 2.4.5
|
337
338
|
signing_key:
|
338
339
|
specification_version: 4
|
339
340
|
summary: Ruby gem to create datagrids
|