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 +4 -4
- data/app/assets/stylesheets/graph_starter/application.scss +1 -1
- data/app/controllers/graph_starter/assets_controller.rb +6 -0
- data/app/views/graph_starter/assets/_card.html.slim +1 -1
- data/app/views/graph_starter/assets/_icon.html.slim +8 -2
- data/lib/graph_starter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43d3aef2e1fc99b2d80482e90d2d6d95b2ea43f0
|
4
|
+
data.tar.gz: 269208077d5bb8887003b4b944dfec3d4d1573b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
-
|
2
|
-
|
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
|
|