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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 22ba5c3d97717d9f5d236b7f8559346d8e2255ad
4
- data.tar.gz: 6f80355aafcb9f54870d42f458d8f8c4aa152cd2
3
+ metadata.gz: bdb4b360ee72ca1cb7506bcc9cce315dfd3b8088
4
+ data.tar.gz: 48bea2ce4e237383bc9dae59cf34a6e8df40e6b8
5
5
  SHA512:
6
- metadata.gz: 93798b31a87ed1c8f81e49da6293d996f3952f8db26eb387446f57d46c2507c00a78bd6e5fc6908c64b822f1cdfa175b13cdd875e3afb0021edba3f32c584c2a
7
- data.tar.gz: 296aa0e6501289e986a9a0de697f1c2ae0fd068e631c358ce8dad7f7edae2e45a40881512199a37492d936ed0166503bbc46766bc258c40eb96a264fc0388a9e
6
+ metadata.gz: 528d0971df683ae4bef8e677f54d0b4344500bd3a8a560863135908cad2c56966bc96acdbe46563527cd30469717c459c88e53619e0912df241886674ecede49
7
+ data.tar.gz: 3d510e71bef9a64f68b7f09c3afca21d60f3c4187fe1634e8b31ade014a3843370a67dcee9d87e02c1c9b81cbb3e065d932861ef4a45db826d2a08ab67ca7e09
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.5
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) %>"><%= datagrid_format_value(grid, column, asset) %></td>
3
+ <td class="<%= datagrid_column_classes(grid, column) %>"><%= datagrid_value(grid, column, asset) %></td>
4
4
  <% end %>
5
5
  </tr>
@@ -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 ruby lib
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.5"
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-01-21"
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.2.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
@@ -202,5 +202,3 @@ module Datagrid
202
202
 
203
203
  end
204
204
  end
205
-
206
-
@@ -23,10 +23,6 @@ en:
23
23
  range_format:
24
24
  "%{from_input}<span class=\"separator float\"> - </span>%{to_input}"
25
25
 
26
- eboolean:
27
- "yes": "Yes"
28
- "no": "No"
29
-
30
26
  xboolean:
31
27
  "yes": "Yes"
32
28
  "no": "No"
@@ -22,7 +22,7 @@ module Datagrid
22
22
  if url
23
23
  @template.link_to(value, url)
24
24
  else
25
- _safe(value)
25
+ value
26
26
  end
27
27
  end
28
28
 
@@ -1,6 +1,6 @@
1
+ # encoding: UTF-8
1
2
  require 'spec_helper'
2
3
 
3
-
4
4
  class MyFormBuilder
5
5
  include Datagrid::FormBuilder
6
6
  end
@@ -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">&lt;div&gt;hello&lt;/div&gt;</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
- grid = OrderedGrid.new(:descending => true, :order => :category)
378
- expect(subject.datagrid_order_for(grid, grid.column_by_name(:category))).to equal_to_dom(<<-HTML)
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&amp;ordered_grid%5Border%5D=category" class="asc">&uarr;</a>
381
400
  <a href="/location?ordered_grid%5Bdescending%5D=true&amp;ordered_grid%5Border%5D=category" class="desc">&darr;</a>
@@ -398,8 +417,8 @@ describe Datagrid::Helper do
398
417
  scope { Entry }
399
418
  filter(:category)
400
419
  end
401
- grid = FormForGrid.new(:category => "hello")
402
- expect(subject.datagrid_form_for(grid, :url => "/grid")).to match_css_pattern(
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.5
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-01-21 00:00:00.000000000 Z
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.2.2
337
+ rubygems_version: 2.4.5
337
338
  signing_key:
338
339
  specification_version: 4
339
340
  summary: Ruby gem to create datagrids