You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.2 KiB
38 lines
1.2 KiB
import json
|
|
from django.views.generic import TemplateView
|
|
from django.shortcuts import HttpResponse
|
|
#from forms import CallbackForm
|
|
from service.order_forms import CallBackForm
|
|
from meta.views import MetadataMixin
|
|
from functions.cache_mixin import JitterCacheMixin
|
|
from settings.models import LandingComment
|
|
|
|
|
|
class AdvertisingView(MetadataMixin, TemplateView):
|
|
template_name = 'simple_pages/advertising.html'
|
|
|
|
|
|
class AdvertisingViewLanding(JitterCacheMixin, AdvertisingView):
|
|
template_name = 'simple_pages/advertising_landing.html'
|
|
|
|
def get_context_data(self, **kwargs):
|
|
context = super(AdvertisingViewLanding, self).get_context_data(**kwargs)
|
|
context['comments'] = LandingComment.objects.language().all()
|
|
return context
|
|
|
|
|
|
class AboutView(MetadataMixin, TemplateView):
|
|
template_name = 'simple_pages/about.html'
|
|
|
|
|
|
def callback(request):
|
|
response = {'success': False}
|
|
if request.GET:
|
|
form = CallBackForm(request.GET)
|
|
if form.is_valid():
|
|
form.save()
|
|
response['success'] = True
|
|
else:
|
|
response['errors'] = form.errors
|
|
|
|
return HttpResponse(json.dumps(response), content_type='application/json')
|
|
|