summaryrefslogtreecommitdiff
path: root/ishtar_common/views.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-04-07 10:47:39 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-04-07 10:47:39 +0200
commitda4af2ab5d105f6d2ce442b517e532b7570616e3 (patch)
treee433f02a5f75ccce6b9de8f6d79dfb23a4a9142e /ishtar_common/views.py
parente5ebf3169e52e5a425a56d7c908ba422969443de (diff)
downloadIshtar-da4af2ab5d105f6d2ce442b517e532b7570616e3.tar.bz2
Ishtar-da4af2ab5d105f6d2ce442b517e532b7570616e3.zip
Treatment - Treatment files dashboard: first overview (refs #3381)
Diffstat (limited to 'ishtar_common/views.py')
-rw-r--r--ishtar_common/views.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index 4732313ea..e8a2c9e12 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -1451,6 +1451,9 @@ def dashboard_main(request, dct, obj_id=None, *args, **kwargs):
app_list.append((_(u"Context records"), 'contextrecords'))
if profile.find:
app_list.append((_(u"Finds"), 'finds'))
+ if profile.warehouse:
+ app_list.append((_(u"Treatment requests"), 'treatmentfiles'))
+ app_list.append((_(u"Treatments"), 'treatments'))
dct = {'app_list': app_list}
return render_to_response('ishtar/dashboards/dashboard_main.html', dct,
context_instance=RequestContext(request))
@@ -1497,18 +1500,27 @@ def dashboard_main_detail(request, item_name):
if item_name == 'files' and profile.files:
lbl, dashboard = (_(u"Archaeological files"),
models.Dashboard(File, **dashboard_kwargs))
- if item_name == 'operations':
+ elif item_name == 'operations':
from archaeological_operations.models import Operation
lbl, dashboard = (_(u"Operations"),
models.Dashboard(Operation, **dashboard_kwargs))
- if item_name == 'contextrecords' and profile.context_record:
+ elif item_name == 'contextrecords' and profile.context_record:
lbl, dashboard = (
_(u"Context records"),
models.Dashboard(ContextRecord, slice=slicing, fltr=fltr))
- if item_name == 'finds' and profile.find:
+ elif item_name == 'finds' and profile.find:
lbl, dashboard = (_(u"Finds"), models.Dashboard(Find,
slice=slicing,
fltr=fltr))
+ elif item_name == 'treatmentfiles' and profile.warehouse:
+ lbl, dashboard = (
+ _(u"Treatment requests"),
+ models.Dashboard(TreatmentFile, slice=slicing, fltr=fltr))
+ elif item_name == 'treatments' and profile.warehouse:
+ lbl, dashboard = (
+ _(u"Treatments"),
+ models.Dashboard(Treatment, slice=slicing, fltr=fltr,
+ date_source='start'))
if not lbl:
raise Http404
dct = {'lbl': lbl, 'dashboard': dashboard,