From 9b6bb4eb262427d244689e404ec10068e59f27b2 Mon Sep 17 00:00:00 2001 From: Levi Date: Wed, 21 Jun 2017 11:45:35 -0500 Subject: [PATCH 01/50] changed UTC to localtime in ssh key view --- hosting/templates/hosting/base_short.html | 6 ++++++ hosting/templates/hosting/user_keys.html | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/hosting/templates/hosting/base_short.html b/hosting/templates/hosting/base_short.html index 6a2037f7..57bf384b 100644 --- a/hosting/templates/hosting/base_short.html +++ b/hosting/templates/hosting/base_short.html @@ -164,6 +164,12 @@ + + + + + + diff --git a/hosting/templates/hosting/user_keys.html b/hosting/templates/hosting/user_keys.html index 6dd2c823..42f85bdf 100644 --- a/hosting/templates/hosting/user_keys.html +++ b/hosting/templates/hosting/user_keys.html @@ -1,5 +1,6 @@ {% extends "hosting/base_short.html" %} {% load staticfiles bootstrap3 i18n %} +{% load tz %} {% block content %}
@@ -32,7 +33,8 @@ {% for user_key in keys %} {{user_key.name}} - {{user_key.created_at}} + + {{user_key.created_at|date:'Y-m-d H:i' }} Active @@ -92,5 +94,14 @@ {% endif %} + + {%endblock%} From 4f318a6f2df9f79ca59a6ba389c5aa93af3dedb6 Mon Sep 17 00:00:00 2001 From: Levi Date: Wed, 21 Jun 2017 11:48:11 -0500 Subject: [PATCH 02/50] changed UTC to localtime in ssh key view --- hosting/templates/hosting/user_keys.html | 1 - 1 file changed, 1 deletion(-) diff --git a/hosting/templates/hosting/user_keys.html b/hosting/templates/hosting/user_keys.html index 42f85bdf..8637fb81 100644 --- a/hosting/templates/hosting/user_keys.html +++ b/hosting/templates/hosting/user_keys.html @@ -1,6 +1,5 @@ {% extends "hosting/base_short.html" %} {% load staticfiles bootstrap3 i18n %} -{% load tz %} {% block content %}
From ed6fdcb049a2569fdc4e8d6d23227ce2bd0563dd Mon Sep 17 00:00:00 2001 From: Levi Date: Wed, 21 Jun 2017 12:26:09 -0500 Subject: [PATCH 03/50] fixed ssh key time --- hosting/templates/hosting/user_keys.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hosting/templates/hosting/user_keys.html b/hosting/templates/hosting/user_keys.html index 8637fb81..bea285f9 100644 --- a/hosting/templates/hosting/user_keys.html +++ b/hosting/templates/hosting/user_keys.html @@ -33,7 +33,7 @@ {{user_key.name}} - {{user_key.created_at|date:'Y-m-d H:i' }} + {{user_key.created_at|date:'Y-m-d H:i' }} Active @@ -95,9 +95,12 @@ From f1f6074c78dcdacb869a0b52b76faec45f7d62b9 Mon Sep 17 00:00:00 2001 From: Levi Date: Wed, 21 Jun 2017 12:49:29 -0500 Subject: [PATCH 04/50] fixed time --- hosting/templates/hosting/user_keys.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hosting/templates/hosting/user_keys.html b/hosting/templates/hosting/user_keys.html index bea285f9..a4a0c2cf 100644 --- a/hosting/templates/hosting/user_keys.html +++ b/hosting/templates/hosting/user_keys.html @@ -93,17 +93,23 @@ {% endif %} + + {%endblock%} From 339e20d0b7b2ca83a118964a08a86a0431e34420 Mon Sep 17 00:00:00 2001 From: Levi Date: Wed, 21 Jun 2017 13:24:38 -0500 Subject: [PATCH 05/50] changd date format on orders view --- hosting/templates/hosting/order_detail.html | 15 ++++++++++++++- hosting/templates/hosting/orders.html | 2 +- hosting/templates/hosting/user_keys.html | 2 -- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index 1eec7f99..c212d248 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -35,7 +35,7 @@
{% trans "Billed To:"%}
- {{order.created_at}}

+ {{order.created_at}}

{% trans "Status:"%}
+ + window.onload = function () { + var locale_date = new Date(document.getElementById("order-created_at").textContent + ' UTC'); + locale_date = moment(locale_date).format("YYYY-MM-DD h:mm:ss a"); + document.getElementById('order-created_at').innerHTML = locale_date; + + }; + + {%endblock%} + diff --git a/hosting/templates/hosting/orders.html b/hosting/templates/hosting/orders.html index b52e7fc0..99aab23e 100644 --- a/hosting/templates/hosting/orders.html +++ b/hosting/templates/hosting/orders.html @@ -24,7 +24,7 @@ {% for order in orders %} {{ order.id }} - {{ order.created_at }} + {{ order.created_at | date:"M d, Y" }} {{ order.price }} CHF {% if order.approved %} {% trans "Approved"%} diff --git a/hosting/templates/hosting/user_keys.html b/hosting/templates/hosting/user_keys.html index a4a0c2cf..571d423a 100644 --- a/hosting/templates/hosting/user_keys.html +++ b/hosting/templates/hosting/user_keys.html @@ -95,11 +95,9 @@ diff --git a/datacenterlight/templates/datacenterlight/includes/_google_analytics.html b/datacenterlight/templates/datacenterlight/includes/_google_analytics.html new file mode 100644 index 00000000..d074dfd3 --- /dev/null +++ b/datacenterlight/templates/datacenterlight/includes/_google_analytics.html @@ -0,0 +1,15 @@ + +{% if GOOGLE_ANALYTICS_PROPERTY_ID %} + +{% else %} + +{% endif %} + \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index cb412558..8b53df5d 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -2,7 +2,7 @@ {% load staticfiles bootstrap3 %} {% load i18n %} {% block content %} - +{% include 'datacenterlight/includes/_google_analytics.html' %}
{% if messages %}
diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index d276f022..f3a80470 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -161,6 +161,7 @@ TEMPLATES = [ "django.contrib.messages.context_processors.messages", 'sekizai.context_processors.sekizai', 'cms.context_processors.cms_settings', + 'datacenterlight.context_processor.google_analytics', ], }, }, @@ -509,3 +510,7 @@ OPENNEBULA_ENDPOINT = env('OPENNEBULA_ENDPOINT') # dcl email configurations DCL_TEXT = env('DCL_TEXT') DCL_SUPPORT_FROM_ADDRESS = env('DCL_SUPPORT_FROM_ADDRESS') + +# Settings for Google analytics +GOOGLE_ANALYTICS_PROPERTY_ID = 'UA-62285904-9' +GOOGLE_ANALYTICS_DOMAIN = 'auto' From a3c3a5cd2e1bece294cd6b22bdce9e4c1fe544de Mon Sep 17 00:00:00 2001 From: PCoder Date: Thu, 29 Jun 2017 13:04:13 +0530 Subject: [PATCH 11/50] Changed the way we get info in dcl order_detail template --- .../templates/datacenterlight/order_detail.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index cb412558..c2c15894 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -1,7 +1,8 @@ {% extends "hosting/base_short.html" %} {% load staticfiles bootstrap3 %} {% load i18n %} -{% block content %} +{% load custom_tags %} +{% block content %}
{% if messages %} @@ -27,15 +28,16 @@

{% trans "Billed To:"%}

- {{user.name}}
- {{order.billing_address.street_address}},{{order.billing_address.postal_code}}
- {{order.billing_address.city}}, {{order.billing_address.country}}. + {% with request.session.billing_address_data as billing_address %} + {{request.session.user.name}}
{{billing_address|get_value_from_dict:'street_address'}}, {{billing_address|get_value_from_dict:'postal_code'}}
+ {{billing_address|get_value_from_dict:'city'}}, {{billing_address|get_value_from_dict:'country'}}. + {% endwith %}
{% trans "Date"%}:
- {{order.created_at}}

+ {% now "jS F Y" %}

