diff --git a/datacenterlight/admin.py b/datacenterlight/admin.py deleted file mode 100644 index 7a846c71..00000000 --- a/datacenterlight/admin.py +++ /dev/null @@ -1,9 +0,0 @@ -from django.contrib import admin - -from .models import BetaAccess, BetaAccessVMType, BetaAccessVM -# Register your models here. - - -admin.site.register(BetaAccess) -admin.site.register(BetaAccessVMType) -admin.site.register(BetaAccessVM) diff --git a/datacenterlight/forms.py b/datacenterlight/forms.py index 3ffe403c..b697f694 100644 --- a/datacenterlight/forms.py +++ b/datacenterlight/forms.py @@ -1,26 +1,9 @@ from django import forms -from .models import BetaAccess, ContactUs - - -class BetaAccessForm(forms.ModelForm): - email = forms.CharField(widget=forms.EmailInput()) - - class Meta: - fields = ['name', 'email'] - model = BetaAccess +from .models import ContactUs class ContactForm(forms.ModelForm): - class Meta: fields = ['name', 'email', 'message'] model = ContactUs - - -# class BetaAccessVMForm(forms.ModelForm): -# type = forms.CharField(widget=forms.EmailInput()) - -# class Meta: -# fields = ['email'] -# model = BetaAccessVM diff --git a/datacenterlight/migrations/0011_auto_20180220_1423.py b/datacenterlight/migrations/0011_auto_20180220_1423.py new file mode 100644 index 00000000..d436981e --- /dev/null +++ b/datacenterlight/migrations/0011_auto_20180220_1423.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2018-02-20 14:23 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('datacenterlight', '0010_merge'), + ] + + operations = [ + migrations.RemoveField( + model_name='betaaccessvm', + name='access', + ), + migrations.RemoveField( + model_name='betaaccessvm', + name='type', + ), + migrations.DeleteModel( + name='BetaAccess', + ), + migrations.DeleteModel( + name='BetaAccessVM', + ), + migrations.DeleteModel( + name='BetaAccessVMType', + ), + ] diff --git a/datacenterlight/models.py b/datacenterlight/models.py index e2de41e1..2fbed5c8 100644 --- a/datacenterlight/models.py +++ b/datacenterlight/models.py @@ -1,56 +1,6 @@ from django.db import models -class BetaAccessVMType(models.Model): - ssd = models.IntegerField() - ram = models.IntegerField() - cpu = models.IntegerField() - price = models.FloatField() - - def __str__(self): - return "ID: %s - SSD %s - RAM %s - CPU %s - Price %s " % \ - (self.id, str(self.ssd), self.ram, self.cpu, self.price) - - -class BetaAccess(models.Model): - email = models.CharField(max_length=250) - name = models.CharField(max_length=250) - - # vm = models.ForeignKey(BetaAccessVM) - - def __str__(self): - vms = self.betaaccessvm_set.all() - rep = "Email: %s " % self.email - for vm in vms: - rep += "(vm:%s - amount:%s) - " % (vm.type.id, vm.amount) - return rep - - -class BetaAccessVM(models.Model): - type = models.ForeignKey(BetaAccessVMType) - access = models.ForeignKey(BetaAccess) - amount = models.IntegerField() - - @classmethod - def create(cls, data): - VM_KEY_ID = 0 - VM_AMOUNT = 1 - ZERO = 0 - email = data.get('email') - beta_access = BetaAccess.objects.create(email=email) - vm_data = [(key, value) for key, value in data.items() if 'vm' in key] - created_vms = [] - for vm in vm_data: - if int(vm[VM_AMOUNT]) == ZERO: - continue - vm_id = vm[VM_KEY_ID].split('-').pop() - vm_type = BetaAccessVMType.objects.get(id=vm_id) - created_vms.append(cls.objects.create(access=beta_access, - amount=vm[VM_AMOUNT], type=vm_type)) - - return created_vms - - class VMTemplate(models.Model): name = models.CharField(max_length=50) opennebula_vm_template_id = models.IntegerField() diff --git a/datacenterlight/static/datacenterlight/img/beta-img.png b/datacenterlight/static/datacenterlight/img/beta-img.png deleted file mode 100644 index 76a3983f..00000000 Binary files a/datacenterlight/static/datacenterlight/img/beta-img.png and /dev/null differ diff --git a/datacenterlight/static/datacenterlight/js/beta.js b/datacenterlight/static/datacenterlight/js/beta.js deleted file mode 100644 index 7fd84acf..00000000 --- a/datacenterlight/static/datacenterlight/js/beta.js +++ /dev/null @@ -1,55 +0,0 @@ -(function($){ - 'use strict'; // Start of use strict - - - - $(document).ready(function(){ - verifiedUrl(); - init_options_interested(); - init_nav(); - change_values(); - }); - - function verifiedUrl(){ - if(window.location.href.indexOf('#success') > -1){ - form_success(); - } - } - - function init_options_interested(){ - $('.row-vms').click(function(){ - $('.row-vms').removeClass('row-vms__active'); - $(this).addClass('row-vms__active'); - var number = $('.row-vms__active input').val(); - var price = $('.row-vms__active input').data('price'); - _calculate(number, price); - }); - } - - function init_nav(){ - - $('.nav-local').click(function(){ - $('html, body').animate({ - scrollTop: $('#'+$(this).data('href')).offset().top - }); - }); - - } - - function change_values(){ - $('.number-vms').keyup(function () { - var number = $(this).val(); - var price = $(this).data('price'); - _calculate(number, price); - }); - - } - function form_success(){ - $('#sucessModal').modal('show'); - } - function _calculate(numbers, price){ - $('#valueTotal').text(numbers*price*31); - } - - -})(jQuery); // End of use strict diff --git a/datacenterlight/templates/datacenterlight/beta_access.html b/datacenterlight/templates/datacenterlight/beta_access.html deleted file mode 100644 index 7a694611..00000000 --- a/datacenterlight/templates/datacenterlight/beta_access.html +++ /dev/null @@ -1,27 +0,0 @@ -{% load i18n %} - -
- {% csrf_token %} - {{ form.non_field_errors }} -
- {% for message in messages %} - {{ message }} - {% endfor %} -
-
-
- - {{ form.name.errors|striptags}} -
-
- - {{ form.email.errors|striptags}} -
-
- -
- \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/beta_success.html b/datacenterlight/templates/datacenterlight/beta_success.html deleted file mode 100644 index 60df607c..00000000 --- a/datacenterlight/templates/datacenterlight/beta_success.html +++ /dev/null @@ -1,47 +0,0 @@ - -{% load i18n %} - - - - \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.html b/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.html deleted file mode 100644 index be8479d9..00000000 --- a/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.html +++ /dev/null @@ -1,176 +0,0 @@ -{% load static from staticfiles %} -{% load i18n %} - - - - - - - {{dcl_text}} - - - - - - - - - - - - - -
-
- - - - -
- -
- - - - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- {% block email_head %} - {% endblock %} -
-

