Show build time in bottom-right corner
All checks were successful
Build and push Docker image / build (push) Successful in 12s
Test / test (push) Successful in 16s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
marwin 2026-03-19 21:35:41 +01:00
parent b9c5f835f4
commit e1b18f392e
6 changed files with 23 additions and 0 deletions

View file

@ -38,3 +38,4 @@ jobs:
context: .
push: true
tags: fg.creamfresh.xyz/mrwnslz/diora-web:${{ steps.tag.outputs.tag }}
build-args: BUILD_TIME=${{ github.event.head_commit.timestamp }}

View file

@ -9,6 +9,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt gunicorn
ARG BUILD_TIME
ENV BUILD_TIME=${BUILD_TIME}
COPY . .
RUN python manage.py collectstatic --noinput && mkdir -p /app/data

View file

@ -0,0 +1,5 @@
from django.conf import settings
def build_info(request):
return {'BUILD_TIME': getattr(settings, 'BUILD_TIME', '')}

View file

@ -60,6 +60,7 @@ TEMPLATES = [
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'diora.context_processors.build_info',
],
},
},
@ -113,3 +114,5 @@ LASTFM_API_SECRET = os.environ.get('LASTFM_API_SECRET', '')
# Amazon affiliate
AMAZON_AFFILIATE_TAG = os.environ.get('AMAZON_AFFILIATE_TAG', 'diora-20')
AMAZON_AFFILIATE_ENABLED = os.environ.get('AMAZON_AFFILIATE_ENABLED', 'True') == 'True'
BUILD_TIME = os.environ.get('BUILD_TIME', '')

View file

@ -1587,3 +1587,13 @@ mark.reader-search-match.active { background:rgba(230,57,70,.7); }
/* Toast */
.reader-toast { position:fixed; bottom:calc(var(--bar-h) + 16px); left:50%; transform:translateX(-50%); background:var(--fg); color:var(--bg); padding:6px 14px; border-radius:var(--radius); font-size:13px; z-index:600; animation:toast-fade 2s ease forwards; pointer-events:none; }
@keyframes toast-fade { 0%,70%{opacity:1} 100%{opacity:0} }
.build-time {
position: fixed;
bottom: 4px;
right: 6px;
font-size: 0.65rem;
color: #444;
pointer-events: none;
z-index: 1;
}

View file

@ -48,6 +48,7 @@
{% block content %}{% endblock %}
</main>
{% if BUILD_TIME %}<span class="build-time">{{ BUILD_TIME|slice:":16"|cut:"T" }}</span>{% endif %}
<script src="/static/js/jszip.min.js"></script>
<script src="/static/js/pdf.min.js"></script>
{% block extra_js %}{% endblock %}