@@ -45,7 +47,7 @@
{% trans "Payment Method:"%}
{{order.cc_brand}} ending **** {{order.last4}}
- {{user.email}} + {{request.session.user.email}}
From 3313dab485979df7cc9f8fdf95e2a9a977dcdcf0 Mon Sep 17 00:00:00 2001 From: PCoder Date: Thu, 29 Jun 2017 13:05:06 +0530 Subject: [PATCH 12/50] Added get_value_from_dict filter to obtain values from a dict in templates --- datacenterlight/templatetags/custom_tags.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/datacenterlight/templatetags/custom_tags.py b/datacenterlight/templatetags/custom_tags.py index 915e68fe..e7b15b5b 100644 --- a/datacenterlight/templatetags/custom_tags.py +++ b/datacenterlight/templatetags/custom_tags.py @@ -21,4 +21,14 @@ def change_lang(context, lang=None, *args, **kwargs): activate(cur_language) - return "%s" % url \ No newline at end of file + return "%s" % url + +@register.filter('get_value_from_dict') +def get_value_from_dict(dict_data, key): + """ + usage example {{ your_dict|get_value_from_dict:your_key }} + """ + if key: + return dict_data.get(key) + else : + return None From a2153777e45c36307f8a1e9539c82e1521d14b49 Mon Sep 17 00:00:00 2001 From: PCoder Date: Thu, 29 Jun 2017 13:06:05 +0530 Subject: [PATCH 13/50] We do not have order created when in Order Confirmation page. So removed the id parameter in url --- datacenterlight/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenterlight/urls.py b/datacenterlight/urls.py index 65401b13..ca844278 100644 --- a/datacenterlight/urls.py +++ b/datacenterlight/urls.py @@ -9,7 +9,7 @@ urlpatterns = [ 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/(?P\d+)/?$', 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'), ] From cb6aeae1ae1e2a7f7c35cd61ed28ad84f4d9baa1 Mon Sep 17 00:00:00 2001 From: PCoder Date: Thu, 29 Jun 2017 13:08:24 +0530 Subject: [PATCH 14/50] Refactored the logic to OrderConfirmationView from the PaymentOrderView --- datacenterlight/views.py | 227 ++++++++++++++++++++------------------- 1 file changed, 115 insertions(+), 112 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index e4329b89..628d0c03 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -13,11 +13,12 @@ from django.core.exceptions import ValidationError from django.views.decorators.cache import cache_control from django.conf import settings from utils.forms import BillingAddressForm, UserBillingAddressForm +from utils.models import BillingAddress from membership.models import StripeCustomer from hosting.models import HostingOrder, HostingBill from utils.stripe_utils import StripeUtils from datetime import datetime -from membership.models import CustomUser, StripeCustomer +from membership.models import CustomUser, StripeCustomer, CreditCards from opennebula_api.models import OpenNebulaManager from opennebula_api.serializers import VirtualMachineTemplateSerializer, VirtualMachineSerializer @@ -322,13 +323,9 @@ class PaymentOrderView(FormView): if form.is_valid(): # Get billing address data billing_address_data = form.cleaned_data - context = self.get_context_data() - template = request.session.get('template') - specs = request.session.get('specs') - user = request.session.get('user') - vm_template_id = template.get('id', 1) - final_price = specs.get('price') token = form.cleaned_data.get('token') + user = request.session.get('user') + try: custom_user = CustomUser.objects.get(email=user.get('email')) except CustomUser.DoesNotExist: @@ -340,99 +337,20 @@ class PaymentOrderView(FormView): app='dcl', base_url=None, send_email=False) - # Get or create stripe customer customer = StripeCustomer.get_or_create(email=user.get('email'), - token=token) + token=token) if not customer: form.add_error("__all__", "Invalid credit card") return self.render_to_response(self.get_context_data(form=form)) # Create Billing Address billing_address = form.save() - - # Make stripe charge to a customer - stripe_utils = StripeUtils() - charge_response = stripe_utils.make_charge(amount=final_price, - customer=customer.stripe_id) - charge = charge_response.get('response_object') - - # Check if the payment was approved - if not charge: - context.update({ - 'paymentError': charge_response.get('error'), - 'form': form - }) - return render(request, self.template_name, context) - - charge = charge_response.get('response_object') - - # Create OpenNebulaManager - manager = OpenNebulaManager(email=settings.OPENNEBULA_USERNAME, - password=settings.OPENNEBULA_PASSWORD) - - # Create a vm using logged user - vm_id = manager.create_vm( - template_id=vm_template_id, - specs=specs, - vm_name="{email}-{template_name}-{date}".format( - email=user.get('email'), - template_name=template.get('name'), - date=int(datetime.now().strftime("%s"))) - ) - - # Create a Hosting Order - order = HostingOrder.create( - price=final_price, - vm_id=vm_id, - customer=customer, - billing_address=billing_address - ) - - # Create a Hosting Bill - bill = HostingBill.create( - customer=customer, billing_address=billing_address) - - # Create Billing Address for User if he does not have one - if not customer.user.billing_addresses.count(): - billing_address_data.update({ - 'user': customer.user.id - }) - billing_address_user_form = UserBillingAddressForm( - billing_address_data) - billing_address_user_form.is_valid() - billing_address_user_form.save() - - # Associate an order with a stripe payment - order.set_stripe_charge(charge) - - # If the Stripe payment was successed, set order status approved - order.set_approved() - - vm = VirtualMachineSerializer(manager.get_vm(vm_id)).data - - context = { - 'name': user.get('name'), - 'email': user.get('email'), - 'cores': specs.get('cpu'), - 'memory': specs.get('memory'), - 'storage': specs.get('disk_size'), - 'price': specs.get('price'), - 'template': template.get('name'), - 'vm.name': vm['name'], - 'vm.id': vm['vm_id'], - 'order.id': order.id - } - email_data = { - 'subject': "Data Center Light Order from %s" % context['email'], - 'from_email': '(Data Center Light) Data Center Light Support ', - 'to': ['info@ungleich.ch'], - 'body': "\n".join(["%s=%s" % (k, v) for (k, v) in context.items()]), - 'reply_to': [context['email']], - } - email = EmailMessage(**email_data) - email.send() - return HttpResponseRedirect(reverse('datacenterlight:order_confirmation', kwargs={'pk': order.id})) + request.session['billing_address_data'] = billing_address_data + request.session['billing_address'] = billing_address.id + request.session['token'] = token + request.session['customer'] = customer.id + return HttpResponseRedirect(reverse('datacenterlight:order_confirmation')) else: return self.form_invalid(form) @@ -440,25 +358,110 @@ class OrderConfirmationView(DetailView): template_name = "datacenterlight/order_detail.html" context_object_name = "order" model = HostingOrder - def get_context_data(self, **kwargs): - # Get context - context = super(DetailView, self).get_context_data(**kwargs) - obj = self.get_object() + + def get(self, request, *args, **kwargs): + if 'specs' not in request.session or 'user' not in request.session: + return HttpResponseRedirect(reverse('datacenterlight:index')) + print(request.session.get('billing_address_data')) + print(request.session.get('specs')) + stripe_customer_id = request.session.get('customer') + customer = StripeCustomer.objects.filter(id=stripe_customer_id).first() + custom_user = CustomUser.objects.get(email=request.session.get('user').get('email')) + print(custom_user) + obj = CreditCards.objects.filter(user_id=custom_user.id).first() + print(obj) + return render(request, self.template_name, {}) + + def post(self, request, *args, **kwargs): + template = request.session.get('template') + specs = request.session.get('specs') + user = request.session.get('user') + customer = request.session.get('customer') + billing_address_data = request.session.get('billing_address_data') + billing_address_id = request.session.get('billing_address') + billing_address = BillingAddress.objects.filter(id=billing_address_id) + token = request.session.get('token') + vm_template_id = template.get('id', 1) + final_price = specs.get('price') + + # Make stripe charge to a customer + stripe_utils = StripeUtils() + charge_response = stripe_utils.make_charge(amount=final_price, + customer=customer.stripe_id) + charge = charge_response.get('response_object') + + # Check if the payment was approved + if not charge: + context.update({ + 'paymentError': charge_response.get('error'), + 'form': form + }) + return render(request, self.template_name, context) + + charge = charge_response.get('response_object') + + # Create OpenNebulaManager manager = OpenNebulaManager(email=settings.OPENNEBULA_USERNAME, password=settings.OPENNEBULA_PASSWORD) - try: - vm = manager.get_vm(obj.vm_id) - context['vm'] = VirtualMachineSerializer(vm).data - context['next_url'] = reverse('datacenterlight:order_success') - except WrongIdError: - messages.error(self.request, - 'The VM you are looking for is unavailable at the moment. \ - Please contact Data Center Light support.' - ) - self.kwargs['error'] = 'WrongIdError' - context['error'] = 'WrongIdError' - except ConnectionRefusedError: - messages.error(self.request, - 'In order to create a VM, you need to create/upload your SSH KEY first.' - ) - return context + + # Create a vm using logged user + vm_id = manager.create_vm( + template_id=vm_template_id, + specs=specs, + vm_name="{email}-{template_name}-{date}".format( + email=user.get('email'), + template_name=template.get('name'), + date=int(datetime.now().strftime("%s"))) + ) + + # Create a Hosting Order + order = HostingOrder.create( + price=final_price, + vm_id=vm_id, + customer=customer, + billing_address=billing_address + ) + + # Create a Hosting Bill + bill = HostingBill.create( + customer=customer, billing_address=billing_address) + + # Create Billing Address for User if he does not have one + if not customer.user.billing_addresses.count(): + billing_address_data.update({ + 'user': customer.user.id + }) + billing_address_user_form = UserBillingAddressForm( + billing_address_data) + billing_address_user_form.is_valid() + billing_address_user_form.save() + + # Associate an order with a stripe payment + order.set_stripe_charge(charge) + + # If the Stripe payment was successed, set order status approved + order.set_approved() + + vm = VirtualMachineSerializer(manager.get_vm(vm_id)).data + + context = { + 'name': user.get('name'), + 'email': user.get('email'), + 'cores': specs.get('cpu'), + 'memory': specs.get('memory'), + 'storage': specs.get('disk_size'), + 'price': specs.get('price'), + 'template': template.get('name'), + 'vm.name': vm['name'], + 'vm.id': vm['vm_id'], + 'order.id': order.id + } + email_data = { + 'subject': "Data Center Light Order from %s" % context['email'], + 'from_email': '(Data Center Light) Data Center Light Support ', + 'to': ['info@ungleich.ch'], + 'body': "\n".join(["%s=%s" % (k, v) for (k, v) in context.items()]), + 'reply_to': [context['email']], + } + email = EmailMessage(**email_data) + email.send() From b649bcd87e5d431eb7ebeb3d9d9d71eaf75f8158 Mon Sep 17 00:00:00 2001 From: Pcoder Date: Thu, 29 Jun 2017 21:24:04 +0200 Subject: [PATCH 15/50] Fixed a typo --- hosting/templates/hosting/order_detail.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index 3f64c54d..4418ee3d 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -34,7 +34,7 @@
- {% trans "Billed To:"%}
+ {% trans "Date"%}
{{order.created_at|date:'Y-m-d H:i'}}

