Commit 556f3971 authored by Lukas Böhm's avatar Lukas Böhm
Browse files

better presetation of date and size

parent 091a970e
{% extends "Base.html" %}
{% macro print_size(b) %}
{% if b < 1024*1024*1 %}
(&lt;1 MB)
{% else %}
({{ b // (1024*1024) }} MB)
{% endif %}
{% endmacro %}
{% block page %}
<!-- Navbar -->
<div class="d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 bg-white border-bottom shadow-sm">
......@@ -20,6 +28,7 @@
<!-- end actual content -->
</div>
<!-- Footer -->
<footer class="pt-4 my-md-5 pt-md-5 border-top">
<div class="footer-copyright text-center py-3">
......
......@@ -15,9 +15,13 @@
<div class="card mb-4 shadow-sm text-center">
<div class="card-header">
<h4 class="my-0 font-weight-normal">{{ up.name }}</h4>
<p>verbleibende Downloads: {{ up.download_limit }}</p>
<p>verfügbar bis: {{ up.expires }}</p>
<h4 class="my-0 font-weight-normal">{{ up.name }} {{ print_size(up.files|sum(attribute='filesize')) }}</h4>
{% if up.download_limit %}
<p>Verbleibende Downloads: {{ up.download_limit }}</p>
{% endif %}
{% if up.expires %}
<p>Verfügbar bis: {{ up.expires.strftime('%d.%m.%Y - %H:%M:%S') }}</p>
{% endif %}
</div>
<div class="card-body">
......
......@@ -20,19 +20,29 @@
<div class="row">
{% for item in row %}
<div class="col md-4 my-4">
<div class="border rounded p-4 h-100">
<h3 class="mb-4 font-weight-normal">{{ item.name }}</h3>
<div class="border rounded p-4 h-100 shadow-sm">
<h3 class="mb-4 font-weight-normal">{{ item.name }} {{ print_size(item.files|sum(attribute='filesize')) }}</h3>
<p class="lead">
{{ len(item.files) }} Dateien
{% with c = len(item.files) %}
{% if c==1 %}
{{ c }} Datei
{% else %}
{{ c }} Dateien
{% endif %}
{% endwith %}
</p>
<p class="card-text">
{% if item.download_limit %}
<small class="text-muted">
Downloads verbleibend: {{ item.download_limit }},
</small>
<br>
{% endif %}
{% if item.expires %}
<small class="text-muted">
Verfügbar bis: {{ item.expires }}
Verfügbar bis: {{ item.expires.strftime('%d.%m.%Y - %H:%M:%S') }}
</small>
{% endif %}
</p>
<a href="{{ url_for('download', share_id=item.id) }}">
<button class="btn btn-lg btn-primary" type="button">
......@@ -51,4 +61,4 @@
</p>
</div>
{% endif %}
{% endblock content %}
\ No newline at end of file
{% endblock content %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment