From 0e72f8a4367c8ada9c81513b1b36b24469ed19dd Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sun, 20 Aug 2017 03:30:10 +0530 Subject: [PATCH 01/71] downtime page --- .../datacenterlight/css/downtime-page.css | 52 +++++++++++++++ .../templates/datacenterlight/downtime.html | 63 +++++++++++++++++++ datacenterlight/urls.py | 11 +++- 3 files changed, 123 insertions(+), 3 deletions(-) create mode 100644 datacenterlight/static/datacenterlight/css/downtime-page.css create mode 100644 datacenterlight/templates/datacenterlight/downtime.html diff --git a/datacenterlight/static/datacenterlight/css/downtime-page.css b/datacenterlight/static/datacenterlight/css/downtime-page.css new file mode 100644 index 00000000..9bbfa5bc --- /dev/null +++ b/datacenterlight/static/datacenterlight/css/downtime-page.css @@ -0,0 +1,52 @@ +body { + font-family: Lato, sans-serif; + font-weight: 300; + font-size: 20px; + line-height: 1; +} + +h1 { + font-weight: 300; + font-size: 52px; + text-align: center; +} + +nav { + padding: 15px; +} + +.downtime-container { + max-width: 1200px; + margin: auto; + display: flex; + flex-direction: column; + justify-content: space-between; +} + +.downtime-msg { + text-align: center; + font-size: 30px; +} + +.downtime-contact { + max-width: 300px; + margin: auto; + color: #4a90e2; +} + +h2 { + font-weight: 300; + font-size: 24px; + text-align: center; +} +p { + margin: 15px auto +} +.xl_p { + margin: 15px auto; +} + +a { + color: #4a90e2; + text-decoration: none; +} \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/downtime.html b/datacenterlight/templates/datacenterlight/downtime.html new file mode 100644 index 00000000..dd5954ca --- /dev/null +++ b/datacenterlight/templates/datacenterlight/downtime.html @@ -0,0 +1,63 @@ +{% load staticfiles bootstrap3%} +{% load i18n %} + + + + + + + + + + + + ungleich + + + + + + + + + + + + + + {% include "google_analytics.html" %} + + + + + +
+ + +

{% trans "You caught us while working!" %}

+
+

{% trans "We're doing scheduled maintainence from" %}

+

17:00 21.08.2017 {% trans "to" %} 23:00 21.08.2017 CEST.

+
+

{% trans "If you need immediate assistance, please contact us at" %}

+ +
+ + + diff --git a/datacenterlight/urls.py b/datacenterlight/urls.py index a3aed7a6..a0942695 100644 --- a/datacenterlight/urls.py +++ b/datacenterlight/urls.py @@ -1,17 +1,22 @@ from django.conf.urls import url +from django.views.generic import TemplateView from .views import IndexView, BetaProgramView, LandingProgramView, BetaAccessView, PricingView, SuccessView, \ - PaymentOrderView, OrderConfirmationView, WhyDataCenterLightView + PaymentOrderView, OrderConfirmationView, WhyDataCenterLightView urlpatterns = [ url(r'^$', IndexView.as_view(), name='index'), - url(r'^whydatacenterlight/?$', WhyDataCenterLightView.as_view(), name='whydatacenterlight'), + 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'^pricing/?$', PricingView.as_view(), name='pricing'), url(r'^payment/?$', PaymentOrderView.as_view(), name='payment'), - url(r'^order-confirmation/?$', OrderConfirmationView.as_view(), name='order_confirmation'), + 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'test/?$', TemplateView.as_view(template_name='datacenterlight/downtime.html')), ] From 06c68873aea768ba04419a36aac3ae123fd08713 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sun, 20 Aug 2017 03:59:24 +0530 Subject: [PATCH 02/71] downtime.html modified as a static html page --- .../datacenterlight/css/downtime-page.css | 52 ----------- .../templates/datacenterlight/downtime.html | 86 ++++++++++++++----- 2 files changed, 64 insertions(+), 74 deletions(-) delete mode 100644 datacenterlight/static/datacenterlight/css/downtime-page.css diff --git a/datacenterlight/static/datacenterlight/css/downtime-page.css b/datacenterlight/static/datacenterlight/css/downtime-page.css deleted file mode 100644 index 9bbfa5bc..00000000 --- a/datacenterlight/static/datacenterlight/css/downtime-page.css +++ /dev/null @@ -1,52 +0,0 @@ -body { - font-family: Lato, sans-serif; - font-weight: 300; - font-size: 20px; - line-height: 1; -} - -h1 { - font-weight: 300; - font-size: 52px; - text-align: center; -} - -nav { - padding: 15px; -} - -.downtime-container { - max-width: 1200px; - margin: auto; - display: flex; - flex-direction: column; - justify-content: space-between; -} - -.downtime-msg { - text-align: center; - font-size: 30px; -} - -.downtime-contact { - max-width: 300px; - margin: auto; - color: #4a90e2; -} - -h2 { - font-weight: 300; - font-size: 24px; - text-align: center; -} -p { - margin: 15px auto -} -.xl_p { - margin: 15px auto; -} - -a { - color: #4a90e2; - text-decoration: none; -} \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/downtime.html b/datacenterlight/templates/datacenterlight/downtime.html index dd5954ca..17c40d79 100644 --- a/datacenterlight/templates/datacenterlight/downtime.html +++ b/datacenterlight/templates/datacenterlight/downtime.html @@ -1,5 +1,3 @@ -{% load staticfiles bootstrap3%} -{% load i18n %} @@ -13,23 +11,69 @@ ungleich - - + @@ -37,25 +81,23 @@
-

{% trans "You caught us while working!" %}

+

You caught us while working!

-

{% trans "We're doing scheduled maintainence from" %}

-

17:00 21.08.2017 {% trans "to" %} 23:00 21.08.2017 CEST.

+

We're doing scheduled maintenance from

+

17:00 21.08.2017 to 23:00 21.08.2017 CEST.

-

{% trans "If you need immediate assistance, please contact us at" %}

+

If you need immediate assistance, please contact us at

From dd54b3052e284edc698f2161216da1e90be71a48 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 25 Dec 2017 15:07:12 +0100 Subject: [PATCH 03/71] Reorganize imports --- hosting/views.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index 576b3534..25d89b64 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -12,13 +12,13 @@ from django.contrib.auth.tokens import default_token_generator from django.core.exceptions import ValidationError from django.core.files.base import ContentFile from django.core.urlresolvers import reverse_lazy, reverse - from django.http import Http404, HttpResponseRedirect, HttpResponse from django.shortcuts import redirect, render from django.utils.http import urlsafe_base64_decode from django.utils.safestring import mark_safe from django.utils.translation import get_language, ugettext_lazy as _ from django.utils.translation import ugettext +from django.views.decorators.cache import cache_control from django.views.generic import ( View, CreateView, FormView, ListView, DetailView, DeleteView, TemplateView, UpdateView @@ -29,11 +29,14 @@ from stored_messages.api import mark_read from stored_messages.models import Message from stored_messages.settings import stored_messages_settings +from datacenterlight.models import VMTemplate from datacenterlight.tasks import create_vm_task from membership.models import CustomUser, StripeCustomer from opennebula_api.models import OpenNebulaManager -from opennebula_api.serializers import VirtualMachineSerializer, \ - VirtualMachineTemplateSerializer, VMTemplateSerializer +from opennebula_api.serializers import ( + VirtualMachineSerializer, VirtualMachineTemplateSerializer, + VMTemplateSerializer +) from utils.forms import ( BillingAddressForm, PasswordResetRequestForm, UserBillingAddressForm, ResendActivationEmailForm @@ -46,13 +49,14 @@ from utils.views import ( PasswordResetViewMixin, PasswordResetConfirmViewMixin, LoginViewMixin, ResendActivationLinkViewMixin ) -from .forms import HostingUserSignupForm, HostingUserLoginForm, \ - UserHostingKeyForm, generate_ssh_key_name +from .forms import ( + HostingUserSignupForm, HostingUserLoginForm, UserHostingKeyForm, + generate_ssh_key_name +) from .mixins import ProcessVMSelectionMixin from .models import ( HostingOrder, HostingBill, HostingPlan, UserHostingKey, VMDetail ) -from datacenterlight.models import VMTemplate logger = logging.getLogger(__name__) From b4f03b95531dce6772eac684ed29fb66693b9457 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 25 Dec 2017 15:10:34 +0100 Subject: [PATCH 04/71] Add cache_control decorator to all hosting views --- hosting/views.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index 25d89b64..a6922a70 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -65,6 +65,7 @@ CONNECTION_ERROR = "Your VMs cannot be displayed at the moment due to a \ minutes." +@cache_control(no_cache=True, must_revalidate=True, no_store=True) class DashboardView(LoginRequiredMixin, View): template_name = "hosting/dashboard.html" login_url = reverse_lazy('hosting:login') @@ -186,6 +187,7 @@ class HostingPricingView(ProcessVMSelectionMixin, View): return render(request, self.template_name, context) +@cache_control(no_cache=True, must_revalidate=True, no_store=True) class IndexView(View): template_name = "hosting/index.html" @@ -210,6 +212,7 @@ class IndexView(View): return render(request, self.template_name, context) +@cache_control(no_cache=True, must_revalidate=True, no_store=True) class LoginView(LoginViewMixin): template_name = "hosting/login.html" form_class = HostingUserLoginForm @@ -310,6 +313,7 @@ class SignupValidatedView(SignupValidateView): return context +@cache_control(no_cache=True, must_revalidate=True, no_store=True) class ResendActivationEmailView(ResendActivationLinkViewMixin): template_name = 'hosting/resend_activation_link.html' form_class = ResendActivationEmailForm @@ -318,6 +322,7 @@ class ResendActivationEmailView(ResendActivationLinkViewMixin): email_template_name = 'user_activation' +@cache_control(no_cache=True, must_revalidate=True, no_store=True) class PasswordResetView(PasswordResetViewMixin): site = 'dcl' template_name = 'hosting/reset_password.html' @@ -326,6 +331,7 @@ class PasswordResetView(PasswordResetViewMixin): template_email_path = 'hosting/emails/' +@cache_control(no_cache=True, must_revalidate=True, no_store=True) class PasswordResetConfirmView(PasswordResetConfirmViewMixin): template_name = 'hosting/confirm_reset_password.html' success_url = reverse_lazy('hosting:login') @@ -402,6 +408,7 @@ class MarkAsReadNotificationView(LoginRequiredMixin, UpdateView): return HttpResponseRedirect(reverse('hosting:notifications')) +@cache_control(no_cache=True, must_revalidate=True, no_store=True) class SSHKeyDeleteView(LoginRequiredMixin, DeleteView): login_url = reverse_lazy('hosting:login') success_url = reverse_lazy('hosting:ssh_keys') @@ -430,6 +437,7 @@ class SSHKeyDeleteView(LoginRequiredMixin, DeleteView): return super(SSHKeyDeleteView, self).delete(request, *args, **kwargs) +@cache_control(no_cache=True, must_revalidate=True, no_store=True) class SSHKeyListView(LoginRequiredMixin, ListView): template_name = "hosting/user_keys.html" login_url = reverse_lazy('hosting:login') @@ -450,6 +458,7 @@ class SSHKeyListView(LoginRequiredMixin, ListView): **response_kwargs) +@cache_control(no_cache=True, must_revalidate=True, no_store=True) class SSHKeyChoiceView(LoginRequiredMixin, View): template_name = "hosting/choice_ssh_keys.html" login_url = reverse_lazy('hosting:login') @@ -476,6 +485,7 @@ class SSHKeyChoiceView(LoginRequiredMixin, View): return redirect(reverse_lazy('hosting:ssh_keys'), foo='bar') +@cache_control(no_cache=True, must_revalidate=True, no_store=True) class SSHKeyCreateView(LoginRequiredMixin, FormView): form_class = UserHostingKeyForm model = UserHostingKey @@ -538,6 +548,7 @@ class SSHKeyCreateView(LoginRequiredMixin, FormView): return self.form_invalid(form) +@cache_control(no_cache=True, must_revalidate=True, no_store=True) class SettingsView(LoginRequiredMixin, FormView): template_name = "hosting/settings.html" login_url = reverse_lazy('hosting:login') @@ -589,6 +600,7 @@ class SettingsView(LoginRequiredMixin, FormView): return self.form_invalid(form) +@cache_control(no_cache=True, must_revalidate=True, no_store=True) class PaymentVMView(LoginRequiredMixin, FormView): template_name = 'hosting/payment.html' login_url = reverse_lazy('hosting:login') @@ -667,8 +679,8 @@ class PaymentVMView(LoginRequiredMixin, FormView): return self.form_invalid(form) -class OrdersHostingDetailView(LoginRequiredMixin, - DetailView): +@cache_control(no_cache=True, must_revalidate=True, no_store=True) +class OrdersHostingDetailView(LoginRequiredMixin, DetailView): template_name = "hosting/order_detail.html" context_object_name = "order" login_url = reverse_lazy('hosting:login') @@ -881,6 +893,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, content_type="application/json") +@cache_control(no_cache=True, must_revalidate=True, no_store=True) class OrdersHostingListView(LoginRequiredMixin, ListView): template_name = "hosting/orders.html" login_url = reverse_lazy('hosting:login') @@ -895,6 +908,7 @@ class OrdersHostingListView(LoginRequiredMixin, ListView): return super(OrdersHostingListView, self).get_queryset() +@cache_control(no_cache=True, must_revalidate=True, no_store=True) class OrdersHostingDeleteView(LoginRequiredMixin, DeleteView): login_url = reverse_lazy('hosting:login') success_url = reverse_lazy('hosting:orders') @@ -939,6 +953,7 @@ class VirtualMachinesPlanListView(LoginRequiredMixin, ListView): return context +@cache_control(no_cache=True, must_revalidate=True, no_store=True) class CreateVirtualMachinesView(LoginRequiredMixin, View): template_name = "hosting/create_virtual_machine.html" login_url = reverse_lazy('hosting:login') @@ -1011,6 +1026,7 @@ class CreateVirtualMachinesView(LoginRequiredMixin, View): return redirect(reverse('hosting:payment')) +@cache_control(no_cache=True, must_revalidate=True, no_store=True) class VirtualMachineView(LoginRequiredMixin, View): template_name = "hosting/virtual_machine_detail.html" login_url = reverse_lazy('hosting:login') From f357c83fc4c7edef344d8f1c9a79ddf1ca00bc69 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 25 Dec 2017 15:53:24 +0100 Subject: [PATCH 05/71] Remove cache_control headers from Classes --- hosting/views.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index a6922a70..3a596394 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -65,7 +65,6 @@ CONNECTION_ERROR = "Your VMs cannot be displayed at the moment due to a \ minutes." -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class DashboardView(LoginRequiredMixin, View): template_name = "hosting/dashboard.html" login_url = reverse_lazy('hosting:login') @@ -187,7 +186,6 @@ class HostingPricingView(ProcessVMSelectionMixin, View): return render(request, self.template_name, context) -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class IndexView(View): template_name = "hosting/index.html" @@ -212,7 +210,6 @@ class IndexView(View): return render(request, self.template_name, context) -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class LoginView(LoginViewMixin): template_name = "hosting/login.html" form_class = HostingUserLoginForm @@ -313,7 +310,6 @@ class SignupValidatedView(SignupValidateView): return context -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class ResendActivationEmailView(ResendActivationLinkViewMixin): template_name = 'hosting/resend_activation_link.html' form_class = ResendActivationEmailForm @@ -322,7 +318,6 @@ class ResendActivationEmailView(ResendActivationLinkViewMixin): email_template_name = 'user_activation' -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class PasswordResetView(PasswordResetViewMixin): site = 'dcl' template_name = 'hosting/reset_password.html' @@ -331,7 +326,6 @@ class PasswordResetView(PasswordResetViewMixin): template_email_path = 'hosting/emails/' -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class PasswordResetConfirmView(PasswordResetConfirmViewMixin): template_name = 'hosting/confirm_reset_password.html' success_url = reverse_lazy('hosting:login') @@ -408,7 +402,6 @@ class MarkAsReadNotificationView(LoginRequiredMixin, UpdateView): return HttpResponseRedirect(reverse('hosting:notifications')) -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class SSHKeyDeleteView(LoginRequiredMixin, DeleteView): login_url = reverse_lazy('hosting:login') success_url = reverse_lazy('hosting:ssh_keys') @@ -437,7 +430,6 @@ class SSHKeyDeleteView(LoginRequiredMixin, DeleteView): return super(SSHKeyDeleteView, self).delete(request, *args, **kwargs) -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class SSHKeyListView(LoginRequiredMixin, ListView): template_name = "hosting/user_keys.html" login_url = reverse_lazy('hosting:login') @@ -458,7 +450,6 @@ class SSHKeyListView(LoginRequiredMixin, ListView): **response_kwargs) -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class SSHKeyChoiceView(LoginRequiredMixin, View): template_name = "hosting/choice_ssh_keys.html" login_url = reverse_lazy('hosting:login') @@ -485,7 +476,6 @@ class SSHKeyChoiceView(LoginRequiredMixin, View): return redirect(reverse_lazy('hosting:ssh_keys'), foo='bar') -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class SSHKeyCreateView(LoginRequiredMixin, FormView): form_class = UserHostingKeyForm model = UserHostingKey @@ -548,7 +538,6 @@ class SSHKeyCreateView(LoginRequiredMixin, FormView): return self.form_invalid(form) -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class SettingsView(LoginRequiredMixin, FormView): template_name = "hosting/settings.html" login_url = reverse_lazy('hosting:login') @@ -600,7 +589,6 @@ class SettingsView(LoginRequiredMixin, FormView): return self.form_invalid(form) -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class PaymentVMView(LoginRequiredMixin, FormView): template_name = 'hosting/payment.html' login_url = reverse_lazy('hosting:login') @@ -679,7 +667,6 @@ class PaymentVMView(LoginRequiredMixin, FormView): return self.form_invalid(form) -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class OrdersHostingDetailView(LoginRequiredMixin, DetailView): template_name = "hosting/order_detail.html" context_object_name = "order" @@ -893,7 +880,6 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView): content_type="application/json") -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class OrdersHostingListView(LoginRequiredMixin, ListView): template_name = "hosting/orders.html" login_url = reverse_lazy('hosting:login') @@ -908,7 +894,6 @@ class OrdersHostingListView(LoginRequiredMixin, ListView): return super(OrdersHostingListView, self).get_queryset() -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class OrdersHostingDeleteView(LoginRequiredMixin, DeleteView): login_url = reverse_lazy('hosting:login') success_url = reverse_lazy('hosting:orders') @@ -953,7 +938,6 @@ class VirtualMachinesPlanListView(LoginRequiredMixin, ListView): return context -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class CreateVirtualMachinesView(LoginRequiredMixin, View): template_name = "hosting/create_virtual_machine.html" login_url = reverse_lazy('hosting:login') @@ -1026,7 +1010,6 @@ class CreateVirtualMachinesView(LoginRequiredMixin, View): return redirect(reverse('hosting:payment')) -@cache_control(no_cache=True, must_revalidate=True, no_store=True) class VirtualMachineView(LoginRequiredMixin, View): template_name = "hosting/virtual_machine_detail.html" login_url = reverse_lazy('hosting:login') From d796272c1053f644758bab7eb3a6b0f48bb90734 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 25 Dec 2017 15:54:23 +0100 Subject: [PATCH 06/71] Add cache_control headers to get and post methods --- hosting/views.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/hosting/views.py b/hosting/views.py index 3a596394..879fc3e7 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -73,6 +73,7 @@ class DashboardView(LoginRequiredMixin, View): context = {} return context + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def get(self, request, *args, **kwargs): context = self.get_context_data() return render(request, self.template_name, context) @@ -204,9 +205,9 @@ class IndexView(View): } return context + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def get(self, request, *args, **kwargs): context = self.get_context_data() - return render(request, self.template_name, context) @@ -443,6 +444,7 @@ class SSHKeyListView(LoginRequiredMixin, ListView): self.queryset = UserHostingKey.objects.filter(user=user) return super(SSHKeyListView, self).get_queryset() + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def render_to_response(self, context, **response_kwargs): if not self.queryset: return HttpResponseRedirect(reverse('hosting:choice_ssh_keys')) @@ -454,10 +456,12 @@ class SSHKeyChoiceView(LoginRequiredMixin, View): template_name = "hosting/choice_ssh_keys.html" login_url = reverse_lazy('hosting:login') + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def get(self, request, *args, **kwargs): context = {} return render(request, self.template_name, context) + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def post(self, request, *args, **kwargs): name = generate_ssh_key_name() private_key, public_key = UserHostingKey.generate_keys() @@ -527,6 +531,10 @@ class SSHKeyCreateView(LoginRequiredMixin, FormView): manager.manage_public_key([{'value': public_key, 'state': True}]) return HttpResponseRedirect(self.success_url) + @cache_control(no_cache=True, must_revalidate=True, no_store=True) + def get(self, request, *args, **kwargs): + return render(request, self.template_name) + def post(self, request, *args, **kwargs): form = self.get_form() required = 'add_ssh' in self.request.POST @@ -572,6 +580,10 @@ class SettingsView(LoginRequiredMixin, FormView): return context + @cache_control(no_cache=True, must_revalidate=True, no_store=True) + def get(self, request, *args, **kwargs): + return render(request, self.template_name) + def post(self, request, *args, **kwargs): form = self.get_form() if form.is_valid(): @@ -1045,6 +1057,7 @@ class VirtualMachineView(LoginRequiredMixin, View): final_url = reverse('hosting:virtual_machines') return final_url + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def get(self, request, *args, **kwargs): vm = self.get_object() if vm is None: From 72baa3635bad0f94712f284d9b4abb3a7bb8b3ec Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 27 Dec 2017 08:31:19 +0100 Subject: [PATCH 07/71] Add cache_control decorator to LoginViewMixin --- utils/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/views.py b/utils/views.py index 6e54cde6..394a9fc2 100644 --- a/utils/views.py +++ b/utils/views.py @@ -8,6 +8,7 @@ from django.utils.encoding import force_bytes from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode from django.utils.translation import ugettext_lazy as _ from django.views.generic import FormView, CreateView +from django.views.decorators.cache import cache_control from membership.models import CustomUser from .forms import SetPasswordForm @@ -57,6 +58,7 @@ class LoginViewMixin(FormView): return HttpResponseRedirect(self.get_success_url()) + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def get(self, request, *args, **kwargs): if self.request.user.is_authenticated(): return HttpResponseRedirect(self.get_success_url()) From 87cdb08f3c94a70e100f41d879490c01e90feac1 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 27 Dec 2017 08:32:55 +0100 Subject: [PATCH 08/71] Change success_url in hosting.SignupView from ssh_keys to dashboard --- hosting/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/views.py b/hosting/views.py index 879fc3e7..02e30808 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -221,7 +221,7 @@ class SignupView(CreateView): template_name = 'hosting/signup.html' form_class = HostingUserSignupForm model = CustomUser - success_url = reverse_lazy('hosting:ssh_keys') + success_url = reverse_lazy('hosting:dashboard') def get_success_url(self): next_url = self.request.session.get( From bec541c06a4b574d7ccc6b53d44e2f65e3570a18 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 27 Dec 2017 08:33:53 +0100 Subject: [PATCH 09/71] Add get method to hosting.SignupView and cache_control --- hosting/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hosting/views.py b/hosting/views.py index 02e30808..7d60d7b4 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -239,6 +239,12 @@ class SignupView(CreateView): return HttpResponseRedirect(reverse_lazy('hosting:signup-validate')) + @cache_control(no_cache=True, must_revalidate=True, no_store=True) + def get(self, request, *args, **kwargs): + if self.request.user.is_authenticated(): + return HttpResponseRedirect(self.get_success_url()) + return super(SignupView, self).get(request, *args, **kwargs) + class SignupValidateView(TemplateView): template_name = "hosting/signup_validate.html" From 98e06686f9a556614301a5605de12be4b100a7f7 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 27 Dec 2017 09:03:17 +0100 Subject: [PATCH 10/71] Add get method and cache_control to SignupValidatedView --- hosting/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hosting/views.py b/hosting/views.py index 7d60d7b4..76be4a67 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -316,6 +316,12 @@ class SignupValidatedView(SignupValidateView): context['section_title'] = section_title return context + @cache_control(no_cache=True, must_revalidate=True, no_store=True) + def get(self, request, *args, **kwargs): + if self.request.user.is_authenticated(): + return HttpResponseRedirect(reverse_lazy('hosting:dashboard')) + return super(SignupValidatedView, self).get(request, *args, **kwargs) + class ResendActivationEmailView(ResendActivationLinkViewMixin): template_name = 'hosting/resend_activation_link.html' From ab06eeff674ce7b59609957619eadf5a0e22fff7 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 27 Dec 2017 09:04:58 +0100 Subject: [PATCH 11/71] Add cache_control to SSHKEyCreateView and SettingsView post methods --- hosting/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hosting/views.py b/hosting/views.py index 76be4a67..0b258536 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -547,6 +547,7 @@ class SSHKeyCreateView(LoginRequiredMixin, FormView): def get(self, request, *args, **kwargs): return render(request, self.template_name) + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def post(self, request, *args, **kwargs): form = self.get_form() required = 'add_ssh' in self.request.POST @@ -596,6 +597,7 @@ class SettingsView(LoginRequiredMixin, FormView): def get(self, request, *args, **kwargs): return render(request, self.template_name) + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def post(self, request, *args, **kwargs): form = self.get_form() if form.is_valid(): From 14ff876fbf9c984ce54a22ed1d913bb43441b993 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 27 Dec 2017 09:06:46 +0100 Subject: [PATCH 12/71] Add cache_control to PaymentVMView and OrdersHostingDetailView --- hosting/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosting/views.py b/hosting/views.py index 0b258536..26adb834 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -660,11 +660,13 @@ class PaymentVMView(LoginRequiredMixin, FormView): return context + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def get(self, request, *args, **kwargs): if 'next' in request.session: del request.session['next'] return self.render_to_response(self.get_context_data()) + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def post(self, request, *args, **kwargs): form = self.get_form() if form.is_valid(): @@ -792,6 +794,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView): context['vm'] = self.request.session.get('specs') return context + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def get(self, request, *args, **kwargs): if not self.kwargs.get('pk'): if 'specs' not in self.request.session: @@ -813,6 +816,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView): ) return self.render_to_response(context) + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def post(self, request): template = request.session.get('template') specs = request.session.get('specs') From 639e4cf414aaddd374e51286f5d2d02533d0f9c7 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 27 Dec 2017 09:09:54 +0100 Subject: [PATCH 13/71] Add get method and cache_control to OrdersHostingListView --- hosting/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosting/views.py b/hosting/views.py index 26adb834..b6d65455 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -923,6 +923,10 @@ class OrdersHostingListView(LoginRequiredMixin, ListView): self.queryset = HostingOrder.objects.filter(customer__user=user) return super(OrdersHostingListView, self).get_queryset() + @cache_control(no_cache=True, must_revalidate=True, no_store=True) + def get(self, request, *args, **kwargs): + return super(OrdersHostingListView, self).get(request, *args, **kwargs) + class OrdersHostingDeleteView(LoginRequiredMixin, DeleteView): login_url = reverse_lazy('hosting:login') From 1395c04a001033bc0813e4ada4f509dc7e90f85f Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 27 Dec 2017 09:10:41 +0100 Subject: [PATCH 14/71] Add cache_control to CreateVirtualMachinesView and VirtualMachineView --- hosting/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hosting/views.py b/hosting/views.py index b6d65455..f43221c6 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -988,10 +988,12 @@ class CreateVirtualMachinesView(LoginRequiredMixin, View): if (value > 2000) or (value < 10): raise ValidationError(_('Invalid storage size')) + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def get(self, request, *args, **kwargs): context = {'templates': VMTemplate.objects.all()} return render(request, self.template_name, context) + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def post(self, request): cores = request.POST.get('cpu') cores_field = forms.IntegerField(validators=[self.validate_cores]) @@ -1114,6 +1116,7 @@ class VirtualMachineView(LoginRequiredMixin, View): return render(request, self.template_name, context) + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def post(self, request, *args, **kwargs): response = {'status': False} admin_email_body = {} From d85e1c671b3078341d03790e4d79ad384386fa3f Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Wed, 28 Feb 2018 04:09:19 +0530 Subject: [PATCH 15/71] All major DCL plugins added --- datacenterlight/cms_models.py | 104 +++++++ datacenterlight/cms_plugins.py | 95 +++++++ .../0012_dclcalculatorpluginmodel.py | 134 +++++++++ datacenterlight/models.py | 3 + .../datacenterlight/css/header-slider.css | 164 +++++++++++ .../datacenterlight/css/landing-page.css | 177 +++++------- .../static/datacenterlight/js/main.js | 2 +- .../templates/datacenterlight/base.html | 4 +- .../templates/datacenterlight/cms/base.html | 75 +++++ .../datacenterlight/cms/calculator.html | 25 ++ .../datacenterlight/cms/contact.html | 35 +++ .../templates/datacenterlight/cms/footer.html | 15 + .../templates/datacenterlight/cms/link.html | 5 + .../templates/datacenterlight/cms/navbar.html | 64 +++++ .../datacenterlight/cms/navbar_dropdown.html | 10 + .../datacenterlight/cms/section.html | 27 ++ .../datacenterlight/cms/section_icon.html | 3 + .../datacenterlight/cms/section_image.html | 6 + .../datacenterlight/contact_form.html | 6 +- .../includes/_calculator_form.html | 3 - .../datacenterlight/includes/_footer.html | 1 - .../templates/datacenterlight/index.html | 91 +++---- .../datacenterlight/whydatacenterlight.html | 257 +++++++++--------- datacenterlight/views.py | 8 +- dynamicweb/settings/base.py | 42 ++- 25 files changed, 1052 insertions(+), 304 deletions(-) create mode 100644 datacenterlight/cms_models.py create mode 100644 datacenterlight/cms_plugins.py create mode 100644 datacenterlight/migrations/0012_dclcalculatorpluginmodel.py create mode 100644 datacenterlight/static/datacenterlight/css/header-slider.css create mode 100644 datacenterlight/templates/datacenterlight/cms/base.html create mode 100644 datacenterlight/templates/datacenterlight/cms/calculator.html create mode 100644 datacenterlight/templates/datacenterlight/cms/contact.html create mode 100644 datacenterlight/templates/datacenterlight/cms/footer.html create mode 100644 datacenterlight/templates/datacenterlight/cms/link.html create mode 100644 datacenterlight/templates/datacenterlight/cms/navbar.html create mode 100644 datacenterlight/templates/datacenterlight/cms/navbar_dropdown.html create mode 100644 datacenterlight/templates/datacenterlight/cms/section.html create mode 100644 datacenterlight/templates/datacenterlight/cms/section_icon.html create mode 100644 datacenterlight/templates/datacenterlight/cms/section_image.html diff --git a/datacenterlight/cms_models.py b/datacenterlight/cms_models.py new file mode 100644 index 00000000..3db5b969 --- /dev/null +++ b/datacenterlight/cms_models.py @@ -0,0 +1,104 @@ +from djangocms_text_ckeditor.fields import HTMLField +from cms.models.pluginmodel import CMSPlugin +from django.db import models +from django.utils.safestring import mark_safe +from filer.fields.image import FilerImageField + +# Models for CMS Plugins + + +class DCLSectionPluginModel(CMSPlugin): + heading = models.CharField( + blank=True, null=True, max_length=100, + help_text='An optional heading for the Section', + ) + content = HTMLField() + TEXT_DIRECTIONS = ( + ('left', 'Left'), + ('right', 'Right') + ) + text_direction = models.CharField( + choices=TEXT_DIRECTIONS, max_length=10, default=True, + help_text='The alignment of text in the section' + ) + + +class DCLLinkPluginModel(CMSPlugin): + target = models.CharField( + max_length=100, + help_text='Url or #id to navigate to' + ) + text = models.CharField( + max_length=50, + help_text='Text for the menu item' + ) + title = models.CharField( + blank=True, null=True, max_length=100, + help_text=( + 'Optional title text, that will be shown when a user ' + 'hovers over the link' + ) + ) + separator = models.BooleanField( + default=False, + help_text='Select to include a separator after the previous link' + ) + + +class DCLNavbarDropdownPluginModel(CMSPlugin): + target = models.URLField( + blank=True, null=True, max_length=100, + help_text='Optional Url or #id to navigate on click' + ) + text = models.CharField( + max_length=50, + help_text='Text for the dropdown toggle' + ) + + +class DCLContactPluginModel(CMSPlugin): + heading = models.CharField(max_length=100, default="Contact", blank=True) + organization_name = models.CharField( + max_length=100, default="ungleich GmbH", blank=True + ) + email = models.EmailField(max_length=200, default="info@ungleich.ch") + address = models.CharField( + max_length=100, default="In der Au 7, Schwanden 8762", blank=True + ) + country = models.CharField( + max_length=100, default="Switzerland", blank=True + ) + form_header = models.CharField( + max_length=100, default="Send us a message.", blank=True + ) + + +class DCLFooterPluginModel(CMSPlugin): + copyright_label = models.CharField( + max_length=100, default='ungleich GmbH', blank=True, + help_text='Name of the company alongside the copyright year' + ) + + +class DCLSectionIconPluginModel(CMSPlugin): + fontawesome_icon_name = models.CharField( + max_length=30, + help_text=mark_safe( + 'Name of the fontawesome icon to use. ' + 'Refer docs.' + ) + ) + + +class DCLSectionImagePluginModel(CMSPlugin): + image = FilerImageField( + on_delete=models.CASCADE, + help_text=( + 'Image file to be used in section. Add multiple plugins ' + 'to add more than one image' + ) + ) + caption = models.CharField( + max_length=100, null=True, blank=True, + help_text='Optional caption for the image.' + ) diff --git a/datacenterlight/cms_plugins.py b/datacenterlight/cms_plugins.py new file mode 100644 index 00000000..36fcca17 --- /dev/null +++ b/datacenterlight/cms_plugins.py @@ -0,0 +1,95 @@ +from cms.plugin_base import CMSPluginBase +from cms.plugin_pool import plugin_pool +from cms.models.pluginmodel import CMSPlugin + +from .cms_models import ( + DCLSectionPluginModel, DCLLinkPluginModel, + DCLNavbarDropdownPluginModel, DCLContactPluginModel, + DCLFooterPluginModel, DCLSectionIconPluginModel, + DCLSectionImagePluginModel +) + + +@plugin_pool.register_plugin +class DCLCalculatorPlugin(CMSPluginBase): + module = "Datacenterlight" + model = DCLSectionPluginModel + render_template = "datacenterlight/cms/calculator.html" + cache = False + + +@plugin_pool.register_plugin +class DCLSectionPlugin(CMSPluginBase): + module = "Datacenterlight" + model = DCLSectionPluginModel + render_template = "datacenterlight/cms/section.html" + cache = False + allow_children = True + child_classes = ['DCLSectionIconPlugin', 'DCLSectionImagePlugin'] + + +@plugin_pool.register_plugin +class DCLNavbarPlugin(CMSPluginBase): + module = "Datacenterlight" + model = CMSPlugin + render_template = "datacenterlight/cms/navbar.html" + cache = False + allow_children = True + child_classes = ['DCLLinkPlugin', 'DCLNavbarDropdownPlugin'] + + +@plugin_pool.register_plugin +class DCLLinkPlugin(CMSPluginBase): + module = "Datacenterlight" + model = DCLLinkPluginModel + render_template = "datacenterlight/cms/link.html" + cache = False + require_parent = True + + +@plugin_pool.register_plugin +class DCLNavbarDropdownPlugin(CMSPluginBase): + module = "Datacenterlight" + model = DCLNavbarDropdownPluginModel + render_template = "datacenterlight/cms/navbar_dropdown.html" + cache = False + allow_children = True + child_classes = ['DCLLinkPlugin'] + require_parent = True + parent_classes = ['DCLNavbarPlugin'] + + +@plugin_pool.register_plugin +class DCLContactPlugin(CMSPluginBase): + module = "Datacenterlight" + model = DCLContactPluginModel + render_template = "datacenterlight/cms/contact.html" + cache = False + + +@plugin_pool.register_plugin +class DCLFooterPlugin(CMSPluginBase): + module = "Datacenterlight" + model = DCLFooterPluginModel + render_template = "datacenterlight/cms/footer.html" + cache = False + allow_children = True + child_classes = ['DCLLinkPlugin'] + + +@plugin_pool.register_plugin +class DCLSectionIconPlugin(CMSPluginBase): + module = "Datacenterlight" + model = DCLSectionIconPluginModel + render_template = "datacenterlight/cms/section_icon.html" + cache = False + require_parent = True + + +@plugin_pool.register_plugin +class DCLSectionImagePlugin(CMSPluginBase): + module = "Datacenterlight" + model = DCLSectionImagePluginModel + render_template = "datacenterlight/cms/section_image.html" + cache = False + require_parent = True diff --git a/datacenterlight/migrations/0012_dclcalculatorpluginmodel.py b/datacenterlight/migrations/0012_dclcalculatorpluginmodel.py new file mode 100644 index 00000000..ee872ee9 --- /dev/null +++ b/datacenterlight/migrations/0012_dclcalculatorpluginmodel.py @@ -0,0 +1,134 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2018-02-27 22:29 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import djangocms_text_ckeditor.fields +import filer.fields.image + + +class Migration(migrations.Migration): + + dependencies = [ + ('cms', '0014_auto_20160404_1908'), + ('datacenterlight', '0011_auto_20180220_1423'), + ('filer', '0005_auto_20171219_1856'), + ] + + operations = [ + migrations.CreateModel( + name='DCLSectionPluginModel', + fields=[ + ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, + parent_link=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), + ('heading', models.CharField( + blank=True, help_text='An optional heading for the Section', max_length=100, null=True)), + ('content', djangocms_text_ckeditor.fields.HTMLField()), + ('text_direction', models.CharField(choices=[ + ('left', 'Left'), ('right', 'Right')], default=True, help_text='The alignment of text in the section', max_length=10)), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + migrations.CreateModel( + name='DCLNavbarDropdownPluginModel', + fields=[ + ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, + parent_link=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), + ('text', models.CharField( + help_text='Text for the dropdown toggle', max_length=50)), + ('target', models.URLField( + blank=True, help_text='Optional Url or #id to navigate on click', max_length=100, null=True)), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + migrations.CreateModel( + name='DCLContactPluginModel', + fields=[ + ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, + parent_link=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), + ('heading', models.CharField( + blank=True, default='Contact', max_length=100)), + ('organization_name', models.CharField( + blank=True, default='ungleich GmbH', max_length=100)), + ('email', models.EmailField( + default='info@ungleich.ch', max_length=200)), + ('address', models.CharField(blank=True, + default='In der Au 7, Schwanden 8762', max_length=100)), + ('country', models.CharField(blank=True, + default='Switzerland', max_length=100)), + ('form_header', models.CharField(blank=True, + default='Send us a message.', max_length=100)), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + migrations.CreateModel( + name='DCLFooterPluginModel', + fields=[ + ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, + parent_link=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), + ('copyright_label', models.CharField(blank=True, default='ungleich GmbH', + help_text='Name of the company alongside the copyright year', max_length=100)), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + migrations.CreateModel( + name='DCLLinkPluginModel', + fields=[ + ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, + parent_link=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), + ('target', models.CharField( + help_text='Url or #id to navigate to', max_length=100)), + ('text', models.CharField( + help_text='Text for the menu item', max_length=50)), + ('title', models.CharField( + blank=True, help_text='Optional title text, that will be shown when a user hovers over the link', max_length=100, null=True)), + ('separator', models.BooleanField(default=False, + help_text='Select to include a separator after the previous link')), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + migrations.CreateModel( + name='DCLSectionIconPluginModel', + fields=[ + ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, + parent_link=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), + ('fontawesome_icon_name', models.CharField( + help_text='Name of the fontawesome icon to use. Refer docs.', max_length=30)), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + migrations.CreateModel( + name='DCLSectionImagePluginModel', + fields=[ + ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, + parent_link=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), + ('caption', models.CharField( + blank=True, help_text='Optional caption for the image.', max_length=100, null=True)), + ('image', filer.fields.image.FilerImageField(help_text='Image file to be used in section. Add multiple plugins to add more than one image', + on_delete=django.db.models.deletion.CASCADE, to='filer.Image')), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + ] diff --git a/datacenterlight/models.py b/datacenterlight/models.py index 2fbed5c8..6fcf24a9 100644 --- a/datacenterlight/models.py +++ b/datacenterlight/models.py @@ -29,3 +29,6 @@ class ContactUs(models.Model): email = models.CharField(max_length=250) message = models.TextField() field = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return self.name diff --git a/datacenterlight/static/datacenterlight/css/header-slider.css b/datacenterlight/static/datacenterlight/css/header-slider.css new file mode 100644 index 00000000..0aeaecd8 --- /dev/null +++ b/datacenterlight/static/datacenterlight/css/header-slider.css @@ -0,0 +1,164 @@ +.header_slider > .carousel .carousel-inner { + min-height: 95vh; + display: flex; +} + +.header_slider > .carousel .carousel-inner > .next, +.header_slider > .carousel .carousel-inner > .prev { + bottom: 0; +} + +.header_slider .carousel-indicators { + width: 100%; + left: 0; + margin-left: 0; +} + +.header_slider .carousel-indicators li { + margin-right: 25px; + width: 16px; + height: 16px; +} + +.header_slider .carousel-indicators li.active { + background-color: #ffffff; +} + +.header_slider .carousel-control { + display: none; +} + +.header_slider .carousel-control .fa { + font-size: 2em; + position: absolute; + top: 50%; + margin-top: -50px; +} + +.header_slider > .carousel .item { + background: rgba(0,0,0,0.5); + flex: 1; +} + +.header_slider > .carousel .item .container { + overflow: auto; + padding: 50px 20px 60px; + height: 100%; + display: flex; + flex-direction: column; + justify-content: flex-end; + /* background: rgba(0,0,0,0.5); */ +} + +.header_slider .intro-cap { + margin: 0; + text-align: right; + line-height: 1.1; + font-size: 23px; + padding-bottom: 10px; + color: #fff; +} + +.header_slider .btn-trans { + align-self: flex-end; + z-index: 2; + position: relative; +} + +@media (min-width: 768px) { + .header_slider .intro-cap { + font-size: 2.5em; + } + .header_slider .carousel-control { + width: 50px; + display: block; + } + .header_slider .carousel-control .fa-angle-left { + left: 25px; + } + .header_slider .carousel-control .fa-angle-right { + right: 25px; + } + .header_slider .carousel-control .fa { + font-size: 4em; + } + .header_slider > .carousel .item .container { + overflow: auto; + padding: 75px 50px; + } + .header_slider .btn-trans { + padding: 8px 15px; + min-width: 175px; + letter-spacing: 1px; + font-size: 1.25em; + } +} + +@media (min-width: 992px) { + .header_slider .intro-cap { + font-size: 3.25em; + } +} + +.header_slider .intro_lead { + color: #fff; + font-size: 1.55em; + text-align: right; + line-height: 1.4; + margin-bottom: 0; + padding-bottom: 10px; +} + +@media (max-width: 768px) { + .header_slider .intro_lead { + font-size: 1.1em; + margin-bottom: 15px; + } + + .header_slider .carousel-indicators li { + margin: 1px 25px; + width: 16px; + height: 16px; + } + .header_slider .carousel-indicators li.active { + margin: 0 25px; + width: 18px; + height: 18px; + } +} + +.bg_img { + position: absolute; + top: 0; + left: 0; + z-index: -1; + width: 100%; + height: 100%; + background-size: cover; + background-position: center; +} + +.bg_vid { + position: absolute; + top: 0; + left: 0; + z-index: -1; + width: 100%; + height: 100%; + background-size: cover; + background-position: center; +} + +@media (min-aspect-ratio: 16/9) { + .bg_vid > video { + width: 100%; + height: auto; + } +} + +@media (max-aspect-ratio: 16/9) { + .bg_vid > video { + /* width: auto; */ + height: 100%; + } +} diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 9c8b4acf..35d9d65d 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -19,17 +19,6 @@ textarea { * blue dark #29427A */ - -.lead { - font-size: 18px; -} - -@media (min-width: 768px) { - .lead-right { - text-align: right; - } -} - .btn { box-shadow: 0 1px 4px rgba(0, 0, 0, .6); } @@ -102,14 +91,32 @@ textarea { color: #fff; } -.navbar-transparent .navbar-nav>li>a { +.navbar-transparent .navbar-nav>li a { color: #fff; } -.navbar-transparent .navbar-nav>li>a:focus, -.navbar-transparent .navbar-nav>li>a:hover { +.navbar-transparent .navbar-nav>li a:focus, +.navbar-transparent .navbar-nav>li a:active, +.navbar-transparent .navbar-nav>li a:hover { color: #fff; background-color: transparent; + text-decoration: none; +} + +.navbar .dcl-link { + display: block; + padding: 15px; + color: #777; +} + +.navbar .dcl-link:focus, +.navbar .dcl-link:active, +.navbar .dcl-link:hover { + text-decoration: none; +} + +.navbar .dropdown-menu .dcl-link { + padding: 1px 10px; } .navbar-transparent .navbar-nav>li>.on-hover-border { @@ -195,8 +202,8 @@ textarea { margin-left: 15px; } -.dropdown-menu>li>a:focus, -.dropdown-menu>li>a:hover { +.dropdown-menu>li a:focus, +.dropdown-menu>li a:hover { background: transparent; text-decoration: underline !important; } @@ -354,11 +361,6 @@ textarea { font-weight: 300 !important; } -.new-lead { - font-weight: 300 !important; - font-size: 21px !important; -} - .split-section .split-text .split-title { position: relative; margin-bottom: 25px; @@ -394,46 +396,49 @@ textarea { text-align: left; } -.split-section.right .split-text { - text-align: right; -} - -.split-section.right .split-text ul { - text-align: left; -} - +.split-section.right .split-text ul, .split-section.left .split-text { text-align: left; } -.split-section.right .split-text .split-title h2 { +.split-section.right .split-text { text-align: right; } -.split-section.left .split-text .split-title h2 { - text-align: left; -} - -.split-section.right .split-text .split-title::before { +.split-section .split-text .split-title::before { content: ""; position: absolute; bottom: 0; background: #29427A; height: 7px; width: 70px; + left: auto; +} + +.split-section.right .split-text .split-title::before { right: 0; } .split-section.left .split-text .split-title::before { - content: ""; - position: absolute; - bottom: 0; - background: #29427A; - height: 7px; - width: 70px; left: 0; } +.section-figure { + display: flex; + flex-wrap: wrap; +} + +.section-figure .cms-plugin { + padding: 10px; + flex-basis: 50%; +} + +@media (max-width: 420px) { + .section-figure .cms-plugin { + flex-basis: 100%; + } +} + .pricing-section { padding: 80px 0 !important; background: -webkit-linear-gradient(top, #f0f4f7, #fff) no-repeat; @@ -461,8 +466,6 @@ textarea { padding: 15px 40px; } -.pricing-section .card .title h3 {} - .pricing-section .card .price { background: #5A74AF; padding: 22px; @@ -792,43 +795,11 @@ tech-sub-sec h2 { /*Pricing page*/ .price-calc-section { - padding: 80px 40px !important; - background: -webkit-linear-gradient(top, #f0f4f7, #fff) no-repeat; - background: linear-gradient(to bottom, #f0f4f7, #fff) no-repeat; display: flex; } -.price-calc-section .text { - width: 50%; -} - -.price-calc-section .text .section-heading { - font-size: 48px; - line-height: 48px; - padding-bottom: 27px; - color: #3a3a3a; - letter-spacing: 1px; - position: relative; - text-align: right; -} - -.price-calc-section .text .description { - font-size: 20px; - text-align: right; -} - -.price-calc-section .text .section-heading::before { - content: ""; - position: absolute; - bottom: 0; - background: #29427A; - height: 7px; - width: 70px; - right: 0; -} - .price-calc-section .card { - width: 50%; + width: 100%; margin: 0 auto; background: #fff; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); @@ -839,21 +810,6 @@ tech-sub-sec h2 { position: relative; } -.price-calc-section .landing { - width: 100% !important; -} - -.no-padding { - padding: 0 !important; -} - -.price-calc-section .card .img-beta { - position: absolute; - top: 5px; - width: 60px; - left: 3px; -} - .price-calc-section .card .title { padding: 15px 40px; } @@ -950,8 +906,6 @@ tech-sub-sec h2 { } - - /*Changed class****.price-calc-section .card .description.input input*/ .price-calc-section .card .description input { @@ -1009,14 +963,17 @@ tech-sub-sec h2 { } @media(max-width:991px) { - .pricing-section .text { - text-align: center; + .pricing-section .split-text { + text-align: center !important; margin-bottom: 40px; } - .pricing-section .text .section-heading::before { - left: 50%; + .pricing-section .split-text .split-title::before { + left: 50% !important; transform: translate(-50%, 0); } + .pricing-section .split-description { + width: 100% !important; + } } @media(max-width:767px) { @@ -1139,7 +1096,7 @@ tech-sub-sec h2 { } .price-calc-section { flex-direction: column; - padding: 60px 10px !important; + /* padding: 60px 10px !important; */ } .price-calc-section .card { width: 90%; @@ -1210,11 +1167,6 @@ tech-sub-sec h2 { display: block; } -.content-section-a { - padding: 50px 0; - background-color: #f8f8f8; -} - .section-heading { margin-bottom: 30px; } @@ -1279,4 +1231,23 @@ footer { border-width: 0 3px 3px 0; /*Rotate the L 45 degrees to turn it into a checkmark*/ transform: rotate(45deg); +} + +footer .dcl-link-separator { + position: relative; + padding-left: 10px; +} + +footer .dcl-link-separator::before { + content: ""; + position: absolute; + display: inline-block; + top: 8px; + bottom: 0; + left: -3px; + right: 0; + width: 4px; + height: 4px; + border-radius: 100%; + background: #777; } \ No newline at end of file diff --git a/datacenterlight/static/datacenterlight/js/main.js b/datacenterlight/static/datacenterlight/js/main.js index d5deaa21..10412824 100644 --- a/datacenterlight/static/datacenterlight/js/main.js +++ b/datacenterlight/static/datacenterlight/js/main.js @@ -54,7 +54,7 @@ Nav panel classic --------------------------------------------- */ if (window.matchMedia("(min-width: 767px)").matches) { - $('ul.nav li.dropdown').hover(function() { + $('ul.nav .dropdown').hover(function() { $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn(500); }, function() { $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(500); diff --git a/datacenterlight/templates/datacenterlight/base.html b/datacenterlight/templates/datacenterlight/base.html index 15e66fc7..8bdfb65f 100644 --- a/datacenterlight/templates/datacenterlight/base.html +++ b/datacenterlight/templates/datacenterlight/base.html @@ -1,4 +1,4 @@ -{% load staticfiles i18n cms_tags sekizai_tags %} +{% load static i18n cms_tags sekizai_tags %} {% get_current_language as LANGUAGE_CODE %} @@ -22,6 +22,8 @@ {% block css_extra %} {% endblock css_extra %} + {% render_block "css" postprocessor "compressor.contrib.sekizai.compress" %} + {% render_block "js" postprocessor "compressor.contrib.sekizai.compress" %} diff --git a/datacenterlight/templates/datacenterlight/cms/base.html b/datacenterlight/templates/datacenterlight/cms/base.html new file mode 100644 index 00000000..1a2e7ae8 --- /dev/null +++ b/datacenterlight/templates/datacenterlight/cms/base.html @@ -0,0 +1,75 @@ +{% load static i18n cms_tags menu_tags sekizai_tags %} +{% get_current_language as LANGUAGE_CODE %} + + + + + + + + + + + {% page_attribute page_title %} + + + + + + + + + + + + {% render_block "css" postprocessor "compressor.contrib.sekizai.compress" %} + {% render_block "js" postprocessor "compressor.contrib.sekizai.compress" %} + + + + + + + + + + + + {% include "google_analytics.html" %} + + + + + {% cms_toolbar %} + + {% placeholder 'datacenterlight_navbar' %} + + {% placeholder 'Datacenterlight Header' or %} +
+
+