{% trans "Status:"%}
- {% trans "Date"%}
+ {% trans "Date"%}:
{{order.created_at|date:'Y-m-d H:i'}}

{% trans "Status:"%}
+ + {% include "google_analytics.html" %} + @@ -47,9 +50,6 @@ {% include "datacenterlight/includes/_footer.html" %} - - {% include "datacenterlight/includes/_google_analytics.html" %} - diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index 8b53df5d..24511463 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -1,8 +1,7 @@ {% extends "hosting/base_short.html" %} {% load staticfiles bootstrap3 %} {% load i18n %} -{% block content %} -{% include 'datacenterlight/includes/_google_analytics.html' %} +{% block content %}
{% if messages %}
diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index f3a80470..31723853 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -138,6 +138,7 @@ TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(PROJECT_DIR, 'cms_templates/'), + os.path.join(PROJECT_DIR, 'templates'), os.path.join(PROJECT_DIR, 'cms_templates/djangocms_blog/'), os.path.join(PROJECT_DIR, 'membership'), os.path.join(PROJECT_DIR, 'hosting/templates/'), @@ -161,7 +162,7 @@ TEMPLATES = [ "django.contrib.messages.context_processors.messages", 'sekizai.context_processors.sekizai', 'cms.context_processors.cms_settings', - 'datacenterlight.context_processor.google_analytics', + 'utils.context_processor.google_analytics', ], }, }, @@ -512,5 +513,7 @@ DCL_TEXT = env('DCL_TEXT') DCL_SUPPORT_FROM_ADDRESS = env('DCL_SUPPORT_FROM_ADDRESS') # Settings for Google analytics -GOOGLE_ANALYTICS_PROPERTY_ID = 'UA-62285904-9' -GOOGLE_ANALYTICS_DOMAIN = 'auto' +GOOGLE_ANALYTICS_PROPERTY_IDS = { + 'datacenterlight.ch': 'UA-62285904-9', + 'digitalglarus.ch': 'UA-62285904-2' +} diff --git a/datacenterlight/templates/datacenterlight/includes/_google_analytics.html b/templates/google_analytics.html similarity index 75% rename from datacenterlight/templates/datacenterlight/includes/_google_analytics.html rename to templates/google_analytics.html index d074dfd3..64dbae40 100644 --- a/datacenterlight/templates/datacenterlight/includes/_google_analytics.html +++ b/templates/google_analytics.html @@ -1,4 +1,3 @@ - {% if GOOGLE_ANALYTICS_PROPERTY_ID %} {% else %} -{% endif %} - \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/datacenterlight/context_processor.py b/utils/context_processor.py similarity index 52% rename from datacenterlight/context_processor.py rename to utils/context_processor.py index b49ea364..43c27336 100644 --- a/datacenterlight/context_processor.py +++ b/utils/context_processor.py @@ -6,11 +6,11 @@ def google_analytics(request): Use the variables returned in this function to render your Google Analytics tracking code template. """ - ga_prop_id = getattr(settings, 'GOOGLE_ANALYTICS_PROPERTY_ID', False) - ga_domain = getattr(settings, 'GOOGLE_ANALYTICS_DOMAIN', False) - if not settings.DEBUG and ga_prop_id and ga_domain: + host = request.get_host() + ga_prop_id = getattr(settings, 'GOOGLE_ANALYTICS_PROPERTY_IDS', False).get(host) + print(ga_prop_id) + if ga_prop_id: return { - 'GOOGLE_ANALYTICS_PROPERTY_ID': ga_prop_id, - 'GOOGLE_ANALYTICS_DOMAIN': ga_domain, + 'GOOGLE_ANALYTICS_PROPERTY_ID': ga_prop_id } - return {} + return {} \ No newline at end of file From ebf8b0646d7a3ca94b79307dee7406ad497a15ff Mon Sep 17 00:00:00 2001 From: Andrii Marynets Date: Fri, 30 Jun 2017 01:33:12 +0300 Subject: [PATCH 18/50] Fix not add analytics if DEBUG=True --- utils/context_processor.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/context_processor.py b/utils/context_processor.py index 43c27336..740591ba 100644 --- a/utils/context_processor.py +++ b/utils/context_processor.py @@ -8,9 +8,8 @@ def google_analytics(request): """ host = request.get_host() ga_prop_id = getattr(settings, 'GOOGLE_ANALYTICS_PROPERTY_IDS', False).get(host) - print(ga_prop_id) - if ga_prop_id: + if not settings.DEBUG and ga_prop_id: return { 'GOOGLE_ANALYTICS_PROPERTY_ID': ga_prop_id } - return {} \ No newline at end of file + return {} From d0376f35f8e1ab4f013fc72dd35fa8bb2ca156b5 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 30 Jun 2017 11:05:34 +0530 Subject: [PATCH 19/50] Now getting info in Order Confirmation from session and context --- .../datacenterlight/order_detail.html | 60 ++++++++++--------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index c2c15894..1c3dd6b7 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -20,20 +20,20 @@ {% if not error %}
-
-

{% trans "Confirm Order"%}

{% trans "Order #"%} {{order.id}}

-
-
-
-
-
+
+

{% trans "Confirm Order"%}

+
+
+
+
+

{% trans "Billed To:"%}

{% with request.session.billing_address_data as billing_address %} - {{request.session.user.name}}
{{billing_address|get_value_from_dict:'street_address'}}, {{billing_address|get_value_from_dict:'postal_code'}}
+ {{request.session.user.name}}
{{billing_address|get_value_from_dict:'street_address'}}, {{billing_address|get_value_from_dict:'postal_code'}}
{{billing_address|get_value_from_dict:'city'}}, {{billing_address|get_value_from_dict:'country'}}. {% endwith %} -
-
+
+
{% trans "Date"%}:
@@ -41,17 +41,17 @@
-
-
-
-
- {% trans "Payment Method:"%}
- {{order.cc_brand}} ending **** {{order.last4}}
- {{request.session.user.email}} -
-
-
-
+
+
+
+
+ {% trans "Payment Method:"%}
+ {{cc_brand}} ending **** {{cc_last4}}
+ {{request.session.user.email}} +
+
+
+
@@ -59,19 +59,21 @@

{% trans "Order summary"%}


-

{% trans "Cores"%} {{vm.cores}}

-
-

{% trans "Memory"%} {{vm.memory}} GB

-
-

{% trans "Disk space"%} {{vm.disk_size}} GB

-
-

{% trans "Total"%}

{{vm.price}} CHF

+ {% with request.session.specs as vm %} +

{% trans "Cores"%} {{vm.cpu}}

+
+

{% trans "Memory"%} {{vm.memory}} GB

+
+

{% trans "Disk space"%} {{vm.disk_size}} GB

+
+

{% trans "Total"%}

{{vm.price}} CHF

+ {% endwith %}

