kopia lustrzana https://github.com/jedie/PyInventory
Setup Header with versionsnumber and footer link to github
rodzic
f850e1ec91
commit
5ca9272e7e
|
@ -0,0 +1,5 @@
|
|||
from inventory import __version__
|
||||
|
||||
|
||||
def inventory_version_string(request):
|
||||
return {"version_string": f"v{__version__}"}
|
|
@ -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;
|
||||
}
|
|
@ -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',
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
|
@ -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 %}
|
Ładowanie…
Reference in New Issue