{% page_attribute page_title %}

+
+
+ {% endplaceholder %} + + {% placeholder 'datacenterlight_calculator' %} + + {% placeholder 'Datacenterlight Content' %} + + {% placeholder 'datacenterlight_footer'%} + + + + + + + + + + + + + diff --git a/datacenterlight/templates/datacenterlight/cms/calculator.html b/datacenterlight/templates/datacenterlight/cms/calculator.html new file mode 100644 index 00000000..64044a62 --- /dev/null +++ b/datacenterlight/templates/datacenterlight/cms/calculator.html @@ -0,0 +1,25 @@ +
+
+
+
+
+
+

{{ instance.heading }}

+
+
+
+ {{ instance.content }} +
+
+
+
+
+
+
+ {% include "datacenterlight/includes/_calculator_form.html" %} +
+
+
+
+
+
\ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/cms/contact.html b/datacenterlight/templates/datacenterlight/cms/contact.html new file mode 100644 index 00000000..32919668 --- /dev/null +++ b/datacenterlight/templates/datacenterlight/cms/contact.html @@ -0,0 +1,35 @@ +{% load i18n %} + +
+
+
+
+
+
+

{{ instance.contact_text }}

+
+
+
+

{{ instance.organization_name }}

+
+
+

{{ instance.email }}

