Files
pillar/src/templates/nodes/view_base.pug

135 lines
3.5 KiB
Plaintext
Raw Normal View History

| {% block body %}
#node-container
#node-overlay
| {% block node_preview %}
| {% if node.picture %}
2018-04-05 16:46:57 +02:00
| {% if current_user.has_cap('subscriber') or node.permissions.world %}
2018-09-11 17:45:33 +02:00
section.node-preview.image.js-node-preview-image
img.node-preview-thumbnail(src="{{ node.picture.thumbnail('l', api=api) }}")
| {% else %}
| {% include 'nodes/custom/_node_preview_forbidden.html' %}
| {% endif %}
| {% endif %}
| {% endblock node_preview %}
| {% block node_details %}
2018-09-11 17:45:33 +02:00
| {# NAME #}
section.px-4
h4.pt-4.mb-3 {{node.name}}
| {# DESCRIPTION #}
| {% if node.description %}
2018-09-11 17:45:33 +02:00
.node-details-description
| {{ node | markdowned('description') }}
| {% endif %}
| {# DETAILS #}
2018-09-16 05:02:16 +02:00
section.node-details-meta.pl-4.pr-2.py-2.border-bottom
ul.list-unstyled.m-0
| {% if node.properties.license_type %}
2018-09-16 05:02:16 +02:00
li.px-2
a.node-details-license(
href="https://creativecommons.org/licenses/",
target="_blank",
title="{{ node.properties.license_type }} {% if node.properties.license_notes %}{{ node.properties.license_notes }}{% endif %}",
data-toggle="tooltip",
data-placement="top")
i(class="pi-license-{{ node.properties.license_type }}")
| {% endif %}
2018-09-11 17:45:33 +02:00
| {% if node.has_method('PUT') and (node.properties.status != 'published') %}
2018-09-16 05:02:16 +02:00
li.px-2(class="status-{{ node.properties.status }}")
2018-09-11 17:45:33 +02:00
| {{ node.properties.status | undertitle }}
| {% endif %}
2018-09-16 05:02:16 +02:00
li.px-2(title="Author")
2018-09-11 17:45:33 +02:00
| {{ node.user.full_name }}
| {{ node.user.badges.html|safe }}
2018-09-16 05:02:16 +02:00
li.px-2(
2018-09-11 17:45:33 +02:00
title="Created {{ node._created }} (updated {{ node._updated | pretty_date_time }})")
| {{ node._created | pretty_date }}
2018-09-11 17:45:33 +02:00
| {% if node.short_link %}
li.shared
a(href="{{ node.short_link }}")
i.pi-share
| Shared
| {% endif %}
2018-09-16 05:02:16 +02:00
li.ml-auto
2018-09-11 17:45:33 +02:00
| {% if node.file %}
2018-09-16 05:02:16 +02:00
li.px-2(title="File size")
2018-09-11 17:45:33 +02:00
| {{ node.file.length | filesizeformat }}
2018-09-16 05:02:16 +02:00
li.px-2.js-type(title="File format")
2018-09-11 17:45:33 +02:00
| {{ node.file.content_type }}
| {% endif %}
2018-09-11 17:45:33 +02:00
| {% if node.permissions.world %}
li.public(
data-toggle="tooltip",
data-placement="bottom",
title="Anybody can download. Share it!")
i.pi-lock-open
span Public
| {% endif %}
2018-09-11 17:45:33 +02:00
| {% block node_details_meta_extra %}{% endblock %}
li.download
| {% if (current_user.has_cap('subscriber') or node.permissions.world) and (node.file or node.properties.files) %}
| {% block node_download %}
a(
title="Download {{ node.properties.content_type | undertitle }}",
href="{{ node.file.link }}",
download="{{ node.file.filename }}")
button.btn.btn-sm.btn-outline-primary.px-3(type="button")
i.pi-download.pr-2
| Download
2018-09-11 17:45:33 +02:00
| {% endblock node_download %}
| {% elif current_user.has_cap('can-renew-subscription') %}
2018-09-16 05:02:16 +02:00
a.btn.btn-outline-primary(
2018-09-11 17:45:33 +02:00
title="Renew your subscription to download",
target="_blank",
href="/renew")
2018-09-16 05:02:16 +02:00
i.pi-heart.pr-2
2018-09-11 17:45:33 +02:00
| Renew Subscription
| {% elif current_user.is_authenticated %}
.btn.disabled
i.pi-lock
| Download
| {% else %}
a.btn(
title="Login to download {{ node.properties.content_type | undertitle }}",
href="{{ url_for('users.login') }}")
i.pi-lock
| Download
| {% endif %}
| {% endblock node_details %}
| {% block node_comments %}
#comments-embed
.comments-list-loading
i.pi-spin
| {% endblock node_comments %}
| {% include 'nodes/custom/_scripts.html' %}
| {% endblock %}
| {% block node_scripts %}{% endblock %}
| {% block footer_scripts %}
script.
// Generate analytics pageview
ga('send', 'pageview', location.pathname);
| {% endblock %}