Setup Header with versionsnumber and footer link to github

pull/6/head
JensDiemer 2020-10-17 21:58:59 +02:00
rodzic f850e1ec91
commit 5ca9272e7e
4 zmienionych plików z 38 dodań i 1 usunięć

Wyświetl plik

@ -0,0 +1,5 @@
from inventory import __version__
def inventory_version_string(request):
return {"version_string": f"v{__version__}"}

Wyświetl plik

@ -0,0 +1,10 @@
#footer {
text-align: center;
font-size: 0.8em;
background: #eee;
border-top: 1px solid #555;
}
#footer p, #footer a {
line-height: 0.3em;
color: #333;
}

Wyświetl plik

@ -71,7 +71,7 @@ MIDDLEWARE = (
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
"DIRS": [str(__Path(BASE_PATH, 'inventory_project', 'templates'))],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
@ -79,6 +79,7 @@ TEMPLATES = [
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'inventory.context_processors.inventory_version_string',
],
},
},

Wyświetl plik

@ -0,0 +1,21 @@
{% extends "admin/base.html" %}
{% load i18n static %}
{% block extrahead %}{{ block.super }}
<meta name="google" content="notranslate">
<link rel="stylesheet" type="text/css" href="{% static 'inventory.css' %}">
{% endblock %}
{% block title %}{{ title }} | PyInventory {{ version_string }}{% endblock %}
{% block branding %}
<h1 id="site-name">
<a href="{% url 'admin:index' %}">PyInventory {{ version_string }}</a>
</h1>
{% endblock %}
{% block nav-global %}{% endblock %}
{% block footer %}<div id="footer">
<a href="https://github.com/jedie/PyInventory">https://github.com/jedie/PyInventory</a>
</div>{% endblock %}