mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Ticket #61.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import os
|
||||
from django import template
|
||||
from mailng.lib import exec_cmd
|
||||
|
||||
register = template.Library()
|
||||
|
||||
@register.simple_tag
|
||||
def get_version():
|
||||
if os.path.isdir(".hg"):
|
||||
version = "dev-"
|
||||
code, output = exec_cmd("hg id -i")
|
||||
version += output.rstrip()
|
||||
return version
|
||||
elif os.path.exists("VERSION"):
|
||||
code, output = exec_cmd("cat VERSION")
|
||||
return output.rstrip()
|
||||
else:
|
||||
return "Unknown"
|
||||
@@ -1,4 +1,5 @@
|
||||
{% load i18n %}
|
||||
{% load libextras %}
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
@@ -21,7 +22,7 @@
|
||||
{% if error %}
|
||||
<div class="error"><p>{{ error }}</p></div>
|
||||
{% endif %}
|
||||
<h2>2010 - Version 0.7-dev</h2>
|
||||
<h2>{% now "Y" %} - Version {% get_version %}</h2>
|
||||
</div>
|
||||
<div id="test">
|
||||
<h3>{% trans "Welcome" %}</h3>
|
||||
|
||||
Reference in New Issue
Block a user