+

{{ instance.address }}

+

{{ instance.country }}

+
+
+ +
+
+
+ {% include "datacenterlight/contact_form.html" with form_header=instance.form_header %} +
+
+
+
+
+
\ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/cms/footer.html b/datacenterlight/templates/datacenterlight/cms/footer.html new file mode 100644 index 00000000..2d92ff7e --- /dev/null +++ b/datacenterlight/templates/datacenterlight/cms/footer.html @@ -0,0 +1,15 @@ +{% load i18n cms_tags %} +
+
+
    + {% for plugin in instance.child_plugin_instances %} +
  • + {% render_plugin plugin %} +
  • + {% endfor %} +
+ +
+
\ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/cms/link.html b/datacenterlight/templates/datacenterlight/cms/link.html new file mode 100644 index 00000000..b3f398b2 --- /dev/null +++ b/datacenterlight/templates/datacenterlight/cms/link.html @@ -0,0 +1,5 @@ +{% load cms_tags %} + + + {{ instance.text }} + \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/cms/navbar.html b/datacenterlight/templates/datacenterlight/cms/navbar.html new file mode 100644 index 00000000..30624525 --- /dev/null +++ b/datacenterlight/templates/datacenterlight/cms/navbar.html @@ -0,0 +1,64 @@ +{% load static i18n custom_tags cms_tags %} +{% get_current_language as LANGUAGE_CODE %} + + \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/cms/navbar_dropdown.html b/datacenterlight/templates/datacenterlight/cms/navbar_dropdown.html new file mode 100644 index 00000000..1dbf5f28 --- /dev/null +++ b/datacenterlight/templates/datacenterlight/cms/navbar_dropdown.html @@ -0,0 +1,10 @@ +{% load cms_tags %} + + \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/cms/section.html b/datacenterlight/templates/datacenterlight/cms/section.html new file mode 100644 index 00000000..b1a25004 --- /dev/null +++ b/datacenterlight/templates/datacenterlight/cms/section.html @@ -0,0 +1,27 @@ +{% load cms_tags %} + +
+
+
+
+
+ {% for plugin in instance.child_plugin_instances %} + {% render_plugin plugin %} + {% endfor %} +
+
+
+
+
+

