コード例 #1
0
def stock_level_viz(request):
    dict = {
            'geoserver_url':getattr(settings, 'GEOSERVER_URL', 'http://localhost/geoserver/'),
            'week':last_reporting_period_number(),
        }
    return render_to_response('mtrack/partials/viz/stock_levels_map.html',
                              dict,
                              context_instance=RequestContext(request))
コード例 #2
0
def approve(request):
    location = get_location_for_user(request.user)

    return render_to_response('mtrack/partials/dashboard_approve.html', {
            #'reports':get_facility_reports(location, date_range=last_reporting_period(period=0), count=True, approved=False),
            #'total_reports':get_facility_reports(location, date_range=last_reporting_period(todate=True), count=True, approved=False),
            'reports':get_facility_reports2(location, date_range=last_reporting_period(period=0)),
            'total_reports':get_facility_reports2(location, date_range=last_reporting_period(period=0), todate=True),
            'reporting_period': last_reporting_period_number(),
            'current_week': current_reporting_week_number()
        },
        context_instance=RequestContext(request))
コード例 #3
0
def admin(request):
    location = get_location_for_user(request.user)

    return render_to_response('mtrack/partials/dashboard_admin.html', {
            #change period = 1 for the last reporting                                                           
            'good_facilities':reporting_facilities(location, date_range=last_reporting_period(period=0)),
            'good_vhts':reporting_vhts(location),
            'total_facilities':total_registered_facilities(location),
            'total_vhts':total_vhts(location),
            'reporting_period': last_reporting_period_number(),
            'current_week': current_reporting_week_number()
        },
        context_instance=RequestContext(request))