mirror of
https://github.com/Crocmagnon/charasheet.git
synced 2024-11-22 22:48:03 +01:00
parent
6abf6bec8b
commit
0fc839a4e8
5 changed files with 49 additions and 7 deletions
2
.github/workflows/publish.yaml
vendored
2
.github/workflows/publish.yaml
vendored
|
@ -48,4 +48,4 @@ jobs:
|
||||||
max_attempts: 5
|
max_attempts: 5
|
||||||
retry_wait_seconds: 2
|
retry_wait_seconds: 2
|
||||||
warning_on_retry: false
|
warning_on_retry: false
|
||||||
command: curl -sSL --fail -m 10 https://charasheet.augendre.info
|
command: curl -sSL --fail -m 10 https://charasheet.augendre.info | grep $GITHUB_SHA > /dev/null
|
||||||
|
|
5
src/charasheet/context_processors.py
Normal file
5
src/charasheet/context_processors.py
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
|
|
||||||
|
def app(request):
|
||||||
|
return settings.APP
|
|
@ -109,6 +109,7 @@ TEMPLATES = [
|
||||||
"django.template.context_processors.request",
|
"django.template.context_processors.request",
|
||||||
"django.contrib.auth.context_processors.auth",
|
"django.contrib.auth.context_processors.auth",
|
||||||
"django.contrib.messages.context_processors.messages",
|
"django.contrib.messages.context_processors.messages",
|
||||||
|
"charasheet.context_processors.app",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -223,3 +224,26 @@ SERVER_EMAIL = "charasheet@mg.augendre.info"
|
||||||
|
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
||||||
|
|
||||||
|
APP = {
|
||||||
|
"build": {
|
||||||
|
"date": "latest-date",
|
||||||
|
"commit": "latest-commit",
|
||||||
|
"describe": "latest-describe",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try:
|
||||||
|
with open("/app/git/build-date") as f:
|
||||||
|
APP["build"]["date"] = f.read().strip()
|
||||||
|
except Exception: # noqa: S110
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
with open("/app/git/git-commit") as f:
|
||||||
|
APP["build"]["commit"] = f.read().strip()
|
||||||
|
except Exception: # noqa: S110
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
with open("/app/git/git-describe") as f:
|
||||||
|
APP["build"]["describe"] = f.read().strip()
|
||||||
|
except Exception: # noqa: S110
|
||||||
|
pass
|
||||||
|
|
|
@ -23,13 +23,16 @@
|
||||||
{% block head_end %}
|
{% block head_end %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body class="d-flex flex-column min-vh-100 mb-0">
|
||||||
{% include "common/navbar.html" %}
|
{% include "common/navbar.html" %}
|
||||||
<div class="container">
|
<main>
|
||||||
{% bootstrap_messages %}
|
<div class="container">
|
||||||
{% block content %}
|
{% bootstrap_messages %}
|
||||||
{% endblock %}
|
{% block content %}
|
||||||
</div>
|
{% endblock %}
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
{% include "common/footer.html" %}
|
||||||
|
|
||||||
<script src="{% static 'vendor/htmx-1.8.2.min.js' %}" defer></script>
|
<script src="{% static 'vendor/htmx-1.8.2.min.js' %}" defer></script>
|
||||||
{% django_htmx_script %}
|
{% django_htmx_script %}
|
||||||
|
|
10
src/common/templates/common/footer.html
Normal file
10
src/common/templates/common/footer.html
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<footer class="bg-light mt-auto">
|
||||||
|
<div class="container text-muted pt-2 pb-2 d-flex justify-content-between">
|
||||||
|
<span>
|
||||||
|
Version : {{ build.describe }} • {{ build.date }}
|
||||||
|
</span>
|
||||||
|
<div>
|
||||||
|
<a href="https://github.com/Crocmagnon/charasheet" class="text-muted"><i class="fa-brands fa-github"></i></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</footer>
|
Loading…
Reference in a new issue