{{ instance.heading }}

+
+
+
+ {{ instance.content }} +
+
+
+
+
+
+
\ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/cms/section_icon.html b/datacenterlight/templates/datacenterlight/cms/section_icon.html new file mode 100644 index 00000000..c0d8feba --- /dev/null +++ b/datacenterlight/templates/datacenterlight/cms/section_icon.html @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/cms/section_image.html b/datacenterlight/templates/datacenterlight/cms/section_image.html new file mode 100644 index 00000000..d8bd5e6e --- /dev/null +++ b/datacenterlight/templates/datacenterlight/cms/section_image.html @@ -0,0 +1,6 @@ +
+ image + {% if instance.caption %} +
{{ instance.caption }}
+ {% endif %} +
\ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/contact_form.html b/datacenterlight/templates/datacenterlight/contact_form.html index 7b57f227..87848ff2 100644 --- a/datacenterlight/templates/datacenterlight/contact_form.html +++ b/datacenterlight/templates/datacenterlight/contact_form.html @@ -13,7 +13,11 @@
-

{% trans "Get in touch with us!" %}

+ {% if form_header %} +

{{ form_header }}

+ {% else %} +

{% trans "Get in touch with us!" %}

+ {% endif %}
diff --git a/datacenterlight/templates/datacenterlight/includes/_calculator_form.html b/datacenterlight/templates/datacenterlight/includes/_calculator_form.html index d1355245..1892c638 100644 --- a/datacenterlight/templates/datacenterlight/includes/_calculator_form.html +++ b/datacenterlight/templates/datacenterlight/includes/_calculator_form.html @@ -77,9 +77,6 @@ {% endfor %} - diff --git a/datacenterlight/templates/datacenterlight/includes/_footer.html b/datacenterlight/templates/datacenterlight/includes/_footer.html index 933755bf..828a5d19 100644 --- a/datacenterlight/templates/datacenterlight/includes/_footer.html +++ b/datacenterlight/templates/datacenterlight/includes/_footer.html @@ -1,5 +1,4 @@ {% load staticfiles i18n%} -{% get_current_language as LANGUAGE_CODE %}