diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2014-10-20 20:40:42 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2014-10-20 20:40:42 +0200 |
commit | 57cdf8896f854de7ba573cfe8d5040155df1e656 (patch) | |
tree | 28c99961d82172cefbc1c2972789e7f647d05e63 /ishtar_common/views.py | |
parent | 2feb794529f3a99ff9ee5402803bafc935f45f72 (diff) | |
download | Ishtar-57cdf8896f854de7ba573cfe8d5040155df1e656.tar.bz2 Ishtar-57cdf8896f854de7ba573cfe8d5040155df1e656.zip |
Dashboard: many improvments on graph (refs #2075)
* by default graph is set by month
* data are reapeated in a table
* ability to save the graph in a file
* detail by department with a line by department + total
* add a legend
* ability to zoom on the graph
Diffstat (limited to 'ishtar_common/views.py')
-rw-r--r-- | ishtar_common/views.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ishtar_common/views.py b/ishtar_common/views.py index d20b8b2af..d15157eed 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -730,7 +730,11 @@ def dashboard_main_detail(request, item_name): 'ishtar/dashboards/dashboard_main_detail_users.html', dct, context_instance=RequestContext(request)) form = None - slicing, date_source, fltr = 'year', None, {} + slicing, date_source, fltr, show_detail = 'year', None, {}, False + if (item_name == 'files' and \ + 'archaeological_files' in settings.INSTALLED_APPS):\ + #or item_name == 'operations': + slicing = 'month' if item_name in DASHBOARD_FORMS: if request.method == 'POST': form = DASHBOARD_FORMS[item_name](request.POST) @@ -739,13 +743,16 @@ def dashboard_main_detail(request, item_name): fltr = form.get_filter() if hasattr(form, 'get_date_source'): date_source = form.get_date_source() + if hasattr(form, 'get_show_detail'): + show_detail = form.get_show_detail() else: form = DASHBOARD_FORMS[item_name]() lbl, dashboard = None, None if item_name == 'files' and \ 'archaeological_files' in settings.INSTALLED_APPS: from archaeological_files.models import File - dashboard_kwargs = {'slice':slicing, 'fltr':fltr,} + dashboard_kwargs = {'slice':slicing, 'fltr':fltr, + 'show_detail':show_detail} # date_source is only relevant when the form has set one if date_source: dashboard_kwargs['date_source'] = date_source |