aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pyaggr3g470r/templates/history.html2
-rwxr-xr-xrunserver.py8
2 files changed, 8 insertions, 2 deletions
diff --git a/pyaggr3g470r/templates/history.html b/pyaggr3g470r/templates/history.html
index 2d64da98..3b9412a3 100644
--- a/pyaggr3g470r/templates/history.html
+++ b/pyaggr3g470r/templates/history.html
@@ -7,7 +7,7 @@
{% if year == None %}
<li class="list-group-item"><a href="/history/{{ article }}">{{ article }}</a> : {{ articles_counter[article] }} articles</li>
{% elif month == None %}
- <li class="list-group-item"><a href="/history/{{ year }}/{{ article }}">{{ article }}</a> : {{ articles_counter[article] }} articles</li>
+ <li class="list-group-item"><a href="/history/{{ year }}/{{ article }}">{{ article | month_name }}</a> : {{ articles_counter[article] }} articles</li>
{% else %}
{% for article in articles %}
<li class="list-group-item">{{ article.date }} - <a href="/article/{{ article.id }}">{{ article.title | safe }}</a></li>
diff --git a/runserver.py b/runserver.py
index 2ced409f..156ae320 100755
--- a/runserver.py
+++ b/runserver.py
@@ -18,7 +18,7 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
+import calendar
from bootstrap import conf, application, db, populate_g
from flask.ext.babel import Babel
from flask.ext.babel import format_datetime
@@ -38,8 +38,14 @@ def allowed_file(filename):
babel = Babel(application)
+# Jinja filters
application.jinja_env.filters['datetime'] = format_datetime
+#@register.filter
+def month_name(month_number):
+ return calendar.month_name[month_number]
+application.jinja_env.filters['month_name'] = month_name
+
# Views
from flask.ext.restful import Api
from flask import g
bgstack15