Free assets: Assets should not be advertised as free if the user is a logged in subscriber.

This commit is contained in:
2018-10-04 17:44:08 +02:00
parent 879bcffc2b
commit 19fdc75e60
2 changed files with 3 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
| {% set node_type = asset.properties.content_type if asset.properties.content_type else asset.node_type %}
a.card.asset.card-image-fade.pr-0.mx-0.mb-2(
class="js-item-open {% if asset.permissions.world %}free{% endif %}",
class="js-item-open {% if asset.permissions.world and not current_user.has_cap('subscriber') %}free{% endif %}",
data-node_id="{{ asset._id }}",
title="{{ asset.name }}",
href='{{ url_for_node(node=asset) }}')

View File

@@ -133,7 +133,8 @@ section.node-details-meta.pl-4.pr-2.py-2.border-bottom
script(src="{{ url_for('static_cloud', filename='assets/js/tagged_assets.min.js') }}")
script.
$(function() {
$('.js-asset-list').loadTaggedAssets(4, 0);
let is_subscriber = {{ current_user.has_cap('subscriber')|string|lower }};
$('.js-asset-list').loadTaggedAssets(4, 0, is_subscriber);
})
.tagged-similar.p-3
h6 Similar assets