feat(footer): add commit version in footer
This commit is contained in:
parent
bbd3eff9dc
commit
4be392e35f
4 changed files with 20 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
{% load version %}
|
||||||
|
|
||||||
<footer class="uk-padding-remove-bottom">
|
<footer class="uk-padding-remove-bottom">
|
||||||
<div class="uk-text-center uk-padding uk-padding-remove-bottom uk-flex">
|
<div class="uk-text-center uk-padding uk-padding-remove-bottom uk-flex">
|
||||||
|
@ -10,9 +11,10 @@
|
||||||
<a class="uk-text-small uk-button-link" href="https://git.gnous.eu/Romain">Romain J.</a>
|
<a class="uk-text-small uk-button-link" href="https://git.gnous.eu/Romain">Romain J.</a>
|
||||||
|
|
||||||
<span class="uk-text-small uk-text-muted"> | {% trans "Fait avec" %} </span>
|
<span class="uk-text-small uk-text-muted"> | {% trans "Fait avec" %} </span>
|
||||||
<a href="http://getuikit.com" target="_blank" class="uk-text-small uk-button-link">
|
<a href="http://getuikit.com" target="_blank" class="uk-text-small uk-button-link"><span data-uk-icon="uikit" class="uk-icon"></span></a>
|
||||||
<span data-uk-icon="uikit" class="uk-icon"></span>
|
|
||||||
</a>
|
<span class="uk-text-small uk-text-muted"> | Version: </span>
|
||||||
|
<a href="https://git.gnous.eu/gnouseu/gnousdoteu/src/commit/{% version 'long' %}" target="_blank" class="uk-text-small uk-button-link">{% version 'short' %}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-float-right">
|
<div class="uk-float-right">
|
||||||
<noscript>
|
<noscript>
|
||||||
|
|
0
apps/gnous_eu/templatetags/__init__.py
Normal file
0
apps/gnous_eu/templatetags/__init__.py
Normal file
15
apps/gnous_eu/templatetags/version.py
Normal file
15
apps/gnous_eu/templatetags/version.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
from django import template
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
register = template.Library()
|
||||||
|
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def version(size):
|
||||||
|
command = ['git', 'rev-parse']
|
||||||
|
if size == 'short':
|
||||||
|
command += ['--short', 'HEAD']
|
||||||
|
else:
|
||||||
|
command += ['HEAD']
|
||||||
|
|
||||||
|
return subprocess.check_output(command).decode()
|
|
@ -2,7 +2,6 @@ from django.http import HttpResponse, HttpRequest
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.core.paginator import Paginator
|
from django.core.paginator import Paginator
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.utils import translation
|
|
||||||
|
|
||||||
from apps.gnous_eu.models import Service
|
from apps.gnous_eu.models import Service
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue