From 9175203fb13e753e077629bd9c9c5fd95dcefcab Mon Sep 17 00:00:00 2001 From: Ross Poulton Date: Mon, 2 May 2011 22:32:51 +0000 Subject: [PATCH] Migrate charts to jqPlot. Needs a bit of clean-up, especially separating out date & non-date reports. --- .../templates/helpdesk/report_output.html | 75 ++++++++++++++++++- helpdesk/views/staff.py | 4 + 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/helpdesk/templates/helpdesk/report_output.html b/helpdesk/templates/helpdesk/report_output.html index 50ed6acb..34bfaf87 100644 --- a/helpdesk/templates/helpdesk/report_output.html +++ b/helpdesk/templates/helpdesk/report_output.html @@ -2,6 +2,16 @@ {% block helpdesk_title %}{% trans "Reports & Statistics" %}{% endblock %} +{% block helpdesk_head %} + + + + + + + +{% endblock %} + {% block helpdesk_body %}

{% trans "Reports & Statistics" %}

@@ -12,6 +22,69 @@ {% for f in d %}{{ f }}{% endfor %}{% endfor %} -{% if chart %}{% endif %} +
+{% ifequal charttype "date" %} + +{% endifequal %} +{% ifequal charttype "bar" %} + +{% endifequal %} + + {% endblock %} diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py index a30875d3..ec0c8f7e 100644 --- a/helpdesk/views/staff.py +++ b/helpdesk/views/staff.py @@ -896,10 +896,13 @@ def run_report(request, report): if report in ('queuemonth', 'usermonth'): chart_url = line_chart([columns] + data) + charttype = 'date' elif report in ('queuestatus', 'queuepriority', 'userstatus', 'userpriority'): chart_url = bar_chart([columns] + data) + charttype = 'bar' else: chart_url = '' + charttype = '' return render_to_response('helpdesk/report_output.html', RequestContext(request, { @@ -907,6 +910,7 @@ def run_report(request, report): 'data': data, 'chart': chart_url, 'title': title, + 'charttype': charttype, })) run_report = staff_member_required(run_report)