Add display for snapshot files on homepage

This commit is contained in:
Edgar P. Burkhart 2022-12-21 14:09:38 +01:00
parent 4efc421f04
commit ba07636a85
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
2 changed files with 10 additions and 1 deletions

View File

@ -11,6 +11,7 @@
.table.col4 {grid-template-columns: repeat(4, auto)}
.table.col5 {grid-template-columns: repeat(5, auto)}
.table.col6 {grid-template-columns: repeat(6, auto)}
.table.col1-5 {grid-template-columns: min-content repeat(5, auto)}
.table.col1-6 {grid-template-columns: min-content repeat(6, auto)}
.table > div {

View File

@ -26,8 +26,9 @@
{% if snapshots %}
<h2>{% translate "Snapshots" %}</h2>
<div id="snapshots" class="table col5">
<div id="snapshots" class="table col1-5">
<div class="header">
<strong class="attach center"><i class="fa fa-paperclip"></i></strong>
<strong class="date center">{% translate "Date" %}</strong>
<strong class="value center">{% translate "Value" %}</strong>
<strong class="diff center">{% translate "Difference" %}</strong>
@ -36,6 +37,13 @@
</div>
{% for snap in snapshots %}
<div class="snapshot {% cycle 'w' 'g' %}">
<span class="attach center">
{% if snap.file %}
<a href="{{ snap.file.url }}">
<i class="fa fa-paperclip"></i>
</a>
{% endif %}
</span>
<span class="date num center">
<a href="{% url 'snapshot' snap.id %}">{{ snap.date|date:"Y-m-d" }}</a>
</span>