Settings for server; added version, and refined user page

svn: r18308
This commit is contained in:
Doug Blank 2011-10-13 00:41:27 +00:00
parent f7afdc9f6e
commit df4f26e117
3 changed files with 39 additions and 7 deletions

View File

@ -61,7 +61,7 @@
<div id="footer">
{% block footer %}
<p id="createdate">
Gramps Connect, tools for genealogy collaborations
Gramps Connect, version {{gramps_version}}.
</p>
<p id="copyright">&copy; 2009-2011 <a href="http://www.gramps-project.org/">www.gramps-project.org</a>
</p>

View File

@ -8,12 +8,30 @@
<p id="description">Details for <b>{{user.first_name}} {{user.last_name}}</b> ({{user.username}}):</p>
<p id="description">
<ul>
<li>User name: <b>{{user.username}}</b></li>
<li>Email: <b><a href="mailto:{{user.email}}">{{user.email}}></a></b></li>
<li>Superuser?: <b>{{user.is_superuser}}</b></li>
<li>Last login: <b>{{user.last_login}}</b></li>
</ul>
<table>
<tr>
<td width="30%">User name: </td><td><em>{{user.username}}</em></td>
</tr>
<tr>
<td>Email: </td><td><a href="mailto:{{user.email}}"><em>{{user.email}}</a></em></td>
</tr>
<tr>
<td>Type: </td>
<td>
{% if user.is_superuser %}
<em>Administrator</em>
{% else %}
<em>User</em>
{% endif %}
</td>
</tr>
<tr>
<td>Last login: </td><td><em>{{user.last_login}}</em></td>
</tr>
</table>
</p>
{% endblock %}

View File

@ -63,6 +63,19 @@ VIEWS = [(_('People'), 'person', Name),
(_('Tags'), 'tag', Tag),
]
def get_version():
#Makefile:VERSIONSTRING = 3.4.0-0.SVN18300
version = "trunk.SVN"
try:
fp = file("/usr/local/wsgi/trunk//Makefile")
except:
return version
for line in fp:
if line.startswith("VERSIONSTRING"):
junk, version = [item.strip() for item in line.split("=", 1)]
break
return version
def context_processor(request):
"""
This function is executed before template processing.
@ -75,6 +88,7 @@ def context_processor(request):
else:
context["css_theme"] = "Web_Mainz.css"
# Other things for all environments:
context["gramps_version"] = get_version()
context["views"] = VIEWS
context["True"] = True
context["False"] = False