{% url 'datacenterlight:payment' as payment_url %} {% if payment_url in request.META.HTTP_REFERER %} {% endif %}
From 4c3d8627b161204e4c10e10f8f2f91e051fe2e12 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 30 Jun 2017 11:06:58 +0530 Subject: [PATCH 20/50] Added code to fetch cc data and put in context --- datacenterlight/views.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 628d0c03..8e8858c6 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -362,15 +362,15 @@ class OrderConfirmationView(DetailView): def get(self, request, *args, **kwargs): if 'specs' not in request.session or 'user' not in request.session: return HttpResponseRedirect(reverse('datacenterlight:index')) - print(request.session.get('billing_address_data')) - print(request.session.get('specs')) stripe_customer_id = request.session.get('customer') customer = StripeCustomer.objects.filter(id=stripe_customer_id).first() - custom_user = CustomUser.objects.get(email=request.session.get('user').get('email')) - print(custom_user) - obj = CreditCards.objects.filter(user_id=custom_user.id).first() - print(obj) - return render(request, self.template_name, {}) + stripe_utils = StripeUtils() + card_details = stripe_utils.get_card_details(customer.stripe_id, request.session.get('token')) + context = { + 'cc_last4' : card_details.get('response_object').get('last4'), + 'cc_brand' : card_details.get('response_object').get('brand') + } + return render(request, self.template_name, context) def post(self, request, *args, **kwargs): template = request.session.get('template') From d161a285b8a26b47a3ff70e1bd9bde6e75440d16 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 30 Jun 2017 11:08:00 +0530 Subject: [PATCH 21/50] Added get_card_details function to stripe_utils --- utils/stripe_utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/utils/stripe_utils.py b/utils/stripe_utils.py index 29b45d8e..3b20b708 100644 --- a/utils/stripe_utils.py +++ b/utils/stripe_utils.py @@ -77,6 +77,16 @@ class StripeUtils(object): } return new_card_data + @handleStripeError + def get_card_details(self, customer_id, token): + customer = stripe.Customer.retrieve(customer_id) + credit_card_raw_data = customer.sources.data.pop() + card_details = { + 'last4': credit_card_raw_data.last4, + 'brand': credit_card_raw_data.brand + } + return card_details + def check_customer(self, id, user, token): customers = self.stripe.Customer.all() if not customers.get('data'): From 9431e9846c9d88ed0ed7cd7ec9ffd370a32eae79 Mon Sep 17 00:00:00 2001 From: Andrii Marynets Date: Fri, 30 Jun 2017 08:44:39 +0300 Subject: [PATCH 22/50] Add middleware for fix "get_host() method fails when the host is behind multiple proxies" --- dynamicweb/settings/base.py | 4 +++- utils/middleware.py | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 utils/middleware.py diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index 31723853..08ed7fe5 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -118,6 +118,7 @@ INSTALLED_APPS = ( MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', + 'utils.middleware.MultipleProxyMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', @@ -515,5 +516,6 @@ DCL_SUPPORT_FROM_ADDRESS = env('DCL_SUPPORT_FROM_ADDRESS') # Settings for Google analytics GOOGLE_ANALYTICS_PROPERTY_IDS = { 'datacenterlight.ch': 'UA-62285904-9', - 'digitalglarus.ch': 'UA-62285904-2' + 'digitalglarus.ch': 'UA-62285904-2', + '127.0.0.1:8000': 'test' } diff --git a/utils/middleware.py b/utils/middleware.py new file mode 100644 index 00000000..d37bdbfd --- /dev/null +++ b/utils/middleware.py @@ -0,0 +1,17 @@ +class MultipleProxyMiddleware(object): + FORWARDED_FOR_FIELDS = [ + 'HTTP_X_FORWARDED_FOR', + 'HTTP_X_FORWARDED_HOST', + 'HTTP_X_FORWARDED_SERVER', + ] + + def process_request(self, request): + """ + Rewrites the proxy headers so that only the most + recent proxy is used. + """ + for field in self.FORWARDED_FOR_FIELDS: + if field in request.META: + if ',' in request.META[field]: + parts = request.META[field].split(',') + request.META[field] = parts[-1].strip() \ No newline at end of file From d32d2a89767f338b9daae8fedef6be5bc341b537 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 30 Jun 2017 12:06:41 +0530 Subject: [PATCH 23/50] Added a form in order confirmation page --- datacenterlight/templates/datacenterlight/order_detail.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index 1c3dd6b7..affb8ef5 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -70,12 +70,12 @@ {% endwith %}

- {% url 'datacenterlight:payment' as payment_url %} - {% if payment_url in request.META.HTTP_REFERER %} +
+ {% csrf_token %} - {% endif %} +
{% endif %} From 3eca55a32a89742bb1e0183f42d847a97f0b1420 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 30 Jun 2017 12:08:07 +0530 Subject: [PATCH 24/50] Fixed billing address bug. Fixed back button issues in the new flow --- datacenterlight/views.py | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 8e8858c6..cd2aa660 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -32,9 +32,14 @@ class SuccessView(TemplateView): def get(self, request, *args, **kwargs): if 'specs' not in request.session or 'user' not in request.session: return HttpResponseRedirect(reverse('datacenterlight:index')) - else : - del request.session['specs'] - del request.session['user'] + 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 PricingView(TemplateView): @@ -356,12 +361,16 @@ class PaymentOrderView(FormView): class OrderConfirmationView(DetailView): template_name = "datacenterlight/order_detail.html" + payment_template_name = 'hosting/payment.html' context_object_name = "order" model = HostingOrder - + + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def get(self, request, *args, **kwargs): if 'specs' not in request.session or 'user' not in request.session: return HttpResponseRedirect(reverse('datacenterlight:index')) + if 'token' not in request.session: + return HttpResponseRedirect(reverse('datacenterlight:payment')) stripe_customer_id = request.session.get('customer') customer = StripeCustomer.objects.filter(id=stripe_customer_id).first() stripe_utils = StripeUtils() @@ -371,15 +380,16 @@ class OrderConfirmationView(DetailView): 'cc_brand' : card_details.get('response_object').get('brand') } return render(request, self.template_name, context) - + def post(self, request, *args, **kwargs): template = request.session.get('template') specs = request.session.get('specs') user = request.session.get('user') - customer = request.session.get('customer') + stripe_customer_id = request.session.get('customer') + customer = StripeCustomer.objects.filter(id=stripe_customer_id).first() billing_address_data = request.session.get('billing_address_data') billing_address_id = request.session.get('billing_address') - billing_address = BillingAddress.objects.filter(id=billing_address_id) + billing_address = BillingAddress.objects.filter(id=billing_address_id).first() token = request.session.get('token') vm_template_id = template.get('id', 1) final_price = specs.get('price') @@ -393,10 +403,11 @@ class OrderConfirmationView(DetailView): # Check if the payment was approved if not charge: context.update({ - 'paymentError': charge_response.get('error'), - 'form': form + 'paymentError': charge_response.get('error') + # TODO add logic in payment form to autofill data + #'form': form }) - return render(request, self.template_name, context) + return render(request, self.payment_template_name, context) charge = charge_response.get('response_object') @@ -404,7 +415,7 @@ class OrderConfirmationView(DetailView): manager = OpenNebulaManager(email=settings.OPENNEBULA_USERNAME, password=settings.OPENNEBULA_PASSWORD) - # Create a vm using logged user + # Create a vm using oneadmin, also specify the name vm_id = manager.create_vm( template_id=vm_template_id, specs=specs, @@ -465,3 +476,5 @@ class OrderConfirmationView(DetailView): } email = EmailMessage(**email_data) email.send() + request.session['order_confirmation'] = True + return HttpResponseRedirect(reverse('datacenterlight:order_success')) From 1deeec4c3345c8d35af645bd637a511660990700 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 30 Jun 2017 12:18:31 +0530 Subject: [PATCH 25/50] Added the locale time code to new flow order detail --- .../templates/datacenterlight/order_detail.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index affb8ef5..00aa840f 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -37,7 +37,7 @@
{% trans "Date"%}:
- {% now "jS F Y" %}

+ {% now "Y-m-d H:i" %}

@@ -80,4 +80,16 @@
{% endif %}
+ + + {%endblock%} From 2350247cdb145dd12d90ce3fb6451a8189308f9a Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 30 Jun 2017 12:27:18 +0530 Subject: [PATCH 26/50] Removed unused code --- datacenterlight/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index cd2aa660..49891730 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -18,7 +18,7 @@ from membership.models import StripeCustomer from hosting.models import HostingOrder, HostingBill from utils.stripe_utils import StripeUtils from datetime import datetime -from membership.models import CustomUser, StripeCustomer, CreditCards +from membership.models import CustomUser, StripeCustomer from opennebula_api.models import OpenNebulaManager from opennebula_api.serializers import VirtualMachineTemplateSerializer, VirtualMachineSerializer @@ -344,7 +344,7 @@ class PaymentOrderView(FormView): # Get or create stripe customer customer = StripeCustomer.get_or_create(email=user.get('email'), - token=token) + token=token) if not customer: form.add_error("__all__", "Invalid credit card") return self.render_to_response(self.get_context_data(form=form)) From 699326dc57275eac4dd6144658a77ea10d6cf867 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 30 Jun 2017 12:33:28 +0530 Subject: [PATCH 27/50] Made to return empty string for the template filter get_value_from_dict instead of None --- datacenterlight/templatetags/custom_tags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenterlight/templatetags/custom_tags.py b/datacenterlight/templatetags/custom_tags.py index e7b15b5b..ed59af9a 100644 --- a/datacenterlight/templatetags/custom_tags.py +++ b/datacenterlight/templatetags/custom_tags.py @@ -31,4 +31,4 @@ def get_value_from_dict(dict_data, key): if key: return dict_data.get(key) else : - return None + return "" From 160df7685ca22bdeb7e802f2979bf720e7838738 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 30 Jun 2017 12:47:04 +0530 Subject: [PATCH 28/50] Refactored dcl text and support email --- datacenterlight/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 49891730..ffc16eb9 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -468,8 +468,8 @@ class OrderConfirmationView(DetailView): 'order.id': order.id } email_data = { - 'subject': "Data Center Light Order from %s" % context['email'], - 'from_email': '(Data Center Light) Data Center Light Support ', + 'subject': settings.DCL_TEXT + " Order from %s" % context['email'], + 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, 'to': ['info@ungleich.ch'], 'body': "\n".join(["%s=%s" % (k, v) for (k, v) in context.items()]), 'reply_to': [context['email']], From dfd910465ca97c9fce1cbb4c427cb420bf790a8e Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 1 Jul 2017 01:40:17 +0530 Subject: [PATCH 29/50] Added dcl translations used in new flow --- .../locale/de/LC_MESSAGES/django.po | 62 ++++++++++++++++--- .../datacenterlight/order_detail.html | 2 +- 2 files changed, 56 insertions(+), 8 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index f6628b9f..69e140f9 100644 --- a/datacenterlight/locale/de/LC_MESSAGES/django.po +++ b/datacenterlight/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-19 12:22+0530\n" +"POT-Creation-Date: 2017-07-01 01:37+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -99,15 +99,18 @@ msgid "" "datacenterlight account.
\n" " %(base_url)s%(activation_link)s\n" " " -msgstr "\n" -" Klicke hier um deinen %(dcl_text)s zu aktivieren.

