Assets: Display similar assets based on tags

Experimental.
This commit is contained in:
2018-09-16 06:29:06 +02:00
parent 85e5cb4f71
commit 842ddaeab0
2 changed files with 26 additions and 6 deletions

View File

@@ -43,6 +43,7 @@
@extend .w-100
@extend .flex-row
flex: initial
flex-wrap: wrap
max-width: 100%
.card-img-top

View File

@@ -25,7 +25,6 @@
| {{ node | markdowned('description') }}
| {% endif %}
| {# DETAILS #}
section.node-details-meta.pl-4.pr-2.py-2.border-bottom
ul.list-unstyled.m-0
@@ -114,12 +113,32 @@
| {% endif %}
| {% endblock node_details %}
.container-fluid
.row
| {% block node_comments %}
.col-md-8.col-sm-12
#comments-embed
.comments-list-loading
i.pi-spin
| {% endblock node_comments %}
| {% block node_comments %}
#comments-embed
.comments-list-loading
i.pi-spin
| {% endblock node_comments %}
| {% if node.properties.tags %}
.col-md-4.d-none.d-lg-block
script(src="{{ url_for('static_cloud', filename='assets/js/tagged_assets.min.js') }}")
script.
$(function() {
$('.js-asset-list').loadTaggedAssets(4, 0);
})
.tagged-similar.p-3
h6 Similar assets
| {% for tag in node.properties.tags[:3] %}
| {% if loop.index < 4 %}
.card-deck.card-padless.card-deck-vertical.mx-0(
class="js-asset-list",
data-asset-tag="{{ tag }}")
| {% endif %}
| {% endfor %}
| {% endif %}
| {% include 'nodes/custom/_scripts.html' %}