mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
pagekite is required to be installed via package now
This commit is contained in:
parent
1fc0064fd0
commit
8955e41f15
@ -20,6 +20,7 @@ from django.contrib.auth.decorators import login_required
|
|||||||
from django.core.urlresolvers import reverse, reverse_lazy
|
from django.core.urlresolvers import reverse, reverse_lazy
|
||||||
from django.http.response import HttpResponseRedirect
|
from django.http.response import HttpResponseRedirect
|
||||||
from django.template.response import TemplateResponse
|
from django.template.response import TemplateResponse
|
||||||
|
from django.utils.decorators import method_decorator
|
||||||
from django.views.generic import View, TemplateView
|
from django.views.generic import View, TemplateView
|
||||||
from django.views.generic.edit import FormView
|
from django.views.generic.edit import FormView
|
||||||
|
|
||||||
@ -46,7 +47,10 @@ def index(request):
|
|||||||
|
|
||||||
|
|
||||||
class ContextMixin(object):
|
class ContextMixin(object):
|
||||||
"""Mixin to add 'subsubmenu' and 'title' to the context."""
|
"""Mixin to add 'subsubmenu' and 'title' to the context.
|
||||||
|
|
||||||
|
Also requires 'pagekite' to be installed.
|
||||||
|
"""
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
"""Use self.title and the module-level subsubmenu"""
|
"""Use self.title and the module-level subsubmenu"""
|
||||||
context = super(ContextMixin, self).get_context_data(**kwargs)
|
context = super(ContextMixin, self).get_context_data(**kwargs)
|
||||||
@ -54,8 +58,12 @@ class ContextMixin(object):
|
|||||||
context['subsubmenu'] = subsubmenu
|
context['subsubmenu'] = subsubmenu
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
@method_decorator(package.required('pagekite'))
|
||||||
|
def dispatch(self, *args, **kwargs):
|
||||||
|
return super(ContextMixin, self).dispatch(*args, **kwargs)
|
||||||
|
|
||||||
class DeleteServiceView(View):
|
|
||||||
|
class DeleteServiceView(ContextMixin, View):
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
form = CustomServiceForm(request.POST)
|
form = CustomServiceForm(request.POST)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user