\n" -" Oder kopiere den folgenden Link in die Adressleiste deines Browsers und folge dann dem Link um deinen %(dcl_text)s Account zu aktivieren.
\n" +msgstr "" +"\n" +" Klicke hier " +"um deinen %(dcl_text)s zu aktivieren.

\n" +" Oder kopiere den folgenden Link in die Adressleiste deines " +"Browsers und folge dann dem Link um deinen %(dcl_text)s Account zu " +"aktivieren.
\n" " %(base_url)s%(activation_link)s\n" " " #: templates/datacenterlight/emails/user_activation.html:123 #: templates/datacenterlight/emails/user_activation.txt:11 -#| msgid "Your Name" msgid "Your" msgstr "Dein" @@ -128,8 +131,9 @@ msgstr "" "\n" "Hallo,\n" "\n" -"Du kannst deinen %(dcl_text)s Account aktivieren, indem du hier klickst %(base_url)s" -"%(activation_link)s\n" +"Du kannst deinen %(dcl_text)s Account aktivieren, indem du hier klickst " +"%(base_url)s%(activation_link)s\n" + #: templates/datacenterlight/includes/_footer.html:11 #: templates/datacenterlight/includes/_footer.html:31 #: templates/datacenterlight/includes/_navbar.html:27 @@ -298,6 +302,50 @@ msgstr "Fragen?" msgid "Contact us!" msgstr "Kontaktiere uns!" +#: templates/datacenterlight/order_detail.html:24 +msgid "Confirm Order" +msgstr "Bestellung Bestätigen" + +#: templates/datacenterlight/order_detail.html:30 +msgid "Billed To:" +msgstr "Rechnungsadresse" + +#: templates/datacenterlight/order_detail.html:39 +msgid "Date" +msgstr "Datum" + +#: templates/datacenterlight/order_detail.html:48 +msgid "Payment Method:" +msgstr "Bezahlmethode" + +#: templates/datacenterlight/order_detail.html:49 +msgid "ending" +msgstr "endend in" + +#: templates/datacenterlight/order_detail.html:59 +msgid "Order summary" +msgstr "Bestellungsübersicht" + +#: templates/datacenterlight/order_detail.html:63 +msgid "Cores" +msgstr "Prozessorkerne" + +#: templates/datacenterlight/order_detail.html:65 +msgid "Memory" +msgstr "Arbeitsspeicher" + +#: templates/datacenterlight/order_detail.html:67 +msgid "Disk space" +msgstr "Festplattenkapazität" + +#: templates/datacenterlight/order_detail.html:69 +msgid "Total" +msgstr "" + +#: templates/datacenterlight/order_detail.html:76 +msgid "Place order" +msgstr "Bestellen" + #: templates/datacenterlight/pricing.html:9 msgid "We are cutting down the costs significantly!" msgstr "Wir sorgen dafür, dass die Kosten für Dich signifikant abnehmen" diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index 00aa840f..3f0ef0b5 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -46,7 +46,7 @@
{% trans "Payment Method:"%}
- {{cc_brand}} ending **** {{cc_last4}}
+ {{cc_brand}} {% trans "ending" %} **** {{cc_last4}}
{{request.session.user.email}}
From 0b0892a299ae80e2f64e99d3d9db932e1a787794 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 1 Jul 2017 01:59:24 +0530 Subject: [PATCH 30/50] Added OS to the payment page --- hosting/templates/hosting/payment.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hosting/templates/hosting/payment.html b/hosting/templates/hosting/payment.html index e41f57d7..c101e5e2 100644 --- a/hosting/templates/hosting/payment.html +++ b/hosting/templates/hosting/payment.html @@ -22,6 +22,9 @@

{%trans "Disk space"%} {{request.session.specs.disk_size|floatformat}} GB

+
+

{%trans "OS"%} {{request.session.template.name}}


Total

{{request.session.specs.price }} CHF

From e286fc8aaf393080d7e480e1b61bf09380b8442c Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 1 Jul 2017 02:10:30 +0530 Subject: [PATCH 31/50] Added OS configuration to the payment page --- hosting/locale/de/LC_MESSAGES/django.po | 55 +++++++++++++------------ hosting/templates/hosting/payment.html | 2 +- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index 674f3db4..b3cc6c0b 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-23 02:28+0530\n" +"POT-Creation-Date: 2017-07-01 02:09+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -26,47 +26,47 @@ msgstr "Dein Account wurde noch nicht aktiviert." msgid "Paste here your public key" msgstr "Fügen Sie Ihren public key ein" -#: templates/hosting/base_short.html:67 +#: templates/hosting/base_short.html:68 msgid "My Virtual Machines" msgstr "Meine virtuellen Maschinen" -#: templates/hosting/base_short.html:72 templates/hosting/orders.html.py:12 +#: templates/hosting/base_short.html:73 templates/hosting/orders.html.py:12 msgid "My Orders" msgstr "Meine Bestellungen" -#: templates/hosting/base_short.html:81 +#: templates/hosting/base_short.html:82 msgid "Keys" msgstr "Schlüssel" -#: templates/hosting/base_short.html:86 +#: templates/hosting/base_short.html:87 msgid "Notifications " msgstr "Benachrichtigungen" -#: templates/hosting/base_short.html:89 +#: templates/hosting/base_short.html:90 msgid "Logout" msgstr "Abmelden" -#: templates/hosting/base_short.html:94 +#: templates/hosting/base_short.html:95 msgid "How it works" msgstr "So funktioniert es" -#: templates/hosting/base_short.html:97 +#: templates/hosting/base_short.html:98 msgid "Your infrastructure" msgstr "deine Infrastruktur" -#: templates/hosting/base_short.html:100 +#: templates/hosting/base_short.html:101 msgid "Our inftrastructure" msgstr "Unsere Infrastruktur" -#: templates/hosting/base_short.html:103 +#: templates/hosting/base_short.html:104 msgid "Pricing" msgstr "Preise" -#: templates/hosting/base_short.html:106 +#: templates/hosting/base_short.html:107 msgid "Contact" msgstr "Kontakt" -#: templates/hosting/base_short.html:109 +#: templates/hosting/base_short.html:110 #: templates/hosting/confirm_reset_password.html:38 #: templates/hosting/login.html:17 templates/hosting/login.html.py:26 #: templates/hosting/reset_password.html:32 templates/hosting/signup.html:30 @@ -347,11 +347,11 @@ msgstr "Bestellung stornieren" msgid "Do You want to delete your order?" msgstr "Willst du deine Bestellung löschen?" -#: templates/hosting/orders.html:63 templates/hosting/user_keys.html.py:62 +#: templates/hosting/orders.html:63 templates/hosting/user_keys.html.py:63 msgid "Close" msgstr "Schliessen" -#: templates/hosting/orders.html:65 templates/hosting/user_keys.html.py:64 +#: templates/hosting/orders.html:65 templates/hosting/user_keys.html.py:65 msgid "Delete" msgstr "Löschen" @@ -359,31 +359,36 @@ msgstr "Löschen" msgid "Billing Amount" msgstr "Rechnungsbetrag" -#: templates/hosting/payment.html:35 +#: templates/hosting/payment.html:26 +#: templates/hosting/virtual_machine_detail.html:98 +msgid "Configuration" +msgstr "Konfiguration" + +#: templates/hosting/payment.html:38 msgid "Billing Address" msgstr "Rechnungsadresse" -#: templates/hosting/payment.html:49 +#: templates/hosting/payment.html:52 msgid "Payment Details" msgstr "Rechnungsdetails" -#: templates/hosting/payment.html:62 +#: templates/hosting/payment.html:65 msgid "Submit Payment" msgstr "Betrag überweisen" -#: templates/hosting/payment.html:81 +#: templates/hosting/payment.html:84 msgid "CARD NUMBER" msgstr "Kreditkartennummer" -#: templates/hosting/payment.html:86 +#: templates/hosting/payment.html:89 msgid "Valid Card Number" msgstr "Gültige Kreditkartennummer" -#: templates/hosting/payment.html:95 +#: templates/hosting/payment.html:98 msgid "EXPIRATION DATE" msgstr "Ablaufdatum" -#: templates/hosting/payment.html:106 +#: templates/hosting/payment.html:109 msgid "CV CODE" msgstr "CV Code" @@ -425,13 +430,13 @@ msgstr "Schlüssel hinzufügen" msgid "Created at" msgstr "Erstellt am" -#: templates/hosting/user_keys.html:42 +#: templates/hosting/user_keys.html:43 #, fuzzy #| msgid "Delete" msgid "Delete Key" msgstr "Löschen" -#: templates/hosting/user_keys.html:55 +#: templates/hosting/user_keys.html:56 #, fuzzy #| msgid "Do You want do delete your order?" msgid "Do You want to delete this key?" @@ -453,10 +458,6 @@ msgstr "Ip nicht zugewiesen" msgid "Disk" msgstr "Festplatte" -#: templates/hosting/virtual_machine_detail.html:98 -msgid "Configuration" -msgstr "Konfiguration" - #: templates/hosting/virtual_machine_detail.html:108 msgid "Current pricing" msgstr "Aktueller Preis" diff --git a/hosting/templates/hosting/payment.html b/hosting/templates/hosting/payment.html index c101e5e2..a09061bb 100644 --- a/hosting/templates/hosting/payment.html +++ b/hosting/templates/hosting/payment.html @@ -23,7 +23,7 @@

