Commit ec660c4f authored by Patrick Kimber's avatar Patrick Kimber

'booking' app - calendar mixin #1181

parent ce4bfd90
......@@ -43,7 +43,11 @@ from .models import (
Rota,
RotaType,
)
from .service import PdfCalendar
from .service import (
grouper,
HtmlCalendar,
PdfCalendar,
)
def _url_booking(booking):
......@@ -224,6 +228,18 @@ class BookingUpdateView(
return _url_booking(self.object)
class CalendarMixin(object):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
calendars = HtmlCalendar().get_calendars()
grouped = grouper(calendars, 3)
context.update(dict(
calendar=list(grouped),
))
return context
class CategoryCreateView(
LoginRequiredMixin, StaffuserRequiredMixin, BaseMixin, CreateView):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment