Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add version to footer

  • Loading branch information...
commit feae4a42c9d1403ce6c622ee262932993acf8e2e 1 parent 85bb69c
David Cramer dcramer authored
5 src/zumanji/__init__.py
View
@@ -0,0 +1,5 @@
+try:
+ VERSION = __import__('pkg_resources') \
+ .get_distribution('zumanji').version
+except Exception, e:
+ VERSION = 'unknown'
4 src/zumanji/templates/zumanji/layout.html
View
@@ -1,4 +1,4 @@
-
+{% load zumanji_helpers %}
<!DOCTYPE html>
<html lang="en">
@@ -56,7 +56,7 @@
<footer id="footer">
<div class="container">
{% block footer %}
- <a href="https://github.com/disqus/zumanji">Zumanji</a> is Open Source Software | A tribute to <a href="http://twitter.com/zmanji">@zmanji</a>, the greatest <a href="http://code.disqus.com" style="text-decoration:line-through">DISQUS</a> intern ever.
+ Zumanji {% zumanji_version %} | <a href="https://github.com/disqus/zumanji">Zumanji</a> is Open Source Software | A tribute to <a href="http://twitter.com/zmanji">@zmanji</a>, the greatest <a href="http://code.disqus.com" style="text-decoration:line-through">DISQUS</a> intern ever.
{% endblock %}
</div>
</footer>
6 src/zumanji/templatetags/zumanji_helpers.py
View
@@ -8,6 +8,12 @@
register = template.Library()
+@register.simple_tag
+def zumanji_version():
+ import zumanji
+ return zumanji.VERSION
+
+
@register.filter
def format_historical(data):
result = []
Please sign in to comment.
Something went wrong with that request. Please try again.