diff options
Diffstat (limited to 'ishtar_common/views.py')
| -rw-r--r-- | ishtar_common/views.py | 18 | 
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, | 
