-
{% include "datacenterlight/calculator_form.html" %}
diff --git a/datacenterlight/urls.py b/datacenterlight/urls.py
index 2cd0723f..a93a24d0 100644
--- a/datacenterlight/urls.py
+++ b/datacenterlight/urls.py
@@ -1,13 +1,10 @@
from django.conf.urls import url
-
-from .views import (
- IndexView, BetaProgramView, LandingProgramView, BetaAccessView,
- SuccessView, PaymentOrderView, OrderConfirmationView,
- WhyDataCenterLightView, ContactUsView
-)
-
from django.views.generic import TemplateView
+from .views import (
+ IndexView, LandingProgramView, PaymentOrderView, OrderConfirmationView,
+ WhyDataCenterLightView, ContactUsView
+)
urlpatterns = [
url(r'^$', IndexView.as_view(), name='index'),
@@ -17,15 +14,11 @@ urlpatterns = [
url(r'^l/$', IndexView.as_view(), name='index_l'),
url(r'^whydatacenterlight/?$', WhyDataCenterLightView.as_view(),
name='whydatacenterlight'),
- url(r'^beta-program/?$', BetaProgramView.as_view(), name='beta'),
url(r'^landing/?$', LandingProgramView.as_view(), name='landing'),
url(r'^payment/?$', PaymentOrderView.as_view(), name='payment'),
url(r'^order-confirmation/?$', OrderConfirmationView.as_view(),
name='order_confirmation'),
- url(r'^order-success/?$', SuccessView.as_view(), name='order_success'),
- url(r'^beta_access?$', BetaAccessView.as_view(), name='beta_access'),
url(r'^contact/?$', ContactUsView.as_view(), name='contact_us'),
-
url(r'glasfaser/?$',
TemplateView.as_view(template_name='ungleich_page/glasfaser.html'),
name='glasfaser'),
diff --git a/datacenterlight/views.py b/datacenterlight/views.py
index fda8c9c9..25374dfb 100644
--- a/datacenterlight/views.py
+++ b/datacenterlight/views.py
@@ -1,5 +1,5 @@
-import logging
import json
+import logging
from django import forms
from django.conf import settings
@@ -14,19 +14,18 @@ from django.views.decorators.cache import cache_control
from django.views.generic import FormView, CreateView, TemplateView, DetailView
from datacenterlight.tasks import create_vm_task
-from hosting.models import HostingOrder
from hosting.forms import HostingUserLoginForm
+from hosting.models import HostingOrder
from membership.models import CustomUser, StripeCustomer
from opennebula_api.serializers import VMTemplateSerializer
from utils.forms import (
BillingAddressForm, BillingAddressFormSignup
)
from utils.hosting_utils import get_vm_price
-from utils.mailer import BaseEmail
from utils.stripe_utils import StripeUtils
from utils.tasks import send_plain_email_task
-from .forms import BetaAccessForm, ContactForm
-from .models import BetaAccess, BetaAccessVMType, BetaAccessVM, VMTemplate
+from .forms import ContactForm
+from .models import VMTemplate
logger = logging.getLogger(__name__)
@@ -79,128 +78,8 @@ class LandingProgramView(TemplateView):
template_name = "datacenterlight/landing.html"
-class SuccessView(TemplateView):
- template_name = "datacenterlight/success.html"
-
- def get(self, request, *args, **kwargs):
- if 'specs' not in request.session or 'user' not in request.session:
- return HttpResponseRedirect(reverse('datacenterlight:index'))
- elif 'token' not in request.session:
- return HttpResponseRedirect(reverse('datacenterlight:payment'))
- elif 'order_confirmation' not in request.session:
- return HttpResponseRedirect(
- reverse('datacenterlight:order_confirmation'))
- else:
- for session_var in ['specs', 'user', 'template', 'billing_address',
- 'billing_address_data',
- 'token', 'customer']:
- if session_var in request.session:
- del request.session[session_var]
- return render(request, self.template_name)
-
-
-class BetaAccessView(FormView):
- template_name = "datacenterlight/beta_access.html"
- form_class = BetaAccessForm
- success_message = "Thank you, we will contact you as soon as possible"
-
- def form_valid(self, form):
- context = {
- 'base_url': "{0}://{1}".format(self.request.scheme,
- self.request.get_host())
- }
-
- email_data = {
- 'subject': 'DatacenterLight Beta Access Request',
- 'from_address': '(datacenterlight) datacenterlight Support
',
- 'to': form.cleaned_data.get('email'),
- 'from': '(datacenterlight) DatacenterLight Support support@datacenterlight.ch',
- 'context': context,
- 'template_name': 'request_access_confirmation',
- 'template_path': 'datacenterlight/emails/'
- }
- email = BaseEmail(**email_data)
- email.send()
-
- context.update({
- 'email': form.cleaned_data.get('email')
- })
-
- email_data = {
- 'subject': 'DatacenterLight Beta Access Request',
- 'from_address': '(datacenterlight) datacenterlight Support ',
- 'to': 'info@ungleich.ch',
- 'context': context,
- 'template_name': 'request_access_notification',
- 'template_path': 'datacenterlight/emails/'
- }
- email = BaseEmail(**email_data)
- email.send()
-
- messages.add_message(self.request, messages.SUCCESS,
- self.success_message)
- return render(self.request, 'datacenterlight/beta_success.html', {})
-
-
-class BetaProgramView(CreateView):
- template_name = "datacenterlight/beta.html"
- model = BetaAccessVM
- fields = '__all__'
- # form_class = BetaAccessForm
- # success_url = "/datacenterlight#requestform"
- success_message = "Thank you, we will contact you as soon as possible"
-
- def get_success_url(self):
- success_url = reverse('datacenterlight:beta')
- success_url += "#success"
- return success_url
-
- def get_context_data(self, **kwargs):
- vms = BetaAccessVMType.objects.all()
- context = super(BetaProgramView, self).get_context_data(**kwargs)
-
- # templates = OpenNebulaManager().get_templates()
- # data = VirtualMachineTemplateSerializer(templates, many=True).data
-
- context.update({
- 'base_url': "{0}://{1}".format(self.request.scheme,
- self.request.get_host()),
- 'vms': vms
- })
- return context
-
- def post(self, request, *args, **kwargs):
- data = request.POST
- vms = BetaAccessVM.create(data)
-
- context = {
- 'base_url': "{0}://{1}".format(self.request.scheme,
- self.request.get_host()),
- 'email': data.get('email'),
- 'name': data.get('name'),
- 'vms': vms
- }
-
- email_data = {
- 'subject': 'DatacenterLight Beta Access Request',
- 'from_address': '(datacenterlight) datacenterlight Support ',
- 'to': 'info@ungleich.ch',
- 'context': context,
- 'template_name': 'request_beta_access_notification',
- 'template_path': 'datacenterlight/emails/'
- }
- email = BaseEmail(**email_data)
- email.send()
-
- messages.add_message(self.request, messages.SUCCESS,
- self.success_message)
- return HttpResponseRedirect(self.get_success_url())
-
-
class IndexView(CreateView):
template_name = "datacenterlight/index.html"
- model = BetaAccess
- form_class = BetaAccessForm
success_url = "/datacenterlight#requestform"
success_message = "Thank you, we will contact you as soon as possible"
@@ -292,48 +171,9 @@ class IndexView(CreateView):
})
return context
- def form_valid(self, form):
-
- context = {
- 'base_url': "{0}://{1}".format(self.request.scheme,
- self.request.get_host())
- }
-
- email_data = {
- 'subject': 'DatacenterLight Beta Access Request',
- 'from_address': '(datacenterlight) datacenterlight Support ',
- 'to': form.cleaned_data.get('email'),
- 'from': '(datacenterlight) DatacenterLight Support support@datacenterlight.ch',
- 'context': context,
- 'template_name': 'request_access_confirmation',
- 'template_path': 'datacenterlight/emails/'
- }
- email = BaseEmail(**email_data)
- email.send()
-
- context.update({
- 'email': form.cleaned_data.get('email')
- })
-
- email_data = {
- 'subject': 'DatacenterLight Beta Access Request',
- 'from_address': '(datacenterlight) datacenterlight Support ',
- 'to': 'info@ungleich.ch',
- 'context': context,
- 'template_name': 'request_access_notification',
- 'template_path': 'datacenterlight/emails/'
- }
- email = BaseEmail(**email_data)
- email.send()
-
- messages.add_message(self.request, messages.SUCCESS,
- self.success_message)
- return super(IndexView, self).form_valid(form)
-
class WhyDataCenterLightView(IndexView):
template_name = "datacenterlight/whydatacenterlight.html"
- model = BetaAccess
class PaymentOrderView(FormView):
diff --git a/hosting/static/hosting/img/Beta.png b/hosting/static/hosting/img/Beta.png
deleted file mode 100644
index 76a3983f..00000000
Binary files a/hosting/static/hosting/img/Beta.png and /dev/null differ
diff --git a/hosting/templates/hosting/beta.html b/hosting/templates/hosting/beta.html
deleted file mode 100644
index bdf37f58..00000000
--- a/hosting/templates/hosting/beta.html
+++ /dev/null
@@ -1,147 +0,0 @@
-{% load staticfiles %}
-
-
-
-
-
-
-
-
-
-
-
-
- Rails Hosting.ch - Ruby on Rails as easy as possible
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {% include 'google_analytics.html' %}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/hosting/templates/hosting/includes/_header.html b/hosting/templates/hosting/includes/_header.html
index 9e609816..6f9b4a5c 100644
--- a/hosting/templates/hosting/includes/_header.html
+++ b/hosting/templates/hosting/includes/_header.html
@@ -7,7 +7,6 @@