{%trans "Disk space"%} {{request.session.specs.disk_size|floatformat}} GB


-

{%trans "OS"%} {%trans "Configuration"%} {{request.session.template.name}}


Total

Date: Sat, 1 Jul 2017 02:16:24 +0530 Subject: [PATCH 32/50] Added OS configuration to the Order Confirmation page --- datacenterlight/locale/de/LC_MESSAGES/django.po | 8 ++++++-- .../templates/datacenterlight/order_detail.html | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index 69e140f9..6eeb605b 100644 --- a/datacenterlight/locale/de/LC_MESSAGES/django.po +++ b/datacenterlight/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-07-01 01:37+0530\n" +"POT-Creation-Date: 2017-07-01 02:15+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -339,10 +339,14 @@ msgid "Disk space" msgstr "Festplattenkapazität" #: templates/datacenterlight/order_detail.html:69 +msgid "Configuration" +msgstr "Konfiguration" + +#: templates/datacenterlight/order_detail.html:71 msgid "Total" msgstr "" -#: templates/datacenterlight/order_detail.html:76 +#: templates/datacenterlight/order_detail.html:78 msgid "Place order" msgstr "Bestellen" diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index 3f0ef0b5..42f916e3 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -66,6 +66,8 @@


{% trans "Disk space"%} {{vm.disk_size}} GB


+

{% trans "Configuration"%} {{request.session.template.name}}

+

{% trans "Total"%}

{{vm.price}} CHF