- {% block email_body %} - {% endblock %} -

  -
-
-
-
- - - - -
{% trans 'Your Data Center Light Team' %} -
-
-
- - - diff --git a/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.txt b/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.txt deleted file mode 100644 index 46fd0730..00000000 --- a/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.txt +++ /dev/null @@ -1,7 +0,0 @@ -{% load static from staticfiles %} -{% load i18n %} -{% block email_head %} -{% endblock %} -{% block email_body %} -{% endblock %} -{% trans 'Your Data Center Light Team' %} diff --git a/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html b/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html deleted file mode 100644 index 2f71944f..00000000 --- a/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html +++ /dev/null @@ -1,129 +0,0 @@ -{% load static from staticfiles %} -{% load i18n%} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- {% trans "Thank you for your request." %} -
-

{% trans "You are one step away from being our beta tester!" %}

- {% trans "Currently we are running our tests to make sure everything runs perfectly." %}
- {% trans "In the meantime, we would like to ask you a little patience
until our team contacts you with beta access." %}
- {% trans "Thank you!" %}

 
-
-
-
- - -
Your data center light team
-
-
-
- - - diff --git a/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.txt b/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.txt deleted file mode 100644 index e96a8ef1..00000000 --- a/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.txt +++ /dev/null @@ -1,129 +0,0 @@ -{% load static from staticfiles %} -{% load i18n%} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- {% trans "Thank you for your request." %} -
-

{% trans "You are one step away from being our beta tester!" %}

- {% trans "Currently we are running our tests to make sure everything runs perfectly." %}
- {% trans "In the meantime, we would like to ask you a little patience
until our team contacts you with beta access." %}
- {% trans "Thank you!" %}

 
-
-
-
- - -
Your data center light team
-
-
-
- - - diff --git a/datacenterlight/templates/datacenterlight/emails/request_access_notification.html b/datacenterlight/templates/datacenterlight/emails/request_access_notification.html deleted file mode 100644 index 095c917e..00000000 --- a/datacenterlight/templates/datacenterlight/emails/request_access_notification.html +++ /dev/null @@ -1,125 +0,0 @@ -{% load static from staticfiles %} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- An user requested a beta access -
-

User {{email}} requested beta access

 
-
-
-
- - -
Your data center light team
-
-
-
- - - diff --git a/datacenterlight/templates/datacenterlight/emails/request_access_notification.txt b/datacenterlight/templates/datacenterlight/emails/request_access_notification.txt deleted file mode 100644 index 09531ba6..00000000 --- a/datacenterlight/templates/datacenterlight/emails/request_access_notification.txt +++ /dev/null @@ -1,125 +0,0 @@ -{% load static from staticfiles %} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- An user requested a beta access -
-

User {{email}} requested beta access

 
-
-
-
- - -
Your data center light team
-
-
-
- - - diff --git a/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html b/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html deleted file mode 100644 index c6f3033e..00000000 --- a/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html +++ /dev/null @@ -1,131 +0,0 @@ -{% load static from staticfiles %} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- An user requested a beta access - - -
-

User {{email}} requested beta access

- {% for vm in vms %} - Type: {{vm.type}} - Amount: {{vm.amount}} - {% endfor %} -
 
-
-
-
- - -
Your data center light team
-
-
-
- - - diff --git a/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.txt b/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.txt deleted file mode 100644 index 92a03a99..00000000 --- a/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.txt +++ /dev/null @@ -1,131 +0,0 @@ -{% load static from staticfiles %} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- An user requested a beta access - - -
-

User {{email}} requested beta access

- {% for vm in vms %} - Type: {{vm.type}} - {% endfor %} -
 
-
-
-
- - -
Your data center light team
-
-
-
- - - diff --git a/datacenterlight/templates/datacenterlight/index.html b/datacenterlight/templates/datacenterlight/index.html index f8ac4419..3d430342 100755 --- a/datacenterlight/templates/datacenterlight/index.html +++ b/datacenterlight/templates/datacenterlight/index.html @@ -136,7 +136,6 @@
-
{% include "datacenterlight/calculator_form.html" %}
diff --git a/datacenterlight/templates/datacenterlight/success.html b/datacenterlight/templates/datacenterlight/success.html deleted file mode 100644 index ff553f3c..00000000 --- a/datacenterlight/templates/datacenterlight/success.html +++ /dev/null @@ -1,32 +0,0 @@ -{% extends "datacenterlight/base.html" %} -{% load staticfiles i18n %} -{% block content %} - -
- -
-

{% trans "Thank you for order! Our team will contact you via email" %}

- {% if LANGUAGE_CODE == 'en-us'%} -

{% trans "as soon as possible!" %}

- {% endif %} -
- -
- - - -{% endblock %} \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/whydatacenterlight.html b/datacenterlight/templates/datacenterlight/whydatacenterlight.html index c54156b6..eef33b8a 100644 --- a/datacenterlight/templates/datacenterlight/whydatacenterlight.html +++ b/datacenterlight/templates/datacenterlight/whydatacenterlight.html @@ -135,7 +135,6 @@
-
{% 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' %} - - - - - - - - - - - - -
-
-
- -
-

Thank you for your interest in joining Rails-Hosting Beta.
-     We will come back to you shortly to give you access to our  infrastructure. -

-
-
    - -
-
-
-
- -
- - -
- - - - - - - - - - - - - - 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 @@
-

{{ domain }}

{{ hosting_long }} as easy as possible