graph_starter 0.15.1 → 0.15.2

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: c6b7db731cf371ebb4d6b91b39c65a0603757eac
4
- data.tar.gz: 7009f0d57eef64b5f853d1895d637f118d77972d
3
+ metadata.gz: bf562575bad5f8bfbd744adfb51389266f72657c
4
+ data.tar.gz: 01dca4a00e774184bc30aaa2b91f9df559402d94
5
5
  SHA512:
6
- metadata.gz: 9d2a1da8da789aaa98dc2b0cd4bfc727d61a51336022b38a406e745f89c13a620ed50d1f25c76a89b047c3829e3b52675c964114b9f3b2edc8f472ea73d8201b
7
- data.tar.gz: 983636ee38b0ea3828e8b9d7846660b958d44a54f218c0720871db8f7a078ae7643ea8a23966cf1309464193d7baf7687035385cd9fd8c490edd827edf0010c6
6
+ metadata.gz: 83e7ce8344e46f97b980e494349144e11a99a3365194145864ed483c8b3813fc949a92d04c392bafea111c699cdb8eaf0a47327e4c52690449f1fc15c2e6ca72
7
+ data.tar.gz: 3a0663eec5a1de5ff98ba85df910eac67a9fc6578152a3ba82c67572e03cf43387ab669aacc75370bbbf94fe4f8d3a8afa74ed96d1287dee3a9bb87121910ff7
@@ -149,11 +149,16 @@ module GraphStarter
149
149
  end
150
150
 
151
151
  def safe_title
152
+ self.class.sanitize_title(title)
153
+ end
154
+
155
+ def self.sanitize_title(title)
152
156
  sanitizer = Rails::Html::WhiteListSanitizer.new
153
157
 
154
158
  sanitizer.sanitize(title, tags: %w(b em i strong)).try(:html_safe)
155
159
  end
156
160
 
161
+
157
162
  def self.body_property(property_name = nil)
158
163
  if property_name.nil?
159
164
  @body_property
@@ -19,7 +19,7 @@
19
19
  .item
20
20
  = render partial: 'graph_starter/assets/icon', locals: {asset: category, image: (@category_images || {})[category.id]}
21
21
  .content
22
- = link_to category.name, asset_path(category)
22
+ = link_to category.safe_title, asset_path(category)
23
23
  - if categories.size > 2
24
24
  .item
25
25
  i.ellipsis.horizontal.large.icon
@@ -27,7 +27,7 @@
27
27
  label = name.to_s.humanize
28
28
 
29
29
  - field_name = (association.type == :has_many ? "#{name.to_s.singularize}_ids" : "#{name}_id")
30
- - options = target_class.as(:n).pluck(target_class.name_property, target_class.id_property_name).sort_by {|pair| pair.inspect.downcase }
30
+ - options = target_class.as(:n).pluck(target_class.name_property, target_class.id_property_name).map {|title, _| [GraphStarter::Asset.sanitize_title(title), _] }.sort_by {|pair| pair.inspect.downcase }
31
31
 
32
32
  - html_options = {class: 'ui fluid search dropdown'}
33
33
  - html_options[:multiple] = '' if association.type == :has_many
@@ -1,3 +1,3 @@
1
1
  module GraphStarter
2
- VERSION = "0.15.1"
2
+ VERSION = "0.15.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graph_starter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Underwood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-02 00:00:00.000000000 Z
11
+ date: 2015-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails