graph_starter 0.13.12 → 0.13.13

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: 429a681a1194bb9e69fb6dd06d6d492c270f9cd7
4
- data.tar.gz: 55ec5e854587e8568c6a0fde9e09553cd34b0270
3
+ metadata.gz: 43d3aef2e1fc99b2d80482e90d2d6d95b2ea43f0
4
+ data.tar.gz: 269208077d5bb8887003b4b944dfec3d4d1573b7
5
5
  SHA512:
6
- metadata.gz: 766a154c85156db13d4e1b3e95c3428beae340ea66c60839685c8fae3fdbce75e01d0aebbb86aac7417b8b63f97b4d3e0dd7026342f2cf51e6ded2e95eda1dcc
7
- data.tar.gz: 8fdf41d94d916ae841c7e49adcc4a06cb9c09a99f5c807c10c36231c87c676a957d91cb3e46cb7c84d81c870851bc2f8782fb351e8c8911a66b5b3b7da53bfa3
6
+ metadata.gz: 6ec08711a01a8ae59d27e957a6de53a209987af803f4950ece0758e66bde42a8d45e05625c365d624a3b3498d251a09f97652939b4008316f7a2438f6451652f
7
+ data.tar.gz: 731f10fbe24613650cfcfedb0c11c1eada17d36bf4e86ccdd9d14ba4c58162bc96155a3de66c58ea74eb6a139c1866f4452601552171f0f8c33d769f2b3e09a6
@@ -16,7 +16,7 @@
16
16
  @import "semantic-ui/elements/loader";
17
17
  @import "semantic-ui/elements/segment";
18
18
 
19
- //@import "semantic-ui/collections/form";
19
+ @import "semantic-ui/collections/form";
20
20
  @import "semantic-ui/collections/grid";
21
21
  @import "semantic-ui/collections/menu";
22
22
  @import "semantic-ui/collections/message";
@@ -6,6 +6,12 @@ module GraphStarter
6
6
  def index
7
7
  @all_assets = asset_set(:asset, nil)
8
8
  @assets = asset_set.to_a
9
+
10
+ @category_images = Asset.where(id: @assets.map(&:categories).flatten.map(&:id))
11
+ .query_as(:asset)
12
+ .match('(asset)-[:HAS_IMAGE]->(image:Image)')
13
+ .pluck('asset.uuid', :image)
14
+ @category_images = Hash[*@category_images.flatten]
9
15
  end
10
16
 
11
17
  def search
@@ -17,7 +17,7 @@
17
17
  .ui.relaxed.divided.list
18
18
  - categories[0,2].each do |category|
19
19
  .item
20
- = render partial: 'graph_starter/assets/icon', locals: {asset: category}
20
+ = render partial: 'graph_starter/assets/icon', locals: {asset: category, image: @category_images[category.id]}
21
21
  .content
22
22
  = link_to category.name, asset_path(category)
23
23
  - if categories.size > 2
@@ -1,5 +1,11 @@
1
- - if (asset.class.has_images? || asset.class.has_image?) && asset.first_image_source_url.present?
2
- = image_tag asset.first_image_source_url, class: 'ui avatar image'
1
+ - image_url = nil
2
+ - if defined?(image)
3
+ - image_url = image.source.url if defined?(image) && image.present?
4
+ - elsif (asset.class.has_images? || asset.class.has_image?) && asset.first_image_source_url.present?
5
+ - image_url = asset.first_image_source_url
6
+
7
+ - if image_url
8
+ = image_tag image_url, class: 'ui avatar image'
3
9
  - else
4
10
  i class="#{asset.class.icon_class || 'folder'} large icon"
5
11
 
@@ -1,3 +1,3 @@
1
1
  module GraphStarter
2
- VERSION = "0.13.12"
2
+ VERSION = "0.13.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graph_starter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.12
4
+ version: 0.13.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Underwood