Commits

Bela Hausmann  committed b51ee71

Display current revision details on about page

  • Participants
  • Parent commits ef9d9c0

Comments (0)

Files changed (2)

File profile/views.py

 # -*- coding: utf-8
+from subprocess import Popen, PIPE
 from django.utils.translation import ugettext as _
 from django.utils.simplejson.encoder import JSONEncoder
 from django.shortcuts import render_to_response,get_object_or_404
     """
     profile_count = Profile.objects.count()
 
+    revision = dict()
+    revision['i'] = Popen(['hg', 'identify', '-i'], stdout = PIPE).communicate()[0].strip()
+    revision['n'] = Popen(['hg', 'identify', '-n'], stdout = PIPE).communicate()[0].strip()
     return render_to_response('about.html',
             {
+                'revision': revision,
                 'profile_count':profile_count,
                 },
         context_instance=RequestContext(request))

File templates/about.html

     <li>{% blocktrans %}This website is made using the <a href="http://www.djangoproject.com" rel="external">Django</a> framework and the Django <em>gis</em> extensions.{% endblocktrans %}</li>
     <li>{% blocktrans %}Many thanks to the Official BETA tester and general 'Why doesn't this Work?!' guy <a href="http://gentoo-users.org/user/homunculus/">Homunculus</a>.{% endblocktrans %}</li>
     <li>{% trans "If you need to contact us, email us at " %}<a href="mailto:admin@gentoo-users.org">admin@gentoo-users.org</a>.</li>
+    <li>{% trans "Powered by " %} <a href="http://bitbucket.org/arcanum/genmap/">genmap</a> (<code>r{{ revision.n }}:{{ revision.i }}</code>)</li>
 </ul>
 
 {% endblock %}