Mercurial > hg > ltpdarepo
view src/ltpdarepo/templates/activity.html @ 135:57dbb265a02a
Make activity view to work.
author | Daniele Nicolodi <daniele@grinta.net> |
---|---|
date | Fri, 14 Oct 2011 22:02:41 +0200 |
parents | c812c3020b63 |
children | 66b8360a41c9 |
line wrap: on
line source
{% extends "layout.html" %} {% block title %}{{ database.id }}{% endblock %} {% block body %} <h2>Database «{{ database.id }}»</h2> <p class="discrete">{{ database.description }}</p> <p class="discrete">Objects submitted per day in <em>{{ curr.strftime('%B %Y') }}</em></p> <div class="wrapper"> <div class="monthes wrapper"> <a title="{{ prev.strftime('%B %Y') }}" href="{{ url_for('activity.activity', database=database.id, date=prev) }}">prev</a> <a title="{{ next.strftime('%B %Y') }}" href="{{ url_for('activity.activity', database=database.id, date=next) }}">next</a> <a href="{{ url_for('activity.activity', database=database.id) }}">today</a> </div> </div> <div class="activity" style=""> <table> <tr> {% set nmax = 300 %} {% for day, num in activity %} {% set height = num * 300 / nmax %} <td class="bars" style="height: 300px;"> <span class="num">{{ num }}</span><div style="height: {{height}}px;"> </div> </td> {% endfor %} </tr> <tr> {% for when, num in activity %} <td><a class="day" href="{{ url_for('browse.query', database=database.id, field=('submitted', 'submitted'), operator=('>', '<'), value=(when, when + dt)) }}">{{ when.strftime('%d') }}</a></td> {% endfor %} </tr> </table> </div> {% endblock %}