6caf62e72f
Combined summary pages Changed admin panel to index
29 lines
815 B
Python
29 lines
815 B
Python
from django.contrib.admin.views.decorators import staff_member_required
|
|
from django.shortcuts import render
|
|
from django.views.generic import ListView
|
|
|
|
from .context_helpers import *
|
|
from .email_helpers import render_to_pdf
|
|
from .models import Company, Bus, Traveller, BusStop, TravellerRoute, Shuttle, Driver
|
|
|
|
|
|
@staff_member_required
|
|
def bus_summary(request):
|
|
return render(request, 'reports/bus_summary.html', bus_summary_context())
|
|
|
|
|
|
@staff_member_required
|
|
def emergency_contacts(request):
|
|
return render_to_pdf('reports/emergency_contacts.html', emergency_contacts_context())
|
|
|
|
|
|
@staff_member_required
|
|
def bus_roll(request):
|
|
return render_to_pdf('reports/bus_roll.html', bus_roll_context())
|
|
|
|
|
|
@staff_member_required
|
|
class CompanyList(ListView):
|
|
model = Company
|
|
template_name = "companies.html"
|