mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-05-20 01:10:45 +02:00
Implement suggestion from Issue #103: Show SVN revision in the footer
for logged-in users. Thanks to Andreas Kotowicz for the suggestion.
This commit is contained in:
parent
c866af467a
commit
1e7125fb8d
@ -28,7 +28,7 @@
|
|||||||
{% block helpdesk_body %}{% endblock %}
|
{% block helpdesk_body %}{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
<div id='footer'>
|
<div id='footer'>
|
||||||
<p>{% trans "Powered by <a href='http://www.jutdahelpdesk.com/'>Jutda Helpdesk</a>." %} <a href='{% url helpdesk_rss_index %}'><img src='{{ MEDIA_URL }}helpdesk/rss_icon.png' width='14' height='14' alt='{% trans "RSS Icon" %}' title='{% trans "RSS Feeds" %}' border='0' />{% trans "RSS Feeds" %}</a> <a href='{% url helpdesk_api_help %}'>{% trans "API" %}</a> <a href='{% url helpdesk_user_settings %}'>{% trans "User Settings" %}</a> {% if user.is_superuser %}<a href='{% url helpdesk_system_settings %}'>{% trans "System Settings" %}</a>{% endif %}</p>
|
<p>{% trans "Powered by <a href='http://www.jutdahelpdesk.com/'>Jutda Helpdesk</a>." %} {% if user.is_staff %}{% load svn_revision %}{% helpdesk_svn_revision %}{% endif %} <a href='{% url helpdesk_rss_index %}'><img src='{{ MEDIA_URL }}helpdesk/rss_icon.png' width='14' height='14' alt='{% trans "RSS Icon" %}' title='{% trans "RSS Feeds" %}' border='0' />{% trans "RSS Feeds" %}</a> <a href='{% url helpdesk_api_help %}'>{% trans "API" %}</a> <a href='{% url helpdesk_user_settings %}'>{% trans "User Settings" %}</a> {% if user.is_superuser %}<a href='{% url helpdesk_system_settings %}'>{% trans "System Settings" %}</a>{% endif %}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% include "helpdesk/debug.html" %}
|
{% include "helpdesk/debug.html" %}
|
||||||
|
16
templatetags/svn_revision.py
Normal file
16
templatetags/svn_revision.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from django import template
|
||||||
|
from django.utils.version import get_svn_revision
|
||||||
|
import helpdesk
|
||||||
|
|
||||||
|
def svn_revision(parser, token):
|
||||||
|
path = helpdesk.__path__[0]
|
||||||
|
return SVNRevisionNode(path)
|
||||||
|
|
||||||
|
class SVNRevisionNode(template.Node):
|
||||||
|
def __init__(self, path):
|
||||||
|
self.path = path
|
||||||
|
def render(self, context):
|
||||||
|
return get_svn_revision(self.path)
|
||||||
|
|
||||||
|
register = template.Library()
|
||||||
|
register.tag('helpdesk_svn_revision', svn_revision)
|
Loading…
Reference in New Issue
Block a user