Compare commits
2 commits
26f39fec1e
...
69807d034e
| Author | SHA1 | Date | |
|---|---|---|---|
| 69807d034e | |||
| 5cd80b7270 |
3 changed files with 17 additions and 1 deletions
|
|
@ -65,6 +65,8 @@
|
|||
<div class="float-end">
|
||||
<p>
|
||||
Crafted with <span class="text-danger"><i class="bi bi-heart-fill icon-mid"></i></span> in Zurich
|
||||
{% load version_tags %}
|
||||
- {% get_version_or_env %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{% extends "frontend/base.html" %}
|
||||
{% load i18n static %}
|
||||
{% block html_title %}
|
||||
{{ object.name }} {% translate "Dashboard" %}
|
||||
{% translate "Dashboard" %} for {{ object.name }}
|
||||
{% endblock html_title %}
|
||||
{% block page_title %}{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
|||
14
src/servala/frontend/templatetags/version_tags.py
Normal file
14
src/servala/frontend/templatetags/version_tags.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import os
|
||||
from django import template
|
||||
from servala.__about__ import __version__
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
||||
@register.simple_tag
|
||||
def get_version_or_env():
|
||||
"""Return version number in production, environment name otherwise."""
|
||||
env = os.environ.get('SERVALA_ENVIRONMENT', 'development')
|
||||
if env == 'production':
|
||||
return __version__
|
||||
return env
|
||||
Loading…
Add table
Add a link
Reference in a new issue