{% endwith %}
From bd766e207332d183fa32e8150832dcb8840ca645 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 1 Jul 2017 03:11:16 +0530 Subject: [PATCH 33/50] Fixed filling up of users details while going back to payment page from order confirmation page --- datacenterlight/views.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index ffc16eb9..066089b3 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -309,6 +309,30 @@ class IndexView(CreateView): class PaymentOrderView(FormView): template_name = 'hosting/payment.html' form_class = BillingAddressForm + + def get_form_kwargs(self): + form_kwargs = super(PaymentOrderView, self).get_form_kwargs() + user = self.request.session.get('user') + if user: + custom_user = None + try: + custom_user = CustomUser.objects.get(email=user.get('email')) + except CustomUser.DoesNotExist: + return form_kwargs + current_billing_address = custom_user.billing_addresses.first() + form_kwargs = super(PaymentOrderView, self).get_form_kwargs() + if not current_billing_address: + return form_kwargs + form_kwargs.update({ + 'initial': { + 'street_address': current_billing_address.street_address, + 'city': current_billing_address.city, + 'postal_code': current_billing_address.postal_code, + 'country': current_billing_address.country, + } + }) + return form_kwargs + return def get_context_data(self, **kwargs): context = super(PaymentOrderView, self).get_context_data(**kwargs) From 4857bc2cd8735068756bd838c91c34c8fcb94e16 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 1 Jul 2017 03:54:08 +0530 Subject: [PATCH 34/50] Now fetching billing address data from session variable --- datacenterlight/views.py | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 066089b3..c0fbdb6f 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -198,6 +198,8 @@ class IndexView(CreateView): del request.session['specs'] if 'user' in request.session : del request.session['user'] + if 'billing_address_data' in request.session : + del request.session['billing_address_data'] try: manager = OpenNebulaManager() templates = manager.get_templates() @@ -312,27 +314,18 @@ class PaymentOrderView(FormView): def get_form_kwargs(self): form_kwargs = super(PaymentOrderView, self).get_form_kwargs() - user = self.request.session.get('user') - if user: - custom_user = None - try: - custom_user = CustomUser.objects.get(email=user.get('email')) - except CustomUser.DoesNotExist: - return form_kwargs - current_billing_address = custom_user.billing_addresses.first() - form_kwargs = super(PaymentOrderView, self).get_form_kwargs() - if not current_billing_address: - return form_kwargs + billing_address_data = self.request.session.get('billing_address_data') + if billing_address_data: form_kwargs.update({ 'initial': { - 'street_address': current_billing_address.street_address, - 'city': current_billing_address.city, - 'postal_code': current_billing_address.postal_code, - 'country': current_billing_address.country, + 'street_address': billing_address_data['street_address'], + 'city': billing_address_data['city'], + 'postal_code': billing_address_data['postal_code'], + 'country': billing_address_data['country'], } }) - return form_kwargs - return + return form_kwargs + def get_context_data(self, **kwargs): context = super(PaymentOrderView, self).get_context_data(**kwargs) From b502cb5da842803782d1d6be5dc93d4c6da912f8 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 1 Jul 2017 04:29:11 +0530 Subject: [PATCH 35/50] Fixed logo in payment/order confirmation page not redirecting to index issue --- datacenterlight/views.py | 6 ++++-- hosting/templates/hosting/base_short.html | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index c0fbdb6f..07709981 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -204,7 +204,7 @@ class IndexView(CreateView): manager = OpenNebulaManager() templates = manager.get_templates() context = { - 'templates': VirtualMachineTemplateSerializer(templates, many=True).data, + 'templates': VirtualMachineTemplateSerializer(templates, many=True).data } except: messages.error( request, @@ -330,7 +330,8 @@ class PaymentOrderView(FormView): def get_context_data(self, **kwargs): context = super(PaymentOrderView, self).get_context_data(**kwargs) context.update({ - 'stripe_key': settings.STRIPE_API_PUBLIC_KEY + 'stripe_key': settings.STRIPE_API_PUBLIC_KEY, + 'site_url': reverse('datacenterlight:index') }) return context @@ -393,6 +394,7 @@ class OrderConfirmationView(DetailView): stripe_utils = StripeUtils() card_details = stripe_utils.get_card_details(customer.stripe_id, request.session.get('token')) context = { + 'site_url': reverse('datacenterlight:index'), 'cc_last4' : card_details.get('response_object').get('last4'), 'cc_brand' : card_details.get('response_object').get('brand') } diff --git a/hosting/templates/hosting/base_short.html b/hosting/templates/hosting/base_short.html index e1a6a027..c1ba46b1 100644 --- a/hosting/templates/hosting/base_short.html +++ b/hosting/templates/hosting/base_short.html @@ -57,7 +57,7 @@ - + {% if request.user.is_authenticated %} From f847302acd89d6dcfd3202bd02e83369c6e64953 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 1 Jul 2017 11:22:12 +0530 Subject: [PATCH 36/50] Fixed hosting template footer for unauthenticated case (direct payment + order confirmation) --- hosting/templates/hosting/base_short.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hosting/templates/hosting/base_short.html b/hosting/templates/hosting/base_short.html index c1ba46b1..c3b19c8c 100644 --- a/hosting/templates/hosting/base_short.html +++ b/hosting/templates/hosting/base_short.html @@ -131,6 +131,8 @@ + {% else %} + {% include "datacenterlight/includes/_footer.html" %} {% endif %} From 36877d613dd43293aa1d0d08ba395f28af388ff3 Mon Sep 17 00:00:00 2001 From: Mondi Geetha Date: Sat, 1 Jul 2017 17:58:42 +0530 Subject: [PATCH 37/50] Added styles for proper positioning of error msgs --- .../datacenterlight/css/landing-page.css | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index bcfa3f83..bf71eff1 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -430,7 +430,6 @@ h6 { } .pricing-section .card .description{ padding: 12px; - border-bottom: 1px solid rgba(128, 128, 128, 0.3); } .pricing-section .card .descriptions{ padding: 10px 30px; @@ -646,11 +645,10 @@ h6 { } .price-calc-section .card .description{ padding: 12px; - border-bottom: 1px solid rgba(128, 128, 128, 0.3); position: relative; display: flex; - justify-content: space-around; - align-items: center; + justify-content: space-around !important; + align-items: center !important; } .price-calc-section .card .description span { @@ -661,10 +659,10 @@ h6 { width: 30%; text-align: left; } -.price-calc-section .card .description input{ - font-size: 20px; - text-align: center; - width: 60px; +.price-calc-section .card .description .select-number{ + font-size: 20px; + text-align: center; + width: 60px; } .price-calc-section .card .description i{ color: #29427A; @@ -701,8 +699,8 @@ h6 { .price-calc-section .card .check-ip{ font-size: 18px; } -.price-calc-section .card .description.input{ - justify-content: center; +.price-calc-section .card .justify-center{ + justify-content: center !important; } .price-calc-section .card .description.input label{ font-size: 15px; @@ -711,10 +709,11 @@ h6 { margin-bottom: 0; width: 40px; } -.price-calc-section .card .description.input input{ - width: 200px; - font-size: 14px; - text-align: left; +/*Changed class****.price-calc-section .card .description.input input*/ +.price-calc-section .card .description input{ + width: 200px; + font-size: 14px; + text-align: left; padding: 5px 10px; border-radius: 4px; border: 1px solid #d0d0d0; @@ -726,6 +725,15 @@ h6 { font-size: 17px; margin: 0 8px; } +.help-block.with-errors { + text-align: center; + margin: 0; + padding: 0; +} +.form-group { + margin: 0; + border-bottom: 1px solid rgba(128, 128, 128, 0.3); +} @media(max-width:990px) { .pricing-section .text { @@ -911,7 +919,7 @@ h6 { text-align: center; } - .price-calc-section .card .description input { + .price-calc-section .card .description .select-number{ font-size: 17px; text-align: center; width: 60px; From afcec7eb0308dfdb9321d716210a96d237cc042e Mon Sep 17 00:00:00 2001 From: Mondi Geetha Date: Sat, 1 Jul 2017 17:59:34 +0530 Subject: [PATCH 38/50] Removed unwanted code and add bootstrap-validator cdn js --- .../templates/datacenterlight/base.html | 50 +------------------ 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/base.html b/datacenterlight/templates/datacenterlight/base.html index c62d92f7..becb36d8 100644 --- a/datacenterlight/templates/datacenterlight/base.html +++ b/datacenterlight/templates/datacenterlight/base.html @@ -60,53 +60,5 @@ - - - - - + From e4cfcbf618d28526d9c1f4216d6a0fd77e05354a Mon Sep 17 00:00:00 2001 From: Mondi Geetha Date: Sat, 1 Jul 2017 18:01:08 +0530 Subject: [PATCH 39/50] Added some classes and divs for error msg alignment alongside the input field --- .../templates/datacenterlight/index.html | 70 +++++++++++++------ 1 file changed, 49 insertions(+), 21 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/index.html b/datacenterlight/templates/datacenterlight/index.html index 6d63b29b..b05f617a 100755 --- a/datacenterlight/templates/datacenterlight/index.html +++ b/datacenterlight/templates/datacenterlight/index.html @@ -139,7 +139,7 @@
-
+ {% csrf_token %}

{% trans "VM hosting" %}

@@ -152,28 +152,37 @@
-
+

{% trans "Hosted in Switzerland" %}

-
+
+
- + Core +
+
-
+
+
- + GB RAM +
+
-
+
+
- + {% trans "GB Storage (SSD)" %} +
+
-
+
-
-
- - -
+
+
+ + +
+
+ {% for message in messages %} + {% if 'name' in message.tags %} +
  • + {{ message|safe }} +
+ {% endif %} + {% endfor %} +
+
+
+
+ + +
+
+ {% for message in messages %} + {% if 'email' in message.tags %} +
  • + {{ message|safe }} +
+ {% endif %} + {% endfor %} +
+
-
-
-
@@ -250,4 +278,4 @@
- {% endblock %} \ No newline at end of file + {% endblock %} From 0c969946f7ee6a3e8ff999d23920a3c00cd8d0cb Mon Sep 17 00:00:00 2001 From: Mondi Geetha Date: Sat, 1 Jul 2017 18:02:10 +0530 Subject: [PATCH 40/50] Added code for proper return when name/email are not good --- datacenterlight/views.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 07709981..b7c08a63 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -12,6 +12,7 @@ from django import forms from django.core.exceptions import ValidationError from django.views.decorators.cache import cache_control from django.conf import settings +from django.utils.translation import ugettext_lazy as _ from utils.forms import BillingAddressForm, UserBillingAddressForm from utils.models import BillingAddress from membership.models import StripeCustomer @@ -194,12 +195,9 @@ class IndexView(CreateView): @cache_control(no_cache=True, must_revalidate=True, no_store=True) def get(self, request, *args, **kwargs): - if 'specs' in request.session : - del request.session['specs'] - if 'user' in request.session : - del request.session['user'] - if 'billing_address_data' in request.session : - del request.session['billing_address_data'] + for session_var in ['specs', 'user', 'billing_address_data']: + if session_var in request.session: + del request.session[session_var] try: manager = OpenNebulaManager() templates = manager.get_templates() @@ -233,14 +231,16 @@ class IndexView(CreateView): try: name = name_field.clean(name) except ValidationError as err: - messages.add_message(self.request, messages.ERROR, '%(value) is not a proper name.'.format(name)) - return HttpResponseRedirect(reverse('datacenterlight:index')) + msg='{} {}.'.format(name, _('is not a proper name')) + messages.add_message(self.request, messages.ERROR, msg, extra_tags='name') + return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form") try: email = email_field.clean(email) except ValidationError as err: - messages.add_message(self.request, messages.ERROR, '%(value) is not a proper email.'.format(email)) - return HttpResponseRedirect(reverse('datacenterlight:index')) + msg='{} {}.'.format(email, _('is not a proper email')) + messages.add_message(self.request, messages.ERROR, msg, extra_tags='email') + return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form") specs = { 'cpu': cores, From 0a2b2c815de27157dc85b70736b54dc4de663238 Mon Sep 17 00:00:00 2001 From: Mondi Geetha Date: Sun, 2 Jul 2017 02:14:18 +0530 Subject: [PATCH 41/50] Aligned Logo, Text, Signature to left --- .../emails/request_access_confirmation.html | 8 ++++---- .../emails/request_access_notification.html | 8 ++++---- .../emails/request_beta_access_notification.html | 8 ++++---- .../templates/datacenterlight/emails/user_activation.html | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html b/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html index e96a8ef1..2f71944f 100644 --- a/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html +++ b/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html @@ -74,7 +74,7 @@
-
+ logo @@ -95,12 +95,12 @@
- -
+ {% 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." %}
@@ -117,7 +117,7 @@

-
Your data center light team
+
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 index 09531ba6..095c917e 100644 --- a/datacenterlight/templates/datacenterlight/emails/request_access_notification.html +++ b/datacenterlight/templates/datacenterlight/emails/request_access_notification.html @@ -73,7 +73,7 @@
-
+ logo @@ -94,12 +94,12 @@
- - @@ -113,7 +113,7 @@
+ An user requested a beta access
+

User {{email}} requested beta access

-
Your data center light team
+
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 index 7991eb69..c6f3033e 100644 --- a/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html +++ b/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html @@ -73,7 +73,7 @@
-
+ logo @@ -94,14 +94,14 @@
- -
+ An user requested a beta access
+

User {{email}} requested beta access

{% for vm in vms %} Type: {{vm.type}} - Amount: {{vm.amount}} @@ -119,7 +119,7 @@
-
Your data center light team
+
Your data center light team
diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.html b/datacenterlight/templates/datacenterlight/emails/user_activation.html index bf688127..e591fc54 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.html +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.html @@ -74,7 +74,7 @@
-
+ logo @@ -95,12 +95,12 @@
- -
+ {{dcl_text}} {% trans 'account activation' %}
+

{% blocktrans %} You can activate your {{dcl_text}} account by clicking here.

@@ -120,7 +120,7 @@

-
{% trans 'Your' %} {{dcl_text}} {% trans 'team' %}
+
{% trans 'Your' %} {{dcl_text}} {% trans 'team' %}
From f48ea4714e7ba8036e46c6f7a13170c3df76e250 Mon Sep 17 00:00:00 2001 From: Mondi Geetha Date: Sun, 2 Jul 2017 18:34:17 +0530 Subject: [PATCH 42/50] changed error message color --- datacenterlight/static/datacenterlight/css/landing-page.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index bf71eff1..d943a8e9 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -730,6 +730,9 @@ h6 { margin: 0; padding: 0; } +.has-error .checkbox, .has-error .checkbox-inline, .has-error .control-label, .has-error .help-block, .has-error .radio, .has-error .radio-inline, .has-error.checkbox label, .has-error.checkbox-inline label, .has-error.radio label, .has-error.radio-inline label{ +color: #eb4d5c; +} .form-group { margin: 0; border-bottom: 1px solid rgba(128, 128, 128, 0.3); From 871237d84fec92a2336e5dc0f70269e1da374764 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Sun, 2 Jul 2017 15:33:11 +0200 Subject: [PATCH 43/50] Updated Changelog for the release 1.0.18 --- Changelog | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index fcf3c16c..95b7dab8 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,11 @@ +1.0.18: 2017-07-02 + * [datacenterlight] Introduced the new flow. Landing page -> Payment -> Order confirmation -> Success + * [datacenterlight] Fixed issue showing local time to the user in order confirmation page, vm pages (like ssh keys) + * [hosting] Fixed responsive issue while user signup + * [hosting] Fixed 500 error when user requests for a vm whose id does not belong to him + * [datacenterlight] Refactored partially dcl text and dcl support email to be obtained from env parameters + * [datacenterlight] Updated DE translations + * [hosting] Updated email text for user activation 1.0.17: 2017-06-16 * [datacenterlight] Cleanup OrderView useless code * [datacenterlight] Replaced GiB to GB @@ -5,7 +13,7 @@ * [datacenterlight] Fixed translations * [datacenterlight] Added email confirmation feature * [datacenterlight] Changed logo on datacerlight dashboard - * [datacenterlight] Credit card input disappearance fix + * [datacenterlight] Credit card input disappearance fix 1.0.16: 2017-06-15 * [datacenterlight] .po file issue with multiple definition fixed * [datacenterlight] Navbar items in dcl user area rearranged From 1f658a425f5bdea15eb9cbd981af466bdee20c56 Mon Sep 17 00:00:00 2001 From: Andrii Marynets Date: Sun, 2 Jul 2017 17:56:49 +0300 Subject: [PATCH 44/50] Merge with master --- digitalglarus/templates/base_glarus.html | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/digitalglarus/templates/base_glarus.html b/digitalglarus/templates/base_glarus.html index 424f3aac..b94c813e 100644 --- a/digitalglarus/templates/base_glarus.html +++ b/digitalglarus/templates/base_glarus.html @@ -39,27 +39,13 @@ - + + {% include 'google_analytics.html' %} + From fd856d7613d3db5c5eba45a01c5c7b73ba9fac71 Mon Sep 17 00:00:00 2001 From: Mondi Geetha Date: Sun, 2 Jul 2017 20:55:08 +0530 Subject: [PATCH 45/50] Reverted back email templates as they are part of another PR --- .../emails/request_access_confirmation.html | 8 ++++---- .../emails/request_access_notification.html | 8 ++++---- .../emails/request_beta_access_notification.html | 8 ++++---- .../templates/datacenterlight/emails/user_activation.html | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html b/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html index 2f71944f..e96a8ef1 100644 --- a/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html +++ b/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html @@ -74,7 +74,7 @@
-
+ logo @@ -95,12 +95,12 @@
- -
+ {% 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." %}
@@ -117,7 +117,7 @@

-
Your data center light team
+
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 index 095c917e..09531ba6 100644 --- a/datacenterlight/templates/datacenterlight/emails/request_access_notification.html +++ b/datacenterlight/templates/datacenterlight/emails/request_access_notification.html @@ -73,7 +73,7 @@
-
+ logo @@ -94,12 +94,12 @@
- - @@ -113,7 +113,7 @@
+ An user requested a beta access
+

User {{email}} requested beta access

-
Your data center light team
+
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 index c6f3033e..7991eb69 100644 --- a/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html +++ b/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html @@ -73,7 +73,7 @@
-
+ logo @@ -94,14 +94,14 @@
- -
+ An user requested a beta access
+

User {{email}} requested beta access

{% for vm in vms %} Type: {{vm.type}} - Amount: {{vm.amount}} @@ -119,7 +119,7 @@
-
Your data center light team
+
Your data center light team
diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.html b/datacenterlight/templates/datacenterlight/emails/user_activation.html index e591fc54..bf688127 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.html +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.html @@ -74,7 +74,7 @@
-
+ logo @@ -95,12 +95,12 @@
- -
+ {{dcl_text}} {% trans 'account activation' %}
+

{% blocktrans %} You can activate your {{dcl_text}} account by clicking here.

@@ -120,7 +120,7 @@

-
{% trans 'Your' %} {{dcl_text}} {% trans 'team' %}
+
{% trans 'Your' %} {{dcl_text}} {% trans 'team' %}
From 5b6a0691379a7c259d80f9f895d262b54475a220 Mon Sep 17 00:00:00 2001 From: Mondi Geetha Date: Sun, 2 Jul 2017 23:16:19 +0530 Subject: [PATCH 46/50] Added DE translations for error messages --- .../locale/de/LC_MESSAGES/django.po | 56 +++++++++++++------ .../templates/datacenterlight/index.html | 2 +- 2 files changed, 39 insertions(+), 19 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index 6eeb605b..a0c9a470 100644 --- a/datacenterlight/locale/de/LC_MESSAGES/django.po +++ b/datacenterlight/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-07-01 02:15+0530\n" +"POT-Creation-Date: 2017-07-02 23:08+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,14 +18,6 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: templates/datacenterlight/base.html:72 -msgid "Please enter your name" -msgstr "Bitte gib Deinen Namen ein" - -#: templates/datacenterlight/base.html:73 -msgid "Please enter a valid email address" -msgstr "Bitte gib eine gültige E-Mail-Adresse ein" - #: templates/datacenterlight/beta_access.html:13 msgid "Enter name" msgstr "Name" @@ -264,41 +256,61 @@ msgstr "MwSt. inklusive" msgid "Hosted in Switzerland" msgstr "Standort: Schweiz" -#: templates/datacenterlight/index.html:173 +#: templates/datacenterlight/index.html:161 +msgid "Please enter a value greater than or equal to 1." +msgstr "Bitte gib einen Wert größer oder gleich 1 ein." + +#: templates/datacenterlight/index.html:170 +msgid "Please enter a value greater than or equal to 2." +msgstr "Bitte gib einen Wert größer oder gleich 2 ein." + +#: templates/datacenterlight/index.html:179 +msgid "Please enter a value greater than or equal to 10." +msgstr "Bitte gib einen Wert größer oder gleich 10 ein" + +#: templates/datacenterlight/index.html:180 #: templates/datacenterlight/pricing.html:50 msgid "GB Storage (SSD)" msgstr "GB Storage (SSD)" -#: templates/datacenterlight/index.html:189 +#: templates/datacenterlight/index.html:199 msgid "Name" msgstr "" -#: templates/datacenterlight/index.html:190 +#: templates/datacenterlight/index.html:200 msgid "Your Name" msgstr "Dein Name" -#: templates/datacenterlight/index.html:193 +#: templates/datacenterlight/index.html:200 +msgid "Please enter your name" +msgstr "Bitte gib Deinen Namen ein" + +#: templates/datacenterlight/index.html:214 msgid "Email" msgstr "E-Mail-Adresse" -#: templates/datacenterlight/index.html:194 +#: templates/datacenterlight/index.html:215 msgid "Your Email" msgstr "Deine E-Mail" -#: templates/datacenterlight/index.html:197 +#: templates/datacenterlight/index.html:215 +msgid "Please enter a valid email address" +msgstr "Bitte gib eine gültige E-Mailadresse ein" + +#: templates/datacenterlight/index.html:228 #: templates/datacenterlight/pricing.html:79 msgid "Order Now!" msgstr "Bestelle jetzt!" -#: templates/datacenterlight/index.html:226 +#: templates/datacenterlight/index.html:254 msgid "Switzerland " msgstr "Schweiz" -#: templates/datacenterlight/index.html:243 +#: templates/datacenterlight/index.html:271 msgid "Questions?" msgstr "Fragen?" -#: templates/datacenterlight/index.html:243 +#: templates/datacenterlight/index.html:271 msgid "Contact us!" msgstr "Kontaktiere uns!" @@ -380,6 +392,14 @@ msgstr "" msgid "as soon as possible!" msgstr "" +#: views.py:234 +msgid "is not a proper name" +msgstr "ist kein gültiger Name" + +#: views.py:241 +msgid "is not a proper email" +msgstr "ist keine gültige E-Mailadresse" + #~ msgid "Buy VM" #~ msgstr "VM Kaufen" diff --git a/datacenterlight/templates/datacenterlight/index.html b/datacenterlight/templates/datacenterlight/index.html index b05f617a..31e02fb9 100755 --- a/datacenterlight/templates/datacenterlight/index.html +++ b/datacenterlight/templates/datacenterlight/index.html @@ -211,7 +211,7 @@
- +
From 3a865bd01089612b3d44a324786d537afeae88cf Mon Sep 17 00:00:00 2001 From: Mondi Geetha Date: Sun, 2 Jul 2017 23:33:33 +0530 Subject: [PATCH 47/50] Increased minimum length of the name to 3 --- datacenterlight/templates/datacenterlight/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenterlight/templates/datacenterlight/index.html b/datacenterlight/templates/datacenterlight/index.html index 31e02fb9..6807575d 100755 --- a/datacenterlight/templates/datacenterlight/index.html +++ b/datacenterlight/templates/datacenterlight/index.html @@ -197,7 +197,7 @@
- +
{% for message in messages %} From f67343ab5c6ef7b960394830bed7f81ab3f8b9c9 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Sun, 2 Jul 2017 21:26:10 +0200 Subject: [PATCH 48/50] Added missing validation code --- datacenterlight/templates/datacenterlight/base.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/datacenterlight/templates/datacenterlight/base.html b/datacenterlight/templates/datacenterlight/base.html index becb36d8..6074ece9 100644 --- a/datacenterlight/templates/datacenterlight/base.html +++ b/datacenterlight/templates/datacenterlight/base.html @@ -61,4 +61,9 @@ + From 5ea35bd4d8966759c0f30182a6aa7be554712483 Mon Sep 17 00:00:00 2001 From: Andrii Marynets Date: Sun, 2 Jul 2017 23:00:56 +0300 Subject: [PATCH 49/50] add ids for dev and staging server --- dynamicweb/settings/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index 08ed7fe5..ba304ff9 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -517,5 +517,7 @@ DCL_SUPPORT_FROM_ADDRESS = env('DCL_SUPPORT_FROM_ADDRESS') GOOGLE_ANALYTICS_PROPERTY_IDS = { 'datacenterlight.ch': 'UA-62285904-9', 'digitalglarus.ch': 'UA-62285904-2', - '127.0.0.1:8000': 'test' + '127.0.0.1:8000': 'localhost', + 'dynamicweb-development.ungleich.ch': 'development', + 'dynamicweb-staging.ungleich.ch': 'staging' } From 8b9359ede52786ff4c8b54b945f61bfed7cb44a0 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Sun, 2 Jul 2017 23:37:31 +0200 Subject: [PATCH 50/50] Reverted back to the default behavior of bootstrap-validator --- datacenterlight/templates/datacenterlight/base.html | 5 ----- datacenterlight/templates/datacenterlight/index.html | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/base.html b/datacenterlight/templates/datacenterlight/base.html index 6074ece9..becb36d8 100644 --- a/datacenterlight/templates/datacenterlight/base.html +++ b/datacenterlight/templates/datacenterlight/base.html @@ -61,9 +61,4 @@ - diff --git a/datacenterlight/templates/datacenterlight/index.html b/datacenterlight/templates/datacenterlight/index.html index 6807575d..822858ae 100755 --- a/datacenterlight/templates/datacenterlight/index.html +++ b/datacenterlight/templates/datacenterlight/index.html @@ -139,7 +139,7 @@
-
+ {% csrf_token %}

{% trans "VM hosting" %}