From 6536991209fc25af113a91dfa93988ede3a00952 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 6 Oct 2017 01:17:35 +0530 Subject: [PATCH 001/973] list all cards, card_input template --- .../datacenterlight/landing_payment.html | 58 +-------------- hosting/templates/hosting/payment.html | 57 +------------- hosting/templates/hosting/settings.html | 74 +++---------------- hosting/views.py | 19 +++-- 4 files changed, 20 insertions(+), 188 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/landing_payment.html b/datacenterlight/templates/datacenterlight/landing_payment.html index fa638d77..1a476797 100644 --- a/datacenterlight/templates/datacenterlight/landing_payment.html +++ b/datacenterlight/templates/datacenterlight/landing_payment.html @@ -121,63 +121,7 @@ {% else %} -
- -
-
-
- -
-
-
-
- -
-
-
- -
-
-
-
- - -
-
-
-
- {% if not messages and not form.non_field_errors %} -

- {% trans "You are not making any payment yet. After placing your order, you will be taken to the Submit Payment Page." %} -

- {% endif %} -
- {% for message in messages %} - {% if 'failed_payment' in message.tags or 'make_charge_error' in message.tags %} -
    -
  • {{ message|safe }}

  • -
- {% elif not form.non_field_errors %} -

- {% trans "You are not making any payment yet. After placing your order, you will be taken to the Submit Payment Page." %} -

- {% endif %} - {% endfor %} - - {% for error in form.non_field_errors %} -

- {{ error|escape }} -

- {% endfor %} -
-
- -
- -
-

-
-
+ {% include "hosting/includes/_card_input.html" %} {% endif %} diff --git a/hosting/templates/hosting/payment.html b/hosting/templates/hosting/payment.html index e9d6476f..a10cfbca 100644 --- a/hosting/templates/hosting/payment.html +++ b/hosting/templates/hosting/payment.html @@ -105,62 +105,7 @@ {% else %} -
- -
-
-
- -
-
-
-
- -
-
-
- -
-
-
-
- - -
-
-
-
- {% if not messages and not form.non_field_errors %} -

- {% trans "You are not making any payment yet. After submitting your card information, you will be taken to the Confirm Order Page." %} -

- {% endif %} -
- {% for message in messages %} - {% if 'failed_payment' or 'make_charge_error' in message.tags %} -
    -
  • -

    {{ message|safe }}

    -
  • -
- {% endif %} - {% endfor %} - - {% for error in form.non_field_errors %} -

- {{ error|escape }} -

- {% endfor %} -
-
- -
- - -
-

-
-
+ {% include "hosting/includes/_card_input.html" %} {% endif %} diff --git a/hosting/templates/hosting/settings.html b/hosting/templates/hosting/settings.html index 0bafe8e5..5e898b04 100644 --- a/hosting/templates/hosting/settings.html +++ b/hosting/templates/hosting/settings.html @@ -30,12 +30,13 @@

{%trans "Credit Card"%}


- {% if credit_card_data.last4 %} + {% for card in cards_list %}
{% trans "Credit Card" %}
-
{% trans "Last" %} 4: *****{{credit_card_data.last4}}
-
{% trans "Type" %}: {{credit_card_data.cc_brand}}
+
{% trans "Last" %} 4: *****{{card.last4}}
+
{% trans "Type" %}: {{card.cc_brand}}
{% comment %} + {% endcomment %}
@@ -46,75 +47,18 @@
- {% endcomment %}
+ {% endfor %} + {% if credit_card_data.last4 %} {% else %}

{% trans "No Credit Cards Added" %}

{% blocktrans %}We are using Stripe for payment and do not store your information in our database.{% endblocktrans %}

- {% comment %}

{% trans "Add a new Card." %}

-

- {% blocktrans %}Please fill in your credit card information below. We are using Stripe for payment and do not store your information in our database.{% endblocktrans %} -

-
- -
-
- -
-
-
-
- -
-
-
- -
-
-
-
- - -
-
- -
- {% if not messages and not form.non_field_errors %} -

- {% blocktrans %}You are not making any payment here.{% endblocktrans %} -

- {% endif %} -
- {% for message in messages %} - {% if 'failed_payment' or 'make_charge_error' in message.tags %} -
  • -

    {{ message|safe }}

    -
- {% endif %} - {% endfor %} - - {% for error in form.non_field_errors %} -

- {{ error|escape }} -

- {% endfor %} -
-
-
- -
-
-
- -
-

-
-
+ {% include "hosting/includes/_card_input.html" %} + {% comment %} {% endcomment %} {% endif %}
@@ -123,7 +67,6 @@ - {% comment %} {% if stripe_key %} {% get_current_language as LANGUAGE_CODE %} @@ -138,6 +81,7 @@ {%endif%} + {% comment %} {% if credit_card_data.last4 and credit_card_data.cc_brand %} {%endif%} - -{% if credit_card_data.last4 and credit_card_data.cc_brand %} - -{%endif%} - {%endblock%} From 248283b369c55b3989c421a93921453d33248f42 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 28 Oct 2017 23:44:06 +0200 Subject: [PATCH 070/973] Show user's credit cards dynamically in landing payment page --- .../datacenterlight/landing_payment.html | 35 ++++++++++++++----- datacenterlight/views.py | 11 +++++- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/landing_payment.html b/datacenterlight/templates/datacenterlight/landing_payment.html index 58246b6a..69c80d35 100644 --- a/datacenterlight/templates/datacenterlight/landing_payment.html +++ b/datacenterlight/templates/datacenterlight/landing_payment.html @@ -84,11 +84,35 @@
+ {% with card_list_len=cards_list|length %}

{%trans "Credit Card"%}


+ {% if card_list_len > 0 %} + {% blocktrans %}Please select one of the previous cards that you used before or fill in your credit card information below. We are using Stripe for payment and do not store your information in our database.{% endblocktrans %} + {% else %} {% blocktrans %}Please fill in your credit card information below. We are using Stripe for payment and do not store your information in our database.{% endblocktrans %} + {% endif %}

+
+ {% for card in cards_list %} +
+
+
{% trans "Credit Card" %}
+
{% trans "Last" %} 4: ***** {{card.last4}}
+
{% trans "Type" %}: {{card.brand}}
+
+ +
+ {% endfor %} + {% if card_list_len > 0 %} +
Use another card
+ {% endif %} + {% include "hosting/includes/_card_input.html" %} +
+ {% comment %}
{% if credit_card_data.last4 %}
@@ -125,6 +149,8 @@ {% include "hosting/includes/_card_input.html" %} {% endif %}
+ {% endcomment %} + {% endwith %}
@@ -144,13 +170,4 @@ })(); {%endif%} - -{% if credit_card_data.last4 and credit_card_data.cc_brand %} - -{%endif%} - {%endblock%} diff --git a/datacenterlight/views.py b/datacenterlight/views.py index bd1a7f51..861817e1 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -14,7 +14,7 @@ from django.views.decorators.cache import cache_control from django.views.generic import FormView, CreateView, TemplateView, DetailView from datacenterlight.tasks import create_vm_task -from hosting.models import HostingOrder +from hosting.models import HostingOrder, UserCardDetail from hosting.forms import HostingUserLoginForm from membership.models import CustomUser, StripeCustomer from opennebula_api.serializers import VMTemplateSerializer @@ -347,6 +347,14 @@ class PaymentOrderView(FormView): def get_context_data(self, **kwargs): context = super(PaymentOrderView, self).get_context_data(**kwargs) + user = self.request.user + if hasattr(user, 'stripecustomer'): + stripe_customer = user.stripecustomer + else: + stripe_customer = None + cards_list = UserCardDetail.get_all_cards_list( + stripe_customer=stripe_customer + ) if 'billing_address_data' in self.request.session: billing_address_data = self.request.session['billing_address_data'] else: @@ -380,6 +388,7 @@ class PaymentOrderView(FormView): ) context.update({ + 'cards_list': cards_list, 'stripe_key': settings.STRIPE_API_PUBLIC_KEY, 'site_url': reverse('datacenterlight:index'), 'login_form': HostingUserLoginForm(prefix='login_form'), From 2ffaee2d5b9722a50ed33e5d6a338df77af5232c Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 29 Oct 2017 13:14:29 +0100 Subject: [PATCH 071/973] Add clear_items_from_list utility function --- utils/hosting_utils.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/utils/hosting_utils.py b/utils/hosting_utils.py index 3c193ad7..9541588d 100644 --- a/utils/hosting_utils.py +++ b/utils/hosting_utils.py @@ -60,3 +60,23 @@ def get_vm_price(cpu, memory, disk_size): :return: The price of the VM """ return (cpu * 5) + (memory * 2) + (disk_size * 0.6) + + +class HostingUtils: + @staticmethod + def clear_items_from_list(from_list, items_list): + """ + A utility function to clear items from a given list. + Useful when deleting items in bulk from session. + e.g.: + HostingUtils.clear_items_from_list( + request.session, + ['token', 'billing_address_data', 'card_id',] + ) + :param from_list: + :param items_list: + :return: + """ + for var in items_list: + if var in from_list: + del from_list[var] From 82ad9ac337a9f9ab83256debecc05160b7379274 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 29 Oct 2017 13:17:26 +0100 Subject: [PATCH 072/973] Add selected card handling in landing flow "Order confirmation" page --- datacenterlight/views.py | 172 +++++++++++++++++++++++++++------------ 1 file changed, 122 insertions(+), 50 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 861817e1..baec4ee6 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -21,7 +21,7 @@ from opennebula_api.serializers import VMTemplateSerializer from utils.forms import ( BillingAddressForm, BillingAddressFormSignup ) -from utils.hosting_utils import get_vm_price +from utils.hosting_utils import get_vm_price, HostingUtils from utils.mailer import BaseEmail from utils.stripe_utils import StripeUtils from utils.tasks import send_plain_email_task @@ -401,6 +401,13 @@ class PaymentOrderView(FormView): # user is no longer added to session on the index page if 'specs' not in request.session: return HttpResponseRedirect(reverse('datacenterlight:index')) + HostingUtils.clear_items_from_list( + request.session, + ['token', 'billing_address_data', 'card_id', 'customer', + 'user'] + ) + if 'token' in request.session: + del request.session['token'] return self.render_to_response(self.get_context_data()) def post(self, request, *args, **kwargs): @@ -436,8 +443,40 @@ class PaymentOrderView(FormView): 'name': request.user.name } customer = StripeCustomer.get_or_create( - email=this_user.get('email'), - token=token) + email=this_user.get('email'), token=token + ) + if token is '': + # card selected case + card_id = address_form.cleaned_data.get('card') + try: + user_card_detail = UserCardDetail.objects.get( + id=card_id) + if not request.user.has_perm( + 'view_usercarddetail', user_card_detail + ): + raise UserCardDetail.DoesNotExist( + _( + "{user} does not have permission to access the " + "card").format(user=request.user.email) + ) + except UserCardDetail.DoesNotExist as e: + ex = str(e) + logger.error( + "Card Id: {card_id}, Exception: {ex}".format( + card_id=card_id, ex=ex + ) + ) + msg = _("An error occurred. Details: {}".format(ex)) + messages.add_message( + self.request, messages.ERROR, msg, + extra_tags='make_charge_error' + ) + return HttpResponseRedirect( + reverse('hosting:payment') + '#payment_error' + ) + request.session['card_id'] = user_card_detail.id + else: + request.session['token'] = token else: user_email = address_form.cleaned_data.get('email') user_name = address_form.cleaned_data.get('name') @@ -472,7 +511,7 @@ class PaymentOrderView(FormView): email=user_email, token=token, customer_name=user_name) - + request.session['token'] = token request.session['billing_address_data'] = address_form.cleaned_data request.session['user'] = this_user # Get or create stripe customer @@ -485,7 +524,6 @@ class PaymentOrderView(FormView): billing_address_form=address_form ) ) - request.session['token'] = token if type(customer) is StripeCustomer: request.session['customer'] = customer.stripe_id else: @@ -508,27 +546,33 @@ 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')) - if 'token' not in request.session: + if 'token' not in request.session and 'card_id' not in request.session: return HttpResponseRedirect(reverse('datacenterlight:payment')) - stripe_api_cus_id = request.session.get('customer') - stripe_utils = StripeUtils() - card_details = stripe_utils.get_card_details(stripe_api_cus_id, - request.session.get( - 'token')) - if not card_details.get('response_object'): - msg = card_details.get('error') - messages.add_message(self.request, messages.ERROR, msg, - extra_tags='failed_payment') - return HttpResponseRedirect( - reverse('datacenterlight:payment') + '#payment_error') context = { 'site_url': reverse('datacenterlight:index'), - 'cc_last4': card_details.get('response_object').get('last4'), - 'cc_brand': card_details.get('response_object').get('brand'), 'vm': request.session.get('specs'), 'page_header_text': _('Confirm Order'), 'billing_address_data': request.session.get('billing_address_data') } + if 'token' in request.session: + stripe_utils = StripeUtils() + card_details = stripe_utils.get_cards_details_from_token( + request.session.get('token') + ) + card_detail_resp = card_details.get('response_object') + if not card_detail_resp: + msg = card_details.get('error') + messages.add_message(self.request, messages.ERROR, msg, + extra_tags='failed_payment') + return HttpResponseRedirect( + reverse('datacenterlight:payment') + '#payment_error') + context['cc_last4'] = card_detail_resp.get('last4') + context['cc_brand'] = card_detail_resp.get('brand') + else: + card_id = self.request.session.get('card_id') + card_detail = UserCardDetail.objects.get(id=card_id) + context['cc_last4'] = card_detail.last4 + context['cc_brand'] = card_detail.brand return render(request, self.template_name, context) def post(self, request, *args, **kwargs): @@ -538,43 +582,62 @@ class OrderConfirmationView(DetailView): stripe_api_cus_id = request.session.get('customer') vm_template_id = template.get('id', 1) stripe_utils = StripeUtils() - card_details = stripe_utils.get_card_details(stripe_api_cus_id, - request.session.get( - 'token')) - if not card_details.get('response_object'): - msg = card_details.get('error') - messages.add_message(self.request, messages.ERROR, msg, - extra_tags='failed_payment') - response = { - 'status': False, - 'redirect': "{url}#{section}".format( - url=reverse('datacenterlight:payment'), - section='payment_error'), - 'msg_title': str(_('Error.')), - 'msg_body': str( - _('There was a payment related error.' - ' On close of this popup, you will be redirected back to' - ' the payment page.')) + if 'token' in self.request.session: + card_details = stripe_utils.get_cards_details_from_token( + request.session['token'] + ) + if not card_details.get('response_object'): + msg = card_details.get('error') + messages.add_message(self.request, messages.ERROR, msg, + extra_tags='failed_payment') + response = { + 'status': False, + 'redirect': "{url}#{section}".format( + url=reverse('datacenterlight:payment'), + section='payment_error'), + 'msg_title': str(_('Error.')), + 'msg_body': str( + _('There was a payment related error.' + ' On close of this popup, you will be redirected back to' + ' the payment page.')) + } + return HttpResponse(json.dumps(response), + content_type="application/json") + card_details_dict = card_details.get('response_object') + ucd = UserCardDetail.contains( + request.user.stripecustomer, card_details_dict + ) + if not ucd: + stripe_utils.associate_customer_card( + stripe_api_cus_id, request.session['token'], + set_as_default=True + ) + else: + card_id = request.session.get('card_id') + user_card_detail = UserCardDetail.objects.get(id=card_id) + card_details_dict = { + 'last4': user_card_detail.last4, + 'brand': user_card_detail.brand } - return HttpResponse(json.dumps(response), - content_type="application/json") - card_details_dict = card_details.get('response_object') + if not user_card_detail.preferred: + UserCardDetail.set_default_card( + stripe_api_cus_id=stripe_api_cus_id, + stripe_source_id=user_card_detail.card_id + ) cpu = specs.get('cpu') memory = specs.get('memory') disk_size = specs.get('disk_size') amount_to_be_charged = specs.get('price') - plan_name = StripeUtils.get_stripe_plan_name(cpu=cpu, - memory=memory, - disk_size=disk_size) - stripe_plan_id = StripeUtils.get_stripe_plan_id(cpu=cpu, - ram=memory, - ssd=disk_size, - version=1, - app='dcl') + plan_name = StripeUtils.get_stripe_plan_name( + cpu=cpu, memory=memory, disk_size=disk_size + ) + stripe_plan_id = StripeUtils.get_stripe_plan_id( + cpu=cpu, ram=memory, ssd=disk_size, version=1, app='dcl' + ) stripe_plan = stripe_utils.get_or_create_stripe_plan( - amount=amount_to_be_charged, - name=plan_name, - stripe_plan_id=stripe_plan_id) + amount=amount_to_be_charged, name=plan_name, + stripe_plan_id=stripe_plan_id + ) subscription_result = stripe_utils.subscribe_customer_to_plan( stripe_api_cus_id, [{"plan": stripe_plan.get( @@ -644,6 +707,15 @@ class OrderConfirmationView(DetailView): billing_address_data.update({ 'user': custom_user.id }) + if 'token' in request.session: + ucd = UserCardDetail.get_or_create_user_card_detail( + stripe_customer=self.request.user.stripecustomer, + card_details=card_details_dict + ) + UserCardDetail.save_default_card_local( + self.request.user.stripecustomer.stripe_id, + ucd.card_id + ) user = { 'name': custom_user.name, 'email': custom_user.email, From 23e7edf7c28af39b0d8d93517a47538b5cd1911c Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 29 Oct 2017 14:40:15 +0100 Subject: [PATCH 073/973] Return True if associate_customer_card runs ok --- utils/stripe_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/stripe_utils.py b/utils/stripe_utils.py index 2742045a..cb9ae6fb 100644 --- a/utils/stripe_utils.py +++ b/utils/stripe_utils.py @@ -86,6 +86,7 @@ class StripeUtils(object): if set_as_default: customer.default_source = card.id customer.save() + return True @handleStripeError def dissociate_customer_card(self, stripe_customer_id, card_id): From bea3477d848a8f87526e44ece06df5c0352ee801 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 29 Oct 2017 14:45:14 +0100 Subject: [PATCH 074/973] Handle errors related to payment by redirecting to payment page --- datacenterlight/views.py | 39 ++++++++++++++++++++++++++--- hosting/views.py | 54 +++++++++++++++++++++++++++++++++++----- 2 files changed, 84 insertions(+), 9 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index baec4ee6..d9c0fbc1 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -603,21 +603,46 @@ class OrderConfirmationView(DetailView): } return HttpResponse(json.dumps(response), content_type="application/json") - card_details_dict = card_details.get('response_object') + card_details_response = card_details['response_object'] + card_details_dict = { + 'last4': card_details_response['last4'], + 'brand': card_details_response['brand'], + 'card_id': card_details_response['card_id'] + } ucd = UserCardDetail.contains( request.user.stripecustomer, card_details_dict ) if not ucd: - stripe_utils.associate_customer_card( + acc_result = stripe_utils.associate_customer_card( stripe_api_cus_id, request.session['token'], set_as_default=True ) + if acc_result['response_object'] is None: + response = { + 'status': False, + 'redirect': "{url}#{section}".format( + url=reverse('datacenterlight:payment'), + section='payment_error'), + 'msg_title': str(_('Error.')), + 'msg_body': str( + _('There was a payment related error.' + ' On close of this popup, you will be redirected back to' + ' the payment page.')) + } + logger.error( + "Card association failed. Error {error}".format( + error=acc_result['error'] + ) + ) + return HttpResponse(json.dumps(response), + content_type="application/json") else: card_id = request.session.get('card_id') user_card_detail = UserCardDetail.objects.get(id=card_id) card_details_dict = { 'last4': user_card_detail.last4, - 'brand': user_card_detail.brand + 'brand': user_card_detail.brand, + 'card_id': user_card_detail.card_id } if not user_card_detail.preferred: UserCardDetail.set_default_card( @@ -646,6 +671,14 @@ class OrderConfirmationView(DetailView): # Check if the subscription was approved and is active if (stripe_subscription_obj is None or stripe_subscription_obj.status != 'active'): + if request.user.is_authenticated(): + sac_id = request.user.stripecustomer.stripe_id + else: + sac_id = stripe_api_cus_id + stripe_utils.dissociate_customer_card( + sac_id, + card_details_dict['card_id'] + ) msg = subscription_result.get('error') messages.add_message(self.request, messages.ERROR, msg, extra_tags='failed_payment') diff --git a/hosting/views.py b/hosting/views.py index f61a4b19..6d5c9a78 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -632,6 +632,18 @@ class SettingsView(LoginRequiredMixin, FormView): msg = _('You seem to have already added this card') messages.add_message(request, messages.ERROR, msg) else: + acc_result = stripe_utils.associate_customer_card( + request.user.stripecustomer.stripe_id, token + ) + if acc_result['response_object'] is None: + msg = _( + 'An error occurred while associating the card.' + ' Details: {details}'.format( + details=acc_result['error'] + ) + ) + messages.add_message(request, messages.ERROR, msg) + return self.render_to_response(self.get_context_data()) preferred = False if stripe_customer.usercarddetail_set.count() == 0: preferred = True @@ -645,9 +657,6 @@ class SettingsView(LoginRequiredMixin, FormView): card_id=card['card_id'], preferred=preferred ) - stripe_utils.associate_customer_card( - request.user.stripecustomer.stripe_id, token - ) msg = _( "Successfully associated the card with your account" ) @@ -866,22 +875,48 @@ class OrdersHostingDetailView(LoginRequiredMixin, card_details_response = card_details['response_object'] card_details_dict = { 'last4': card_details_response['last4'], - 'brand': card_details_response['brand'] + 'brand': card_details_response['brand'], + 'card_id': card_details_response['card_id'] } ucd = UserCardDetail.contains( request.user.stripecustomer, card_details_response ) if not ucd: - stripe_utils.associate_customer_card( + acc_result = stripe_utils.associate_customer_card( stripe_api_cus_id, request.session['token'], set_as_default=True ) + if acc_result['response_object'] is None: + msg = _( + 'An error occurred while associating the card.' + ' Details: {details}'.format( + details=acc_result['error'] + ) + ) + messages.add_message(self.request, messages.ERROR, msg, + extra_tags='failed_payment') + response = { + 'status': False, + 'redirect': "{url}#{section}".format( + url=reverse('hosting:payment'), + section='payment_error'), + 'msg_title': str(_('Error.')), + 'msg_body': str( + _('There was a payment related error.' + ' On close of this popup, you will be redirected' + ' back to the payment page.') + ) + } + return HttpResponse( + json.dumps(response), content_type="application/json" + ) else: card_id = request.session.get('card_id') user_card_detail = UserCardDetail.objects.get(id=card_id) card_details_dict = { 'last4': user_card_detail.last4, - 'brand': user_card_detail.brand + 'brand': user_card_detail.brand, + 'card_id': user_card_detail.card_id } if not user_card_detail.preferred: UserCardDetail.set_default_card( @@ -911,6 +946,13 @@ class OrdersHostingDetailView(LoginRequiredMixin, # Check if the subscription was approved and is active if (stripe_subscription_obj is None or stripe_subscription_obj.status != 'active'): + # At this point, we have created a Stripe API card, but and + # associated it with the customer; but the transaction failed + # due to some reason. So, we dissociate this card. + stripe_utils.dissociate_customer_card( + request.user.stripecustomer.stripe_id, + card_details_dict['card_id'] + ) msg = subscription_result.get('error') messages.add_message(self.request, messages.ERROR, msg, extra_tags='failed_payment') From abe8c9efa52b13f4d87eb07392b63c0d3494a4ad Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 29 Oct 2017 15:05:32 +0100 Subject: [PATCH 075/973] Add error details to messages datacenterlight landing flow --- datacenterlight/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index d9c0fbc1..f58b8276 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -610,7 +610,7 @@ class OrderConfirmationView(DetailView): 'card_id': card_details_response['card_id'] } ucd = UserCardDetail.contains( - request.user.stripecustomer, card_details_dict + request.user.stripecustomer, card_details_response ) if not ucd: acc_result = stripe_utils.associate_customer_card( @@ -618,6 +618,11 @@ class OrderConfirmationView(DetailView): set_as_default=True ) if acc_result['response_object'] is None: + msg = acc_result.get('error') + messages.add_message( + self.request, messages.ERROR, msg, + extra_tags='failed_payment' + ) response = { 'status': False, 'redirect': "{url}#{section}".format( From 63eb7fc0e2278721932adebe114e3cfe7236313e Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 29 Oct 2017 21:31:11 +0100 Subject: [PATCH 076/973] Rename contains to get_user_card_details --- hosting/models.py | 9 +++++---- hosting/views.py | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/hosting/models.py b/hosting/models.py index 9486eae7..7a181fe1 100644 --- a/hosting/models.py +++ b/hosting/models.py @@ -312,21 +312,22 @@ class UserCardDetail(AssignPermissionsMixin, models.Model): user_card_detail.save() @staticmethod - def contains(stripe_customer, card_details): + def get_user_card_details(stripe_customer, card_details): """ A utility function to check whether a StripeCustomer is already associated with the card having given details + :param stripe_customer: :param card_details: - :return: + :return: The UserCardDetails object if it exists, False otherwise """ try: - UserCardDetail.objects.get( + ucd = UserCardDetail.objects.get( stripe_customer=stripe_customer, fingerprint=card_details['fingerprint'], exp_month=card_details['exp_month'], exp_year=card_details['exp_year'] ) - return True + return ucd except UserCardDetail.DoesNotExist: return False diff --git a/hosting/views.py b/hosting/views.py index 6d5c9a78..5a9c2e2e 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -628,7 +628,7 @@ class SettingsView(LoginRequiredMixin, FormView): email=request.user.email, token=token ) card = card_details['response_object'] - if UserCardDetail.contains(stripe_customer, card): + if UserCardDetail.get_user_card_details(stripe_customer, card): msg = _('You seem to have already added this card') messages.add_message(request, messages.ERROR, msg) else: @@ -878,7 +878,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, 'brand': card_details_response['brand'], 'card_id': card_details_response['card_id'] } - ucd = UserCardDetail.contains( + ucd = UserCardDetail.get_user_card_details( request.user.stripecustomer, card_details_response ) if not ucd: From af1690b84621322c86fa27a07031d72388da614f Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 29 Oct 2017 21:36:12 +0100 Subject: [PATCH 077/973] Fix: obtaining stripe_customer in landing flow --- datacenterlight/views.py | 82 ++++++++++++++++++++++------------------ 1 file changed, 46 insertions(+), 36 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index f58b8276..1a817310 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -403,8 +403,7 @@ class PaymentOrderView(FormView): return HttpResponseRedirect(reverse('datacenterlight:index')) HostingUtils.clear_items_from_list( request.session, - ['token', 'billing_address_data', 'card_id', 'customer', - 'user'] + ['token', 'card_id', 'customer', 'user'] ) if 'token' in request.session: del request.session['token'] @@ -609,38 +608,49 @@ class OrderConfirmationView(DetailView): 'brand': card_details_response['brand'], 'card_id': card_details_response['card_id'] } - ucd = UserCardDetail.contains( - request.user.stripecustomer, card_details_response - ) - if not ucd: - acc_result = stripe_utils.associate_customer_card( - stripe_api_cus_id, request.session['token'], - set_as_default=True - ) - if acc_result['response_object'] is None: - msg = acc_result.get('error') - messages.add_message( - self.request, messages.ERROR, msg, - extra_tags='failed_payment' + s_cus = None + try: + s_cus = StripeCustomer.objects.get(stripe_id=stripe_api_cus_id) + except StripeCustomer.DoesNotExist: + pass + if s_cus: + ucd = UserCardDetail.get_user_card_details(s_cus, card_details_response) + if not ucd: + acc_result = stripe_utils.associate_customer_card( + stripe_api_cus_id, request.session['token'], + set_as_default=True ) - response = { - 'status': False, - 'redirect': "{url}#{section}".format( - url=reverse('datacenterlight:payment'), - section='payment_error'), - 'msg_title': str(_('Error.')), - 'msg_body': str( - _('There was a payment related error.' - ' On close of this popup, you will be redirected back to' - ' the payment page.')) - } - logger.error( - "Card association failed. Error {error}".format( - error=acc_result['error'] + if acc_result['response_object'] is None: + msg = acc_result.get('error') + messages.add_message( + self.request, messages.ERROR, msg, + extra_tags='failed_payment' + ) + response = { + 'status': False, + 'redirect': "{url}#{section}".format( + url=reverse('datacenterlight:payment'), + section='payment_error'), + 'msg_title': str(_('Error.')), + 'msg_body': str( + _('There was a payment related error.' + ' On close of this popup, you will be ' + 'redirected back to the payment page.') + ) + } + logger.error( + "Card association failed. Error {error}".format( + error=acc_result['error'] + ) + ) + return HttpResponse(json.dumps(response), + content_type="application/json") + else: + if not ucd.preferred: + UserCardDetail.set_default_card( + stripe_api_cus_id=stripe_api_cus_id, + stripe_source_id=ucd.card_id ) - ) - return HttpResponse(json.dumps(response), - content_type="application/json") else: card_id = request.session.get('card_id') user_card_detail = UserCardDetail.objects.get(id=card_id) @@ -745,13 +755,13 @@ class OrderConfirmationView(DetailView): billing_address_data.update({ 'user': custom_user.id }) - if 'token' in request.session: + if 'token' in request.session and s_cus is not None: ucd = UserCardDetail.get_or_create_user_card_detail( - stripe_customer=self.request.user.stripecustomer, - card_details=card_details_dict + stripe_customer=s_cus, + card_details=card_details_response ) UserCardDetail.save_default_card_local( - self.request.user.stripecustomer.stripe_id, + s_cus.stripe_id, ucd.card_id ) user = { From 618d0004f2456b236d4d427e98631234ea355922 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 29 Oct 2017 21:41:54 +0100 Subject: [PATCH 078/973] Rearrange code --- datacenterlight/views.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 1a817310..36ca81d6 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -451,12 +451,11 @@ class PaymentOrderView(FormView): user_card_detail = UserCardDetail.objects.get( id=card_id) if not request.user.has_perm( - 'view_usercarddetail', user_card_detail + 'view_usercarddetail', user_card_detail ): raise UserCardDetail.DoesNotExist( - _( - "{user} does not have permission to access the " - "card").format(user=request.user.email) + _("{user} does not have permission to access" + " the card").format(user=request.user.email) ) except UserCardDetail.DoesNotExist as e: ex = str(e) @@ -496,9 +495,9 @@ class PaymentOrderView(FormView): ) ) customer = StripeCustomer.create_stripe_api_customer( - email=user_email, - token=token, - customer_name=user_name) + email=user_email, token=token, + customer_name=user_name + ) except CustomUser.DoesNotExist: logger.debug( ("StripeCustomer does not exist for {email}." @@ -597,8 +596,8 @@ class OrderConfirmationView(DetailView): 'msg_title': str(_('Error.')), 'msg_body': str( _('There was a payment related error.' - ' On close of this popup, you will be redirected back to' - ' the payment page.')) + ' On close of this popup, you will be redirected ' + 'back to the payment page.')) } return HttpResponse(json.dumps(response), content_type="application/json") From 3d8f81339b41218e58a2d8f2659d37781188838d Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 29 Oct 2017 21:49:15 +0100 Subject: [PATCH 079/973] Refactor, reorganize some code --- datacenterlight/views.py | 42 ++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 36ca81d6..51cd18fd 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -560,10 +560,13 @@ class OrderConfirmationView(DetailView): card_detail_resp = card_details.get('response_object') if not card_detail_resp: msg = card_details.get('error') - messages.add_message(self.request, messages.ERROR, msg, - extra_tags='failed_payment') + messages.add_message( + self.request, messages.ERROR, msg, + extra_tags='failed_payment' + ) return HttpResponseRedirect( - reverse('datacenterlight:payment') + '#payment_error') + reverse('datacenterlight:payment') + '#payment_error' + ) context['cc_last4'] = card_detail_resp.get('last4') context['cc_brand'] = card_detail_resp.get('brand') else: @@ -586,8 +589,10 @@ class OrderConfirmationView(DetailView): ) if not card_details.get('response_object'): msg = card_details.get('error') - messages.add_message(self.request, messages.ERROR, msg, - extra_tags='failed_payment') + messages.add_message( + self.request, messages.ERROR, msg, + extra_tags='failed_payment' + ) response = { 'status': False, 'redirect': "{url}#{section}".format( @@ -599,8 +604,9 @@ class OrderConfirmationView(DetailView): ' On close of this popup, you will be redirected ' 'back to the payment page.')) } - return HttpResponse(json.dumps(response), - content_type="application/json") + return HttpResponse( + json.dumps(response), content_type="application/json" + ) card_details_response = card_details['response_object'] card_details_dict = { 'last4': card_details_response['last4'], @@ -709,7 +715,6 @@ class OrderConfirmationView(DetailView): } return HttpResponse(json.dumps(response), content_type="application/json") - # Create user if the user is not logged in and if he is not already # registered if not request.user.is_authenticated(): @@ -747,7 +752,6 @@ class OrderConfirmationView(DetailView): # object already exists stripe_customer_id = request.user.stripecustomer.id custom_user = request.user - # Save billing address billing_address_data = request.session.get('billing_address_data') logger.debug('billing_address_data is {}'.format(billing_address_data)) @@ -771,16 +775,16 @@ class OrderConfirmationView(DetailView): 'request_host': request.get_host(), 'language': get_language(), } - - create_vm_task.delay(vm_template_id, user, specs, template, - stripe_customer_id, billing_address_data, - stripe_subscription_obj.id, card_details_dict) - for session_var in ['specs', 'template', 'billing_address', - 'billing_address_data', - 'token', 'customer']: - if session_var in request.session: - del request.session[session_var] - + create_vm_task.delay( + vm_template_id, user, specs, template, stripe_customer_id, + billing_address_data, stripe_subscription_obj.id, + card_details_dict + ) + HostingUtils.clear_items_from_list( + request.session, + ['specs', 'template', 'billing_address', 'billing_address_data', + 'token', 'customer'] + ) response = { 'status': True, 'redirect': reverse( From edac806c118f642b737c7999c02d99643a67b639 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 29 Oct 2017 21:56:29 +0100 Subject: [PATCH 080/973] Some more refactoring --- datacenterlight/views.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 51cd18fd..50148418 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -785,17 +785,18 @@ class OrderConfirmationView(DetailView): ['specs', 'template', 'billing_address', 'billing_address_data', 'token', 'customer'] ) + if request.user.is_authenticated(): + redirect_url = reverse('hosting:virtual_machines') + else: + redirect_url = reverse('datacenterlight:index') response = { 'status': True, - 'redirect': reverse( - 'hosting:virtual_machines') if request.user.is_authenticated() else reverse( - 'datacenterlight:index'), + 'redirect': redirect_url, 'msg_title': str(_('Thank you for the order.')), 'msg_body': str( _('Your VM will be up and running in a few moments.' ' We will send you a confirmation email as soon as' ' it is ready.')) } - return HttpResponse(json.dumps(response), content_type="application/json") From 62f30bf03c37301061b357ab14daa90ea363b648 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 29 Oct 2017 22:03:19 +0100 Subject: [PATCH 081/973] Remove some commented and unnecessary code --- .../datacenterlight/landing_payment.html | 38 ------------------- datacenterlight/views.py | 15 -------- hosting/templates/hosting/settings.html | 10 ----- 3 files changed, 63 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/landing_payment.html b/datacenterlight/templates/datacenterlight/landing_payment.html index 69c80d35..5ac601ce 100644 --- a/datacenterlight/templates/datacenterlight/landing_payment.html +++ b/datacenterlight/templates/datacenterlight/landing_payment.html @@ -112,44 +112,6 @@ {% endif %} {% include "hosting/includes/_card_input.html" %} - {% comment %} -
- {% if credit_card_data.last4 %} - -
Credit Card
-
Last 4: *****{{credit_card_data.last4}}
-
Type: {{credit_card_data.cc_brand}}
- - - {% if not messages and not form.non_field_errors %} -

- {% trans "You are not making any payment yet. After submitting your card information, you will be taken to the Confirm Order Page." %} -

- {% endif %} -
- {% for message in messages %} - {% if 'failed_payment' or 'make_charge_error' in message.tags %} -
    -
  • -

    {{ message|safe }}

    -
  • -
- {% endif %} - {% endfor %} - {% for error in form.non_field_errors %} -

- {{ error|escape }} -

- {% endfor %} -
-
- -
- {% else %} - {% include "hosting/includes/_card_input.html" %} - {% endif %} -
- {% endcomment %} {% endwith %} diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 50148418..3a8bdac6 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -359,7 +359,6 @@ class PaymentOrderView(FormView): billing_address_data = self.request.session['billing_address_data'] else: billing_address_data = {} - if self.request.user.is_authenticated(): if billing_address_data: billing_address_form = BillingAddressForm( @@ -369,24 +368,10 @@ class PaymentOrderView(FormView): billing_address_form = BillingAddressForm( instance=self.request.user.billing_addresses.first() ) - # Get user last order - last_hosting_order = HostingOrder.objects.filter( - customer__user=self.request.user - ).last() - - # If user has already an hosting order, get the credit card - # data from it - if last_hosting_order: - credit_card_data = last_hosting_order.get_cc_data() - if credit_card_data: - context['credit_card_data'] = credit_card_data - else: - context['credit_card_data'] = None else: billing_address_form = BillingAddressFormSignup( initial=billing_address_data ) - context.update({ 'cards_list': cards_list, 'stripe_key': settings.STRIPE_API_PUBLIC_KEY, diff --git a/hosting/templates/hosting/settings.html b/hosting/templates/hosting/settings.html index 6b5acbee..64057747 100644 --- a/hosting/templates/hosting/settings.html +++ b/hosting/templates/hosting/settings.html @@ -123,14 +123,4 @@ })(); {%endif%} - - {% comment %} - {% if credit_card_data.last4 and credit_card_data.cc_brand %} - - {%endif%} - {% endcomment %} {%endblock%} From 4be27962703cdb2774e1b0d13842ba3df3b22846 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 29 Oct 2017 22:40:21 +0100 Subject: [PATCH 082/973] Clean up some unnecessary code --- datacenterlight/views.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 3a8bdac6..fb34f5b4 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -348,10 +348,9 @@ class PaymentOrderView(FormView): def get_context_data(self, **kwargs): context = super(PaymentOrderView, self).get_context_data(**kwargs) user = self.request.user + stripe_customer = None if hasattr(user, 'stripecustomer'): stripe_customer = user.stripecustomer - else: - stripe_customer = None cards_list = UserCardDetail.get_all_cards_list( stripe_customer=stripe_customer ) @@ -390,8 +389,6 @@ class PaymentOrderView(FormView): request.session, ['token', 'card_id', 'customer', 'user'] ) - if 'token' in request.session: - del request.session['token'] return self.render_to_response(self.get_context_data()) def post(self, request, *args, **kwargs): From 83dbae74e6a661b649f79d2b691ea8dc73a2e8d2 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 29 Oct 2017 22:54:33 +0100 Subject: [PATCH 083/973] Add missing card_id to session variables to be cleared --- datacenterlight/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index fb34f5b4..f9d1dede 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -765,7 +765,7 @@ class OrderConfirmationView(DetailView): HostingUtils.clear_items_from_list( request.session, ['specs', 'template', 'billing_address', 'billing_address_data', - 'token', 'customer'] + 'token', 'customer', 'card_id'] ) if request.user.is_authenticated(): redirect_url = reverse('hosting:virtual_machines') From 16b6ecb38cdc87737c54e9f51e3ffa7eff51014a Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 29 Oct 2017 23:48:33 +0100 Subject: [PATCH 084/973] Clear session variables on payment error --- hosting/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hosting/views.py b/hosting/views.py index 5a9c2e2e..37d6eabb 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -39,7 +39,7 @@ from utils.forms import ( BillingAddressForm, PasswordResetRequestForm, UserBillingAddressForm, ResendActivationEmailForm ) -from utils.hosting_utils import get_vm_price +from utils.hosting_utils import get_vm_price, HostingUtils from utils.mailer import BaseEmail from utils.stripe_utils import StripeUtils from utils.views import ( @@ -707,6 +707,10 @@ class PaymentVMView(LoginRequiredMixin, FormView): def get(self, request, *args, **kwargs): if 'next' in request.session: del request.session['next'] + HostingUtils.clear_items_from_list( + request.session, + ['token', 'card_id', 'customer', 'user'] + ) return self.render_to_response(self.get_context_data()) def post(self, request, *args, **kwargs): From 24d904288fd0724178af021fcbeec01fadf54947 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 30 Oct 2017 00:26:18 +0100 Subject: [PATCH 085/973] Clear token and card form variables explicitly --- datacenterlight/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index f9d1dede..f2af35cd 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -356,6 +356,10 @@ class PaymentOrderView(FormView): ) if 'billing_address_data' in self.request.session: billing_address_data = self.request.session['billing_address_data'] + if 'token' in billing_address_data: + billing_address_data.pop('token') + if 'card' in billing_address_data: + billing_address_data.pop('card') else: billing_address_data = {} if self.request.user.is_authenticated(): From a2a35a9475eb6bafd7d6d70d991416a21caab0f4 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 30 Oct 2017 08:26:35 +0100 Subject: [PATCH 086/973] Fix error accessing stripecustomer for user when it doesn't exist --- hosting/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hosting/views.py b/hosting/views.py index 37d6eabb..3b259242 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -552,8 +552,11 @@ class SettingsView(LoginRequiredMixin, FormView): def get_context_data(self, **kwargs): context = super(SettingsView, self).get_context_data(**kwargs) user = self.request.user + stripe_customer = None + if hasattr(user, 'stripecustomer'): + stripe_customer = user.stripecustomer cards_list = UserCardDetail.get_all_cards_list( - stripe_customer=user.stripecustomer + stripe_customer=stripe_customer ) context.update({ 'cards_list': cards_list, From 3e08760e044bfed66cb1363a4bfcb8de95b93d52 Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 31 Oct 2017 08:58:43 +0100 Subject: [PATCH 087/973] Change letter-spacing to 2px for settings-container buttons --- hosting/static/hosting/css/commons.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/static/hosting/css/commons.css b/hosting/static/hosting/css/commons.css index 33381370..32a1338e 100644 --- a/hosting/static/hosting/css/commons.css +++ b/hosting/static/hosting/css/commons.css @@ -363,7 +363,7 @@ } .settings-container .choice-btn { - letter-spacing: 1px; + letter-spacing: 2px; min-width: 127px; } From d8ce0f95c5d92d2c9648051e5cef5f54f03ce04b Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 31 Oct 2017 09:02:07 +0100 Subject: [PATCH 088/973] Change letter-spacing to 2px for btn-vm-contact --- hosting/static/hosting/css/virtual-machine.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/static/hosting/css/virtual-machine.css b/hosting/static/hosting/css/virtual-machine.css index 3329d6fe..5f91fe2f 100644 --- a/hosting/static/hosting/css/virtual-machine.css +++ b/hosting/static/hosting/css/virtual-machine.css @@ -413,7 +413,7 @@ border: 2px solid #A3C0E2; padding: 5px 25px; font-size: 12px; - letter-spacing: 1.3px; + letter-spacing: 2px; } .btn-vm-contact:hover, .btn-vm-contact:focus { background: #fff; From f9bd8493330cd809f4c47ea98e7c21ba8b1fb1cd Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 31 Oct 2017 09:05:49 +0100 Subject: [PATCH 089/973] Remove redundant "previous" text --- .../templates/datacenterlight/landing_payment.html | 4 ++-- hosting/templates/hosting/payment.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/landing_payment.html b/datacenterlight/templates/datacenterlight/landing_payment.html index 5ac601ce..e0bd56a9 100644 --- a/datacenterlight/templates/datacenterlight/landing_payment.html +++ b/datacenterlight/templates/datacenterlight/landing_payment.html @@ -89,7 +89,7 @@

{% if card_list_len > 0 %} - {% blocktrans %}Please select one of the previous cards that you used before or fill in your credit card information below. We are using Stripe for payment and do not store your information in our database.{% endblocktrans %} + {% blocktrans %}Please select one of the cards that you used before or fill in your credit card information below. We are using Stripe for payment and do not store your information in our database.{% endblocktrans %} {% else %} {% blocktrans %}Please fill in your credit card information below. We are using Stripe for payment and do not store your information in our database.{% endblocktrans %} {% endif %} @@ -108,7 +108,7 @@ {% endfor %} {% if card_list_len > 0 %} -

Use another card
+
{% trans "Use another card" %}
{% endif %} {% include "hosting/includes/_card_input.html" %} diff --git a/hosting/templates/hosting/payment.html b/hosting/templates/hosting/payment.html index 10fd4674..a321b44c 100644 --- a/hosting/templates/hosting/payment.html +++ b/hosting/templates/hosting/payment.html @@ -72,7 +72,7 @@

{% if card_list_len > 0 %} - {% blocktrans %}Please select one of the previous cards that you used before or fill in your credit card information below. We are using Stripe for payment and do not store your information in our database.{% endblocktrans %} + {% blocktrans %}Please select one of the cards that you used before or fill in your credit card information below. We are using Stripe for payment and do not store your information in our database.{% endblocktrans %} {% else %} {% blocktrans %}Please fill in your credit card information below. We are using Stripe for payment and do not store your information in our database.{% endblocktrans %} {% endif %} @@ -91,7 +91,7 @@

{% endfor %} {% if card_list_len > 0 %} -
Use another card
+
{% trans "Use another card" %}
{% endif %} {% include "hosting/includes/_card_input.html" %} From c438c0d8cbab7d8518d929cc675fa5d8fc5d1d13 Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 31 Oct 2017 09:38:36 +0100 Subject: [PATCH 090/973] Add some de translations --- .../locale/de/LC_MESSAGES/django.po | 48 +++++++--- hosting/locale/de/LC_MESSAGES/django.po | 87 +++++++++++++++---- 2 files changed, 108 insertions(+), 27 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index 3b8c9ca6..2fe8dba8 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-10-17 00:32+0530\n" +"POT-Creation-Date: 2017-10-31 08:23+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -345,6 +345,17 @@ msgstr "Monat" msgid "Credit Card" msgstr "Kreditkarte" +msgid "" +"Please select one of the cards that you used before or fill in your credit " +"card information below. We are using Stripe for payment and do not store your information in our " +"database." +msgstr "" +"Bitte wähle Seine der Karten aus, die du zuvor verwendet hast, oder gib " +"deine Kreditkartendaten unten ein. Wir verwenden Stripe als " +"Zahlungdiensleister und speichern deine Daten nicht in unserer Datenbank." + msgid "" "Please fill in your credit card information below. We are using Stripe for payment and do not " @@ -354,12 +365,17 @@ msgstr "" "\"https://stripe.com\" target=\"_blank\">Stripe für die Bezahlung und " "speichern keine Informationen in unserer Datenbank." -msgid "" -"You are not making any payment yet. After submitting your card information, " -"you will be taken to the Confirm Order Page." -msgstr "" -"Es wird noch keine Bezahlung vorgenommen. Die Bezahlung wird erst ausgelöst, " -"nachdem Du die Bestellung auf der nächsten Seite bestätigt hast." +msgid "Last" +msgstr "Vor" + +msgid "Type" +msgstr "Kartentyp" + +msgid "SELECT" +msgstr "Auswählen" + +msgid "Use another card" +msgstr "Benutze eine andere Kreditkarte" msgid "Processing" msgstr "Weiter" @@ -471,6 +487,13 @@ msgstr "Ungültige RAM-Grösse" msgid "Invalid storage size" msgstr "Ungültige Speicher-Grösse" +#, python-brace-format +msgid "{user} does not have permission to access the card" +msgstr "" + +msgid "An error occurred. Details: {}" +msgstr "" + msgid "Confirm Order" msgstr "Bestellung Bestätigen" @@ -494,15 +517,20 @@ msgstr "" "Deine VM ist gleich bereit. Wir senden Dir eine Bestätigungsemail, sobald Du " "auf sie zugreifen kannst." +#~ msgid "" +#~ "You are not making any payment yet. After submitting your card " +#~ "information, you will be taken to the Confirm Order Page." +#~ msgstr "" +#~ "Es wird noch keine Bezahlung vorgenommen. Die Bezahlung wird erst " +#~ "ausgelöst, nachdem Du die Bestellung auf der nächsten Seite bestätigt " +#~ "hast." + #~ msgid "Card Number" #~ msgstr "Kreditkartennummer" #~ msgid "Expiry Date" #~ msgstr "Ablaufdatum" -#~ msgid "Card Type" -#~ msgstr "Kartentyp" - #~ msgid "Processing..." #~ msgstr "Abarbeitung..." diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index 64e4a73e..3614dc49 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-10-17 00:32+0530\n" +"POT-Creation-Date: 2017-10-31 08:23+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -437,6 +437,17 @@ msgstr "inkl. Mehrwertsteuer" msgid "Billing Address" msgstr "Rechnungsadresse" +msgid "" +"Please select one of the cards that you used before or fill in your credit " +"card information below. We are using Stripe for payment and do not store your information in our " +"database." +msgstr "" +"Bitte wähle Seine der Karten aus, die du zuvor verwendet hast, oder gib " +"deine Kreditkartendaten unten ein. Wir verwenden Stripe als " +"Zahlungdiensleister und speichern deine Daten nicht in unserer Datenbank." + msgid "" "Please fill in your credit card information below. We are using Stripe for payment and do not " @@ -446,12 +457,17 @@ msgstr "" "\"https://stripe.com\" target=\"_blank\">Stripe für die Bezahlung und " "speichern keine Informationen in unserer Datenbank." -msgid "" -"You are not making any payment yet. After submitting your card information, " -"you will be taken to the Confirm Order Page." -msgstr "" -"Es wird noch keine Bezahlung vorgenommen. Die Bezahlung wird erst ausgelöst, " -"nachdem Du die Bestellung auf der nächsten Seite bestätigt hast." +msgid "Last" +msgstr "Vor" + +msgid "Type" +msgstr "Kartentyp" + +msgid "SELECT" +msgstr "Auswählen" + +msgid "Use another card" +msgstr "Benutze eine andere Kreditkarte" msgid "Processing" msgstr "Weiter" @@ -468,16 +484,19 @@ msgstr "Passwort zurücksetzen" msgid "UPDATE" msgstr "" -msgid "Last" -msgstr "" - -msgid "Type" -msgstr "Kartentyp" - msgid "REMOVE CARD" msgstr "KARTE ENTFERNEN" -msgid "SELECT" +msgid "Remove Card" +msgstr "Karte Entfernen" + +msgid "Do you want to remove this associated card?" +msgstr "" + +msgid "Delete" +msgstr "Löschen" + +msgid "DEFAULT" msgstr "" msgid "No Credit Cards Added" @@ -534,9 +553,6 @@ msgstr "" msgid "Private Key" msgstr "" -msgid "Delete" -msgstr "Löschen" - msgid "Delete SSH Key" msgstr "SSH Key löschen" @@ -668,6 +684,35 @@ msgstr "Dein Passwort konnte nicht zurückgesetzt werden." msgid "The reset password link is no longer valid." msgstr "Der Link zum Zurücksetzen Deines Passwortes ist nicht mehr gültig." +msgid "Card deassociation successful" +msgstr "" + +msgid "You are not permitted to do this operation" +msgstr "" + +msgid "The selected card does not exist" +msgstr "" + +msgid "Billing address updated successfully" +msgstr "" + +msgid "You seem to have already added this card" +msgstr "" + +#, python-brace-format +msgid "An error occurred while associating the card. Details: {details}" +msgstr "Beim Zuordnen der Karte ist ein Fehler aufgetreten. Details: {details}" + +msgid "Successfully associated the card with your account" +msgstr "" + +#, python-brace-format +msgid "{user} does not have permission to access the card" +msgstr "" + +msgid "An error occurred. Details: {}" +msgstr "" + msgid "Invalid credit card" msgstr "Ungültige Kreditkarte" @@ -735,6 +780,14 @@ msgstr "" "Es gab einen Fehler bei der Bearbeitung Deine Anfrage. Bitte versuche es " "noch einmal." +#~ msgid "" +#~ "You are not making any payment yet. After submitting your card " +#~ "information, you will be taken to the Confirm Order Page." +#~ msgstr "" +#~ "Es wird noch keine Bezahlung vorgenommen. Die Bezahlung wird erst " +#~ "ausgelöst, nachdem Du die Bestellung auf der nächsten Seite bestätigt " +#~ "hast." + #~ msgid "Reset your password" #~ msgstr "Passwort zurücksetzen" From 272e14f71253dbf2dcac22a1a8f0e7cf889be301 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 27 Nov 2017 08:43:34 +0100 Subject: [PATCH 091/973] Update hosting django.po --- hosting/locale/de/LC_MESSAGES/django.po | 42 +++---------------------- 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index 6721a75c..6774fa8d 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-10-31 08:23+0000\n" +"POT-Creation-Date: 2017-11-27 07:43+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -453,9 +453,9 @@ msgid "" "database." msgstr "" "Bitte wähle Seine der Karten aus, die du zuvor verwendet hast, oder gib " -"deine Kreditkartendaten unten ein. Wir verwenden Stripe als " -"Zahlungdiensleister und speichern deine Daten nicht in unserer Datenbank." +"deine Kreditkartendaten unten ein. Wir verwenden Stripe als Zahlungdiensleister und speichern deine " +"Daten nicht in unserer Datenbank." msgid "" "Please fill in your credit card information below. We are using Stripe für die Bezahlung und " "speichern keine Informationen in unserer Datenbank." -msgid "" -"You are not making any payment yet. After submitting your card information, " -"you will be taken to the Confirm Order Page." -msgstr "" -"Es wird noch keine Bezahlung vorgenommen. Die Bezahlung wird erst ausgelöst, " -"nachdem Du die Bestellung auf der nächsten Seite bestätigt hast." - -msgid "SUBMIT" -msgstr "ABSENDEN" - -msgid "Card Number" -msgstr "Kreditkartennummer" - -msgid "Expiry Date" -msgstr "Ablaufdatum" - -msgid "CVC" -msgstr "" - -msgid "Card Type" -msgstr "Kartentyp" - msgid "Last" msgstr "Vor" @@ -524,12 +502,6 @@ msgstr "Karte Entfernen" msgid "Do you want to remove this associated card?" msgstr "" -msgid "Last" -msgstr "" - -msgid "Type" -msgstr "Kartentyp" - msgid "Delete" msgstr "Löschen" @@ -590,9 +562,6 @@ msgstr "" msgid "Private Key" msgstr "" -msgid "Delete" -msgstr "Löschen" - msgid "Delete SSH Key" msgstr "SSH Key löschen" @@ -894,9 +863,6 @@ msgstr "" #~ msgid "Notifications " #~ msgstr "Benachrichtigungen" -#~ msgid "REMOVE CARD" -#~ msgstr "KARTE ENTFERNEN" - #~ msgid "EDIT CARD" #~ msgstr "BEARBEITEN" From fc659cab9fcc4078aa7f0ffaa644647e43e96ee2 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Wed, 7 Mar 2018 19:22:13 +0530 Subject: [PATCH 092/973] number localization format for de set same as en --- dynamicweb/formats/__init__.py | 0 dynamicweb/formats/de/__init__.py | 0 dynamicweb/formats/de/formats.py | 2 ++ dynamicweb/settings/base.py | 19 ++++++++++--------- hosting/templates/hosting/orders.html | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 dynamicweb/formats/__init__.py create mode 100644 dynamicweb/formats/de/__init__.py create mode 100644 dynamicweb/formats/de/formats.py diff --git a/dynamicweb/formats/__init__.py b/dynamicweb/formats/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/dynamicweb/formats/de/__init__.py b/dynamicweb/formats/de/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/dynamicweb/formats/de/formats.py b/dynamicweb/formats/de/formats.py new file mode 100644 index 00000000..c1f28af7 --- /dev/null +++ b/dynamicweb/formats/de/formats.py @@ -0,0 +1,2 @@ +DECIMAL_SEPARATOR = '.' +THOUSAND_SEPARATOR = ',' diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index 5027afef..11666ab7 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -255,6 +255,12 @@ USE_L10N = True USE_TZ = True +USE_THOUSAND_SEPARATOR = True + +FORMAT_MODULE_PATH = [ + 'dynamicweb.formats' +] + LANGUAGES = ( ('en-us', _('English')), ('de', _('Deutsch')), @@ -262,11 +268,6 @@ LANGUAGES = ( LANGUAGE_CODE = 'en-us' -LOCALE_PATHS = [ - - os.path.join(PROJECT_DIR, 'digitalglarus/locale'), -] - CMS_PLACEHOLDER_CONF = { 'logo_image': { 'name': 'Logo Image', @@ -334,7 +335,7 @@ CMS_PLACEHOLDER_CONF = { }, } -CMS_PERMISSION=True +CMS_PERMISSION = True CACHES = { 'default': { @@ -522,14 +523,14 @@ if UNGLEICH_SITE_CONFIGS == "": raise Exception("Please define UNGLEICH_SITE_CONFIGS in your .env") else: try: - configs_dict=json.loads(UNGLEICH_SITE_CONFIGS) + configs_dict = json.loads(UNGLEICH_SITE_CONFIGS) except ValueError as verr: raise Exception("UNGLEICH_SITE_CONFIGS is not a valid JSON: {}".format( str(verr) )) else: MULTISITE_CMS_URLS = { - k:v['MULTISITE_CMS_URL'] for (k,v) in configs_dict.items() + k: v['MULTISITE_CMS_URL'] for (k, v) in configs_dict.items() } MULTISITE_CMS_ALIASES = { @@ -611,7 +612,7 @@ DCL_ERROR_EMAILS_TO_LIST = [] if DCL_ERROR_EMAILS_TO is not None: DCL_ERROR_EMAILS_TO_LIST = [x.strip() for x in DCL_ERROR_EMAILS_TO.split( - ',')] \ + ',')] \ if "," in DCL_ERROR_EMAILS_TO else [DCL_ERROR_EMAILS_TO.strip()] if 'info@ungleich.ch' not in DCL_ERROR_EMAILS_TO_LIST: diff --git a/hosting/templates/hosting/orders.html b/hosting/templates/hosting/orders.html index d747979d..e0e85cfd 100644 --- a/hosting/templates/hosting/orders.html +++ b/hosting/templates/hosting/orders.html @@ -30,7 +30,7 @@ {{ order.id }} {{ order.created_at | date:"M d, Y H:i" }} - {{ order.price|unlocalize }} + {{ order.price }} {% trans 'See Invoice' %} From 6baf989547eb04202fd8469586d869502222812a Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 16 Mar 2018 09:32:00 +0100 Subject: [PATCH 093/973] Replace strip with lstrip --- datacenterlight/management/commands/fetchvmtemplates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenterlight/management/commands/fetchvmtemplates.py b/datacenterlight/management/commands/fetchvmtemplates.py index 15b76fc1..16970705 100644 --- a/datacenterlight/management/commands/fetchvmtemplates.py +++ b/datacenterlight/management/commands/fetchvmtemplates.py @@ -15,7 +15,7 @@ class Command(BaseCommand): templates = manager.get_templates() dcl_vm_templates = [] for template in templates: - template_name = template.name.strip('public-') + template_name = template.name.lstrip('public-') template_id = template.id dcl_vm_template = VMTemplate.create(template_name, template_id) dcl_vm_templates.append(dcl_vm_template) From c0c79ebf2b21c09352fe1ecd9ebcc8e4365410ae Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 16 Mar 2018 09:32:13 +0100 Subject: [PATCH 094/973] Format code --- datacenterlight/management/commands/fetchvmtemplates.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/datacenterlight/management/commands/fetchvmtemplates.py b/datacenterlight/management/commands/fetchvmtemplates.py index 16970705..6a45ebad 100644 --- a/datacenterlight/management/commands/fetchvmtemplates.py +++ b/datacenterlight/management/commands/fetchvmtemplates.py @@ -7,7 +7,8 @@ logger = logging.getLogger(__name__) class Command(BaseCommand): - help = 'Fetches the VM templates from OpenNebula and populates the dcl VMTemplate model' + help = '''Fetches the VM templates from OpenNebula and populates the dcl + VMTemplate model''' def handle(self, *args, **options): try: @@ -26,4 +27,5 @@ class Command(BaseCommand): for dcl_vm_template in dcl_vm_templates: dcl_vm_template.save() except Exception as e: - logger.error('Error connecting to OpenNebula. Error Details: {err}'.format(err=str(e))) + logger.error('Error connecting to OpenNebula. Error Details: ' + '{err}'.format(err=str(e))) From f866368e859744e49f33edf7210677922b6c2259 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 16 Mar 2018 09:35:13 +0100 Subject: [PATCH 095/973] Replace other occurrences of strip('public-') with lstrip('public-') --- opennebula_api/serializers.py | 6 +++--- opennebula_api/tests.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opennebula_api/serializers.py b/opennebula_api/serializers.py index cc52a15e..79f37ecd 100644 --- a/opennebula_api/serializers.py +++ b/opennebula_api/serializers.py @@ -36,7 +36,7 @@ class VirtualMachineTemplateSerializer(serializers.Serializer): return int(obj.template.memory) / 1024 def get_name(self, obj): - return obj.name.strip('public-') + return obj.name.lstrip('public-') class VirtualMachineSerializer(serializers.Serializer): @@ -133,7 +133,7 @@ class VirtualMachineSerializer(serializers.Serializer): def get_configuration(self, obj): template_id = obj.template.template_id template = OpenNebulaManager().get_template(template_id) - return template.name.strip('public-') + return template.name.lstrip('public-') def get_ipv4(self, obj): """ @@ -162,7 +162,7 @@ class VirtualMachineSerializer(serializers.Serializer): return '-' def get_name(self, obj): - return obj.name.strip('public-') + return obj.name.lstrip('public-') class VMTemplateSerializer(serializers.Serializer): diff --git a/opennebula_api/tests.py b/opennebula_api/tests.py index 234e0c16..da904576 100644 --- a/opennebula_api/tests.py +++ b/opennebula_api/tests.py @@ -145,5 +145,5 @@ class VirtualMachineSerializerTestCase(TestCase): for vm in self.manager.get_vms(): serialized = VirtualMachineSerializer(vm) - self.assertEqual(serialized.data.get('name'), vm.name.strip('public-')) + self.assertEqual(serialized.data.get('name'), vm.name.lstrip('public-')) break From 26424fe24ec59748aa2ed77d65d84595b928da9f Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 16 Mar 2018 09:38:35 +0100 Subject: [PATCH 096/973] Reformat code --- opennebula_api/tests.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opennebula_api/tests.py b/opennebula_api/tests.py index da904576..b8c5280f 100644 --- a/opennebula_api/tests.py +++ b/opennebula_api/tests.py @@ -145,5 +145,7 @@ class VirtualMachineSerializerTestCase(TestCase): for vm in self.manager.get_vms(): serialized = VirtualMachineSerializer(vm) - self.assertEqual(serialized.data.get('name'), vm.name.lstrip('public-')) + self.assertEqual( + serialized.data.get('name'), vm.name.lstrip('public-') + ) break From 17ceca966cbd3efb031c35acd0ce097be2b2231b Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 16 Mar 2018 09:55:55 +0100 Subject: [PATCH 097/973] Update Changelog --- Changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog b/Changelog index f6fcdc6e..ce22ddaf 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +1.5.3: 2018-03-16 + * #4262: [dcl] Bugfix for incorrect template name 1.5.2: 2018-03-14 * [devuan, ipv6] Add google analytics code for devuanhosting.com, ipv6onlyhosting.{com,net} * #4246: [dcl cms] Enable full width options for DCL plugins From 14b5d9051453f0239bd00ecb4f14dded91b973e7 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 16 Mar 2018 15:29:24 +0530 Subject: [PATCH 098/973] dcl cms navbar logo --- datacenterlight/cms_models.py | 24 +++++++++++++ datacenterlight/cms_plugins.py | 4 +-- .../migrations/0013_dclnavbarpluginmodel.py | 34 +++++++++++++++++++ .../datacenterlight/css/landing-page.css | 4 +++ .../templates/datacenterlight/cms/navbar.html | 10 ++++-- 5 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 datacenterlight/migrations/0013_dclnavbarpluginmodel.py diff --git a/datacenterlight/cms_models.py b/datacenterlight/cms_models.py index 20e39fde..6d394f0f 100644 --- a/datacenterlight/cms_models.py +++ b/datacenterlight/cms_models.py @@ -120,6 +120,30 @@ class DCLLinkPluginModel(CMSPlugin): ) +class DCLNavbarPluginModel(CMSPlugin): + logo_light = FilerImageField( + on_delete=models.CASCADE, null=True, blank=True, + help_text='Logo to be used on transparent navbar' + ) + logo_dark = FilerImageField( + on_delete=models.CASCADE, null=True, blank=True, + help_text='Logo to be used on white navbar' + ) + logo_url = models.URLField(max_length=300, null=True, blank=True) + + def get_logo_dark(self): + if self.logo_dark: + return self.logo_dark.url + else: + return self.logo_white.url + + def get_logo_light(self): + if self.logo_light: + return self.logo_light.url + else: + return self.logo_dark.url + + class DCLNavbarDropdownPluginModel(CMSPlugin): target = models.CharField( max_length=100, null=True, blank=True, diff --git a/datacenterlight/cms_plugins.py b/datacenterlight/cms_plugins.py index 70ecfaa2..3fabfd5d 100644 --- a/datacenterlight/cms_plugins.py +++ b/datacenterlight/cms_plugins.py @@ -6,7 +6,7 @@ from .cms_models import ( DCLBannerItemPluginModel, DCLBannerListPluginModel, DCLContactPluginModel, DCLFooterPluginModel, DCLLinkPluginModel, DCLNavbarDropdownPluginModel, DCLSectionIconPluginModel, DCLSectionImagePluginModel, - DCLSectionPluginModel, + DCLSectionPluginModel, DCLNavbarPluginModel ) from .models import VMTemplate @@ -84,7 +84,7 @@ class DCLBannerItemPlugin(CMSPluginBase): class DCLNavbarPlugin(CMSPluginBase): module = "Datacenterlight" name = "DCL Navbar Plugin" - model = CMSPlugin + model = DCLNavbarPluginModel render_template = "datacenterlight/cms/navbar.html" cache = False allow_children = True diff --git a/datacenterlight/migrations/0013_dclnavbarpluginmodel.py b/datacenterlight/migrations/0013_dclnavbarpluginmodel.py new file mode 100644 index 00000000..b02c2503 --- /dev/null +++ b/datacenterlight/migrations/0013_dclnavbarpluginmodel.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2018-03-16 09:53 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import filer.fields.image + + +class Migration(migrations.Migration): + + dependencies = [ + ('cms', '0014_auto_20160404_1908'), + ('datacenterlight', '0012_dclcalculatorpluginmodel'), + ] + + operations = [ + migrations.CreateModel( + name='DCLNavbarPluginModel', + 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')), + ('logo_url', models.URLField(blank=True, max_length=300, null=True)), + ('logo_dark', filer.fields.image.FilerImageField(blank=True, help_text='Logo to be used on white navbar', + null=True, on_delete=django.db.models.deletion.CASCADE, to='filer.Image')), + ('logo_light', filer.fields.image.FilerImageField(blank=True, help_text='Logo to be used on transparent navbar', + null=True, on_delete=django.db.models.deletion.CASCADE, to='filer.Image')), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + ] diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 2f44613b..6361ea21 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -79,6 +79,10 @@ textarea { border-radius: 6px; } +.navbar-brand > img { + max-height: 30px; +} + @media (max-width: 767px) { .navbar-default .navbar-nav>li>a{ font-weight: 400; diff --git a/datacenterlight/templates/datacenterlight/cms/navbar.html b/datacenterlight/templates/datacenterlight/cms/navbar.html index 30624525..7be5e575 100644 --- a/datacenterlight/templates/datacenterlight/cms/navbar.html +++ b/datacenterlight/templates/datacenterlight/cms/navbar.html @@ -10,8 +10,14 @@ - - + {% url 'datacenterlight:index' as default_logo_url %} + {% if instance.logo_dark or instance.logo_white %} + + + {% else %} + + + {% endif %} - \ No newline at end of file + From b3742ed3f7c2cdfc81dcf1de8e0d511870fafd5f Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sat, 17 Mar 2018 21:33:24 +0530 Subject: [PATCH 106/973] Update Changelog --- Changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog b/Changelog index ce22ddaf..537af052 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +1.5.4: 2018-03-17 + * bgfix: [dcl cms] update DCLNavbarPlugin to allow change of brand logo and url 1.5.3: 2018-03-16 * #4262: [dcl] Bugfix for incorrect template name 1.5.2: 2018-03-14 From b252211a69079e5fceb47ffe62fd765e8a0676fe Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 20 Mar 2018 02:34:20 +0530 Subject: [PATCH 107/973] header btn target accepts id, navbar optional lang dropdown --- datacenterlight/cms_models.py | 4 ++++ ..._dclnavbarpluginmodel_language_dropdown.py | 20 +++++++++++++++++++ .../templates/datacenterlight/cms/navbar.html | 16 ++++++++------- .../migrations/0020_auto_20180320_0216.py | 20 +++++++++++++++++++ ungleich_page/models.py | 9 ++++++--- ...der_with_background_video_slider_item.html | 2 +- 6 files changed, 60 insertions(+), 11 deletions(-) create mode 100644 datacenterlight/migrations/0014_dclnavbarpluginmodel_language_dropdown.py create mode 100644 ungleich_page/migrations/0020_auto_20180320_0216.py diff --git a/datacenterlight/cms_models.py b/datacenterlight/cms_models.py index df54589e..627c49ba 100644 --- a/datacenterlight/cms_models.py +++ b/datacenterlight/cms_models.py @@ -132,6 +132,10 @@ class DCLNavbarPluginModel(CMSPlugin): related_name="dcl_navbar_logo_dark", ) logo_url = models.URLField(max_length=300, null=True, blank=True) + language_dropdown = models.BooleanField( + default=True, + help_text='Select to include the language selection dropdown.' + ) def get_logo_dark(self): # used only if atleast one logo exists diff --git a/datacenterlight/migrations/0014_dclnavbarpluginmodel_language_dropdown.py b/datacenterlight/migrations/0014_dclnavbarpluginmodel_language_dropdown.py new file mode 100644 index 00000000..2c5e6306 --- /dev/null +++ b/datacenterlight/migrations/0014_dclnavbarpluginmodel_language_dropdown.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2018-03-19 20:46 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('datacenterlight', '0013_dclnavbarpluginmodel'), + ] + + operations = [ + migrations.AddField( + model_name='dclnavbarpluginmodel', + name='language_dropdown', + field=models.BooleanField(default=True, help_text='Select to include the language selection dropdown.'), + ), + ] diff --git a/datacenterlight/templates/datacenterlight/cms/navbar.html b/datacenterlight/templates/datacenterlight/cms/navbar.html index fdb28529..cc8ec96b 100644 --- a/datacenterlight/templates/datacenterlight/cms/navbar.html +++ b/datacenterlight/templates/datacenterlight/cms/navbar.html @@ -27,13 +27,15 @@ {% render_plugin plugin %} {% endfor %} -
  • - {% if LANGUAGE_CODE == 'en-us'%} - Deutsch   - {% else %} - English   - {% endif %} -
  • + {% if instance.language_dropdown %} +
  • + {% if LANGUAGE_CODE == 'en-us'%} + Deutsch   + {% else %} + English   + {% endif %} +
  • + {% endif %} {% if not request.user.is_authenticated %}
  • {% trans "Login" %}   diff --git a/ungleich_page/migrations/0020_auto_20180320_0216.py b/ungleich_page/migrations/0020_auto_20180320_0216.py new file mode 100644 index 00000000..1dbd46d2 --- /dev/null +++ b/ungleich_page/migrations/0020_auto_20180320_0216.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2018-03-19 20:46 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('ungleich_page', '0019_merge'), + ] + + operations = [ + migrations.AlterField( + model_name='ungleichheaderwithbackgroundvideoslideritem', + name='btn_link', + field=models.CharField(blank=True, help_text='Url or #id to navigate on click. If this field is left empty, no button would be displayed.', max_length=100, null=True), + ), + ] diff --git a/ungleich_page/models.py b/ungleich_page/models.py index 4ffd1a33..6e25501f 100644 --- a/ungleich_page/models.py +++ b/ungleich_page/models.py @@ -125,9 +125,12 @@ class UngleichHeaderWithBackgroundVideoSliderItem(CMSPlugin): blank=True, null=True, help_text='An optional description for this slide.' ) - btn_link = models.URLField( - blank=True, null=True, - help_text='If this field is left empty, no button would be displayed.' + btn_link = models.CharField( + max_length=100, blank=True, null=True, + help_text=( + 'Url or #id to navigate on click. If this field is left empty, no ' + 'button would be displayed.' + ) ) btn_text = models.CharField( blank=True, null=True, max_length=50, diff --git a/ungleich_page/templates/ungleich_page/ungleich/_header_with_background_video_slider_item.html b/ungleich_page/templates/ungleich_page/ungleich/_header_with_background_video_slider_item.html index 78bb7ad8..f1edba16 100644 --- a/ungleich_page/templates/ungleich_page/ungleich/_header_with_background_video_slider_item.html +++ b/ungleich_page/templates/ungleich_page/ungleich/_header_with_background_video_slider_item.html @@ -22,6 +22,6 @@ {% endif %} {% if instance.btn_link %} {% trans "Learn More" as default_btn_text %} - {{ instance.btn_text|default:default_btn_text }} + {{ instance.btn_text|default:default_btn_text }} {% endif %} From e29865b31050d39ef6890ef63ca858572cf52e34 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Wed, 21 Mar 2018 00:27:35 +0530 Subject: [PATCH 108/973] fix banner list image size, lead text size --- .../datacenterlight/css/landing-page.css | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 6361ea21..ceb6612b 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -58,6 +58,10 @@ textarea { min-width: 180px; } +.lead { + font-size: 18px; +} + /* Top navbar */ @@ -429,17 +433,20 @@ textarea { } .split-section.left .split-description { -/* width: 90%; */ margin-right: auto; } .split-section .split-description .lead { color: #3a3a3a; - font-size: 21px; } -.split-section .space .split-description .lead { - font-size: 20px; +@media (min-width: 768px) { + .split-section .split-description .lead { + font-size: 21px; + } + .split-section .space .split-description .lead { + font-size: 20px; + } } .split-section.right .split-description { @@ -764,17 +771,11 @@ textarea { .ssdimg { margin: 0 15px; - /* vertical-align: middle; */ - /* display: inline-block; */ -} - -.ssdimg img { - max-width: 125px; } @media (max-width: 767px) { .ssdimg img { - width: 100px; + max-height: 120px; } } From 39d67c84a18b84836fa57049bbec42f2c3cf492f Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Wed, 21 Mar 2018 00:46:22 +0530 Subject: [PATCH 109/973] fix lead text size --- datacenterlight/static/datacenterlight/css/landing-page.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index ceb6612b..6985145a 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -62,6 +62,12 @@ textarea { font-size: 18px; } +@media (min-width: 768px) { + .lead { + font-size: 21px; + } +} + /* Top navbar */ From 759b96f25c29c38b56e0110a4e5913c23d525791 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Wed, 21 Mar 2018 00:55:20 +0530 Subject: [PATCH 110/973] banner list item text set max-width --- datacenterlight/static/datacenterlight/css/landing-page.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 6985145a..9c49de19 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -1197,7 +1197,7 @@ footer { max-width: 430px; } .flex-row-rev .desc-text { - max-width: 710px; + max-width: 510px; text-align: left; } .flex-row-rev .percent-text { From 076aaac604dd3e5989ee0f49681cc956aa123fb2 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Wed, 21 Mar 2018 00:57:03 +0530 Subject: [PATCH 111/973] banner list item text set max-width --- datacenterlight/static/datacenterlight/css/landing-page.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 9c49de19..3cc28c46 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -1197,7 +1197,7 @@ footer { max-width: 430px; } .flex-row-rev .desc-text { - max-width: 510px; + max-width: 600px; text-align: left; } .flex-row-rev .percent-text { From 849cdec0e21564f95059318c8a0a523fc7607eed Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Wed, 21 Mar 2018 01:29:28 +0530 Subject: [PATCH 112/973] unlocalize vm id --- hosting/templates/hosting/virtual_machines.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosting/templates/hosting/virtual_machines.html b/hosting/templates/hosting/virtual_machines.html index 467d9d39..ce1656ae 100644 --- a/hosting/templates/hosting/virtual_machines.html +++ b/hosting/templates/hosting/virtual_machines.html @@ -1,5 +1,5 @@ {% extends "hosting/base_short.html" %} -{% load staticfiles bootstrap3 i18n %} +{% load staticfiles bootstrap3 i18n l10n %} {% block content %}
    @@ -40,7 +40,7 @@ {% for vm in vms %} - {{vm.vm_id}} + {{vm.vm_id|unlocalize}} {% if vm.ipv4 %}{{vm.ipv4}}{% endif %} {% if vm.ipv6 %}{{vm.ipv6}}{% endif %} From db99a4005958a9f545f7a1d10c0e0464d6c2d1a9 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Wed, 21 Mar 2018 22:26:43 +0530 Subject: [PATCH 113/973] break long words to multiple lines --- datacenterlight/static/datacenterlight/css/landing-page.css | 1 + 1 file changed, 1 insertion(+) diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 6361ea21..5495fea2 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -536,6 +536,7 @@ textarea { padding-top: 20px; display: inline-block; color: #999 !important; + word-break: break-all; } .price-calc-section .card { From bbfb37dd8fc97ba9dd2674f066dd92ff311b2257 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 22 Mar 2018 00:52:06 +0530 Subject: [PATCH 114/973] new plugins section --- datacenterlight/cms_models.py | 35 +++++++++++++++++++ datacenterlight/cms_plugins.py | 31 ++++++++++++++-- .../static/datacenterlight/js/main.js | 12 ++++--- .../datacenterlight/cms/calculator.html | 17 ++------- .../cms/includes/_section_split_content.html | 21 +++++++++++ .../datacenterlight/cms/section.html | 34 ++++-------------- .../datacenterlight/cms/section_promo.html | 11 ++++++ datacenterlight/templatetags/custom_tags.py | 7 +++- 8 files changed, 118 insertions(+), 50 deletions(-) create mode 100644 datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html create mode 100644 datacenterlight/templates/datacenterlight/cms/section_promo.html diff --git a/datacenterlight/cms_models.py b/datacenterlight/cms_models.py index df54589e..214a2e90 100644 --- a/datacenterlight/cms_models.py +++ b/datacenterlight/cms_models.py @@ -200,3 +200,38 @@ class DCLSectionImagePluginModel(CMSPlugin): max_length=100, null=True, blank=True, help_text='Optional caption for the image.' ) + + +class DCLSectionPromoPluginModel(CMSPlugin): + background_image = FilerImageField( + on_delete=models.CASCADE, null=True, blank=True, + help_text=('Optional background image for the Promo Section'), + related_name="dcl_section_promo_promo", + ) + heading = models.CharField( + blank=True, null=True, max_length=100, + help_text='An optional heading for the Promo Section', + ) + subheading = models.CharField( + blank=True, null=True, max_length=200, + help_text='An optional subheading for the Promo Section', + ) + content = HTMLField() + html_id = models.SlugField( + blank=True, null=True, + help_text=( + 'An optional html id for the Section. Required to set as target ' + 'of a link on page' + ) + ) + plain_heading = models.BooleanField( + default=False, + help_text='Select to keep the heading style simpler.' + ) + center_on_mobile = models.BooleanField( + default=False, + help_text='Select to center align content on small screens.' + ) + + def __str__(self): + return '#' + self.html_id if self.html_id else str(self.pk) diff --git a/datacenterlight/cms_plugins.py b/datacenterlight/cms_plugins.py index 60992889..42e8719f 100644 --- a/datacenterlight/cms_plugins.py +++ b/datacenterlight/cms_plugins.py @@ -5,7 +5,8 @@ from .cms_models import ( DCLBannerItemPluginModel, DCLBannerListPluginModel, DCLContactPluginModel, DCLFooterPluginModel, DCLLinkPluginModel, DCLNavbarDropdownPluginModel, DCLSectionIconPluginModel, DCLSectionImagePluginModel, - DCLSectionPluginModel, DCLNavbarPluginModel + DCLSectionPluginModel, DCLNavbarPluginModel, + DCLSectionPromoPluginModel ) from .models import VMTemplate @@ -18,7 +19,24 @@ class DCLSectionPlugin(CMSPluginBase): render_template = "datacenterlight/cms/section.html" cache = False allow_children = True - child_classes = ['DCLSectionIconPlugin', 'DCLSectionImagePlugin'] + child_classes = [ + 'DCLSectionIconPlugin', 'DCLSectionImagePlugin', + 'DCLSectionPromoPlugin', 'UngleichHTMLPlugin' + ] + + def render(self, context, instance, placeholder): + context = super(DCLSectionPlugin, self).render( + context, instance, placeholder + ) + context['children_to_right'] = [] + context['children_to_left'] = [] + if instance.child_plugin_instances is not None: + for child in instance.child_plugin_instances: + if child.__class__.__name__ == 'DCLSectionImagePluginModel': + context['children_to_right'].append(child) + else: + context['children_to_left'].append(child) + return context @plugin_pool.register_plugin @@ -41,6 +59,15 @@ class DCLSectionImagePlugin(CMSPluginBase): require_parent = True +@plugin_pool.register_plugin +class DCLSectionPromoPlugin(CMSPluginBase): + module = "Datacenterlight" + name = "DCL Section Promo Plugin" + model = DCLSectionPromoPluginModel + render_template = "datacenterlight/cms/section_promo.html" + cache = False + + @plugin_pool.register_plugin class DCLCalculatorPlugin(CMSPluginBase): module = "Datacenterlight" diff --git a/datacenterlight/static/datacenterlight/js/main.js b/datacenterlight/static/datacenterlight/js/main.js index 10412824..5e919045 100644 --- a/datacenterlight/static/datacenterlight/js/main.js +++ b/datacenterlight/static/datacenterlight/js/main.js @@ -107,10 +107,14 @@ var href = $(this).attr('href'); $('.navbar-collapse').removeClass('in'); $('.navbar-collapse').addClass('collapsing'); - if ($(href).length) { - $('html, body').animate({ - scrollTop: $(href).offset().top - 50 - }, 1000); + if (href[0] === "#") { + if ($(href).length) { + $('html, body').animate({ + scrollTop: $(href).offset().top - 50 + }, 1000); + } + } else if (href) { + window.location = href; } }); } diff --git a/datacenterlight/templates/datacenterlight/cms/calculator.html b/datacenterlight/templates/datacenterlight/cms/calculator.html index 5ea97e84..27d1f89c 100644 --- a/datacenterlight/templates/datacenterlight/cms/calculator.html +++ b/datacenterlight/templates/datacenterlight/cms/calculator.html @@ -1,21 +1,8 @@
    -
    -
    - {% if instance.heading %} -
    -

    {{ instance.heading }}

    -
    - {% endif %} - {% if instance.content %} -
    -
    - {{ instance.content }} -
    -
    - {% endif %} -
    +
    + {% include "datacenterlight/cms/includes/_section_split_content.html" %}
    diff --git a/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html b/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html new file mode 100644 index 00000000..38db14d5 --- /dev/null +++ b/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html @@ -0,0 +1,21 @@ +{% load cms_tags %} + +{% if instance.heading %} +
    +

    {{ instance.heading }}

    +
    +{% endif %} +{% if instance.content %} +
    +
    + {{ instance.content }} +
    +
    +{% endif %} +{% if children_to_left|length %} +
    + {% for plugin in children_to_left %} + {% render_plugin plugin %} + {% endfor %} +
    +{% endif %} \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/cms/section.html b/datacenterlight/templates/datacenterlight/cms/section.html index bdef3196..7500ceb3 100644 --- a/datacenterlight/templates/datacenterlight/cms/section.html +++ b/datacenterlight/templates/datacenterlight/cms/section.html @@ -1,26 +1,15 @@ {% load cms_tags %} -
    +
    - {% if instance.child_plugin_instances|length %} + {% if children_to_right|length %}
    - {% if instance.heading %} -
    -

    {{ instance.heading }}

    -
    - {% endif %} - {% if instance.content %} -
    -
    - {{ instance.content }} -
    -
    - {% endif %} + {% include "datacenterlight/cms/includes/_section_split_content.html" %}
    - {% for plugin in instance.child_plugin_instances %} + {% for plugin in children_to_right %} {% render_plugin plugin %} {% endfor %}
    @@ -28,19 +17,8 @@
    {% else %}
    - {% if instance.heading %} -
    -

    {{ instance.heading }}

    -
    - {% endif %} - {% if instance.content %} -
    -
    - {{ instance.content }} -
    -
    - {% endif %} + {% include "datacenterlight/cms/includes/_section_split_content.html" %}
    {% endif %}
    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/cms/section_promo.html b/datacenterlight/templates/datacenterlight/cms/section_promo.html new file mode 100644 index 00000000..46a6b67c --- /dev/null +++ b/datacenterlight/templates/datacenterlight/cms/section_promo.html @@ -0,0 +1,11 @@ +
    + {% if instance.heading %} +

    {{instance.heading}}

    + {% endif %} + {% if instance.subheading %} +

    {{instance.subheading}}

    + {% endif %} + {% if instance.content %} +

    {{instance.content}}

    + {% endif %} +
    \ No newline at end of file diff --git a/datacenterlight/templatetags/custom_tags.py b/datacenterlight/templatetags/custom_tags.py index 908b1f89..2ff32bf1 100644 --- a/datacenterlight/templatetags/custom_tags.py +++ b/datacenterlight/templatetags/custom_tags.py @@ -41,4 +41,9 @@ def multiply(value, arg): :param arg: :return: """ - return value*arg + return value * arg + + +@register.filter('instance_class') +def instance_class(obj): + return obj.__class__.__name__ From 049cf5afa29c4d2bcc3cac1581ebd0abcfa473c2 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 22 Mar 2018 00:52:59 +0530 Subject: [PATCH 115/973] fix dcl navbar link navigation --- datacenterlight/static/datacenterlight/js/main.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/datacenterlight/static/datacenterlight/js/main.js b/datacenterlight/static/datacenterlight/js/main.js index 10412824..5e919045 100644 --- a/datacenterlight/static/datacenterlight/js/main.js +++ b/datacenterlight/static/datacenterlight/js/main.js @@ -107,10 +107,14 @@ var href = $(this).attr('href'); $('.navbar-collapse').removeClass('in'); $('.navbar-collapse').addClass('collapsing'); - if ($(href).length) { - $('html, body').animate({ - scrollTop: $(href).offset().top - 50 - }, 1000); + if (href[0] === "#") { + if ($(href).length) { + $('html, body').animate({ + scrollTop: $(href).offset().top - 50 + }, 1000); + } + } else if (href) { + window.location = href; } }); } From 389d16931b3f0c91f35f108d76daecbb259bc827 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 22 Mar 2018 01:04:41 +0530 Subject: [PATCH 116/973] Update Changelog --- Changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Changelog b/Changelog index 537af052..088f7ab1 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,6 @@ +1.5.5: 2018-03-22 + * #4278: [dcl cms] edit options for cms navbar and header plugins + * bgfix: [dcl cms] fix link plugin issues and section image alignment 1.5.4: 2018-03-17 * bgfix: [dcl cms] update DCLNavbarPlugin to allow change of brand logo and url 1.5.3: 2018-03-16 From f9bedf20e0cb863441edf01ca33a79147d7672ed Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 22 Mar 2018 01:18:21 +0530 Subject: [PATCH 117/973] Update navbar.html change default url to `/` from `datacenterlight:index` --- .../templates/datacenterlight/cms/navbar.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/cms/navbar.html b/datacenterlight/templates/datacenterlight/cms/navbar.html index cc8ec96b..bfa3e086 100644 --- a/datacenterlight/templates/datacenterlight/cms/navbar.html +++ b/datacenterlight/templates/datacenterlight/cms/navbar.html @@ -10,13 +10,12 @@ - {% url 'datacenterlight:index' as default_logo_url %} {% if instance.logo_dark or instance.logo_light %} - - + + {% else %} - - + + {% endif %}
  • - + diff --git a/hosting/views.py b/hosting/views.py index 5f4ed639..8e7380fb 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -494,6 +494,7 @@ class SSHKeyChoiceView(LoginRequiredMixin, View): return redirect(reverse_lazy('hosting:ssh_keys'), foo='bar') +@method_decorator(decorators, name='dispatch') class SSHKeyCreateView(LoginRequiredMixin, FormView): form_class = UserHostingKeyForm model = UserHostingKey @@ -545,11 +546,6 @@ class SSHKeyCreateView(LoginRequiredMixin, FormView): manager.manage_public_key([{'value': public_key, 'state': True}]) return HttpResponseRedirect(self.success_url) - @method_decorator(decorators) - def get(self, request, *args, **kwargs): - return render(request, self.template_name) - - @method_decorator(decorators) def post(self, request, *args, **kwargs): form = self.get_form() required = 'add_ssh' in self.request.POST @@ -561,6 +557,7 @@ class SSHKeyCreateView(LoginRequiredMixin, FormView): return self.form_invalid(form) +@method_decorator(decorators, name='dispatch') class SettingsView(LoginRequiredMixin, FormView): template_name = "hosting/settings.html" login_url = reverse_lazy('hosting:login') @@ -595,11 +592,6 @@ class SettingsView(LoginRequiredMixin, FormView): return context - @method_decorator(decorators) - def get(self, request, *args, **kwargs): - return render(request, self.template_name) - - @method_decorator(decorators) def post(self, request, *args, **kwargs): form = self.get_form() if form.is_valid(): @@ -1218,8 +1210,8 @@ class VirtualMachineView(LoginRequiredMixin, View): email_to_admin_data = { 'subject': "Deleted VM and Subscription for VM {vm_id} and " "user: {user}".format( - vm_id=vm.id, user=owner.email - ), + vm_id=vm.id, user=owner.email + ), 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, 'to': ['info@ungleich.ch'], 'body': "\n".join( From bc368491784502bb72fa0b3a784a2aa8a70692b2 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 27 Mar 2018 19:19:26 +0530 Subject: [PATCH 141/973] cms integration --- datacenterlight/admin.py | 10 +++++++ datacenterlight/cms_models.py | 11 ++++++++ .../static/datacenterlight/css/common.css | 2 +- .../datacenterlight/base_hosting.html | 10 ++++--- .../datacenterlight/landing_payment.html | 2 +- datacenterlight/views.py | 28 +++++++++++-------- 6 files changed, 45 insertions(+), 18 deletions(-) create mode 100644 datacenterlight/admin.py diff --git a/datacenterlight/admin.py b/datacenterlight/admin.py new file mode 100644 index 00000000..974006a6 --- /dev/null +++ b/datacenterlight/admin.py @@ -0,0 +1,10 @@ +from django.contrib import admin +from cms.admin.placeholderadmin import PlaceholderAdminMixin +from .cms_models import CMSIntegration + + +class CMSIntegrationAdmin(PlaceholderAdminMixin, admin.ModelAdmin): + pass + + +admin.site.register(CMSIntegration, CMSIntegrationAdmin) diff --git a/datacenterlight/cms_models.py b/datacenterlight/cms_models.py index 8c9ae740..fa01f18a 100644 --- a/datacenterlight/cms_models.py +++ b/datacenterlight/cms_models.py @@ -3,6 +3,17 @@ from django.db import models from django.utils.safestring import mark_safe from djangocms_text_ckeditor.fields import HTMLField from filer.fields.image import FilerImageField +from cms.models.fields import PlaceholderField + + +class CMSIntegration(models.Model): + name = models.CharField( + max_length=100, unique=True, default='default', + help_text='An optional heading for the Section', + ) + footer_placeholder = PlaceholderField('datacenterlight_footer') + navbar_placeholder = PlaceholderField('datacenterlight_navbar') + # Models for CMS Plugins diff --git a/datacenterlight/static/datacenterlight/css/common.css b/datacenterlight/static/datacenterlight/css/common.css index e24cf671..87569ae1 100644 --- a/datacenterlight/static/datacenterlight/css/common.css +++ b/datacenterlight/static/datacenterlight/css/common.css @@ -1,7 +1,7 @@ body, html { width: 100%; - min-height: 100%; + height: 100%; } body, diff --git a/datacenterlight/templates/datacenterlight/base_hosting.html b/datacenterlight/templates/datacenterlight/base_hosting.html index 7e4f7fac..20111878 100644 --- a/datacenterlight/templates/datacenterlight/base_hosting.html +++ b/datacenterlight/templates/datacenterlight/base_hosting.html @@ -1,4 +1,4 @@ -{% load staticfiles i18n %} +{% load staticfiles i18n cms_tags sekizai_tags %} {% get_current_language as LANGUAGE_CODE %} @@ -26,6 +26,9 @@ {% block css_extra %} {% endblock css_extra %} + {% render_block "css" postprocessor "compressor.contrib.sekizai.compress" %} + {% render_block "js" postprocessor "compressor.contrib.sekizai.compress" %} + @@ -43,10 +46,9 @@ + {% cms_toolbar %} - {% block navbar %} - {% include "hosting/includes/_navbar_user.html" %} - {% endblock navbar %} + {% render_placeholder cms_integration.navbar_placeholder %}
    {% block content %} diff --git a/datacenterlight/templates/datacenterlight/landing_payment.html b/datacenterlight/templates/datacenterlight/landing_payment.html index 8e779576..e64d8ca3 100644 --- a/datacenterlight/templates/datacenterlight/landing_payment.html +++ b/datacenterlight/templates/datacenterlight/landing_payment.html @@ -1,5 +1,5 @@ {% extends "datacenterlight/base_hosting.html" %} -{% load staticfiles bootstrap3 i18n %} +{% load staticfiles bootstrap3 i18n cms_tags %} {% block css_extra %} diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 5517abaf..e2241a17 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -18,14 +18,13 @@ from hosting.forms import HostingUserLoginForm from hosting.models import HostingOrder from membership.models import CustomUser, StripeCustomer from opennebula_api.serializers import VMTemplateSerializer -from utils.forms import ( - BillingAddressForm, BillingAddressFormSignup -) +from utils.forms import BillingAddressForm, BillingAddressFormSignup from utils.hosting_utils import get_vm_price from utils.stripe_utils import StripeUtils from utils.tasks import send_plain_email_task from .forms import ContactForm from .models import VMTemplate +from .cms_models import CMSIntegration logger = logging.getLogger(__name__) @@ -42,9 +41,10 @@ class ContactUsView(FormView): return self.render_to_response( self.get_context_data(contact_form=form)) else: - return render(self.request, - 'datacenterlight/index.html', - self.get_context_data(contact_form=form)) + return render( + self.request, 'datacenterlight/index.html', + self.get_context_data(contact_form=form) + ) def form_valid(self, form): form.save() @@ -68,10 +68,10 @@ class ContactUsView(FormView): return self.render_to_response( self.get_context_data(success=True, contact_form=form)) else: - return render(self.request, - 'datacenterlight/index.html', - self.get_context_data(success=True, - contact_form=form)) + return render( + self.request, 'datacenterlight/index.html', + self.get_context_data(success=True, contact_form=form) + ) class IndexView(CreateView): @@ -219,7 +219,8 @@ class PaymentOrderView(FormView): 'stripe_key': settings.STRIPE_API_PUBLIC_KEY, 'site_url': reverse('datacenterlight:index'), 'login_form': HostingUserLoginForm(prefix='login_form'), - 'billing_address_form': billing_address_form + 'billing_address_form': billing_address_form, + 'cms_integration': CMSIntegration.objects.get(name='default') }) return context @@ -354,7 +355,10 @@ class OrderConfirmationView(DetailView): 'cc_brand': card_details.get('response_object').get('brand'), 'vm': request.session.get('specs'), 'page_header_text': _('Confirm Order'), - 'billing_address_data': request.session.get('billing_address_data') + 'billing_address_data': ( + request.session.get('billing_address_data') + ), + 'cms_integration': CMSIntegration.objects.get(name='default') } return render(request, self.template_name, context) From d52c061709d24a8605b205d8c705f6742199b10b Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 27 Mar 2018 19:38:09 +0530 Subject: [PATCH 142/973] use humanize to add comma to numbers --- .../templates/datacenterlight/landing_payment.html | 4 ++-- .../templates/datacenterlight/order_detail.html | 8 ++++---- dynamicweb/settings/base.py | 3 +-- hosting/templates/hosting/order_detail.html | 9 ++++----- hosting/templates/hosting/orders.html | 5 ++--- hosting/templates/hosting/payment.html | 6 +++--- hosting/templates/hosting/virtual_machine_detail.html | 6 +++--- hosting/templates/hosting/virtual_machines.html | 4 ++-- 8 files changed, 21 insertions(+), 24 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/landing_payment.html b/datacenterlight/templates/datacenterlight/landing_payment.html index 8e779576..60da04bf 100644 --- a/datacenterlight/templates/datacenterlight/landing_payment.html +++ b/datacenterlight/templates/datacenterlight/landing_payment.html @@ -1,5 +1,5 @@ {% extends "datacenterlight/base_hosting.html" %} -{% load staticfiles bootstrap3 i18n %} +{% load staticfiles bootstrap3 i18n humanize %} {% block css_extra %} @@ -78,7 +78,7 @@

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


    -

    {%trans "Total" %}  ({%trans "including VAT" %}) {{request.session.specs.price}} CHF/{% trans "Month" %}

    +

    {%trans "Total" %}  ({%trans "including VAT" %}) {{request.session.specs.price|intcomma}} CHF/{% trans "Month" %}

    diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index 6b103970..78ed43c0 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -1,5 +1,5 @@ {% extends "datacenterlight/base_hosting.html" %} -{% load staticfiles bootstrap3 i18n custom_tags %} +{% load staticfiles bootstrap3 i18n custom_tags humanize %} {% block content %}
    @@ -59,15 +59,15 @@

    {% trans "Memory" %}: - {{vm.memory}} GB + {{vm.memory|intcomma}} GB

    {% trans "Disk space" %}: - {{vm.disk_size}} GB + {{vm.disk_size|intcomma}} GB

    {% trans "Total" %} - {{vm.price}} CHF + {{vm.price|intcomma}} CHF

    diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index ae6f8132..5db5a498 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -82,6 +82,7 @@ INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', + 'django.contrib.humanize', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', @@ -255,8 +256,6 @@ USE_L10N = True USE_TZ = True -USE_THOUSAND_SEPARATOR = True - FORMAT_MODULE_PATH = [ 'dynamicweb.formats' ] diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index f40ee34c..f5ee80b6 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -1,7 +1,6 @@ {% extends "hosting/base_short.html" %} -{% load staticfiles bootstrap3 %} -{% load i18n %} -{% load custom_tags %} +{% load staticfiles bootstrap3 humanize i18n custom_tags %} + {% block content %}
    @@ -130,7 +129,7 @@

    {% trans "Total" %} - {{vm.price}} CHF + {{vm.price|intcomma}} CHF

    @@ -143,7 +142,7 @@ {% csrf_token %}
    -
    {% blocktrans with vm_price=request.session.specs.price %}By clicking "Place order" this plan will charge your credit card account with the fee of {{ vm_price }}CHF/month{% endblocktrans %}.
    +
    {% blocktrans with vm_price=request.session.specs.price %}By clicking "Place order" this plan will charge your credit card account with the fee of {{ vm_price|intcomma }}CHF/month{% endblocktrans %}.
    diff --git a/hosting/templates/hosting/virtual_machines.html b/hosting/templates/hosting/virtual_machines.html index ce1656ae..467d9d39 100644 --- a/hosting/templates/hosting/virtual_machines.html +++ b/hosting/templates/hosting/virtual_machines.html @@ -1,5 +1,5 @@ {% extends "hosting/base_short.html" %} -{% load staticfiles bootstrap3 i18n l10n %} +{% load staticfiles bootstrap3 i18n %} {% block content %}
    @@ -40,7 +40,7 @@ {% for vm in vms %} - {{vm.vm_id|unlocalize}} + {{vm.vm_id}} {% if vm.ipv4 %}{{vm.ipv4}}{% endif %} {% if vm.ipv6 %}{{vm.ipv6}}{% endif %} From 8beebbf487edbc6abffa39da3d4f58e7623920b7 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 27 Mar 2018 20:57:46 +0530 Subject: [PATCH 143/973] Update Changelog --- Changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog b/Changelog index aa0d73bf..1c0be867 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +next + * bgfix: fix header slider interval issue 1.6: 2018-03-25 * #4266: [dcl cms] add promotional section plugin * #3842: [dcl, hosting] change number formatting for all the numbers from german to english locale From e7d7cf67b29ec84296a2823923aae41f8cbd0aef Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 27 Mar 2018 21:04:44 +0530 Subject: [PATCH 144/973] add footer and header placeholders --- datacenterlight/cms_models.py | 8 +++- .../migrations/0016_cmsintegration.py | 31 +++++++++++++++ .../static/datacenterlight/css/common.css | 37 +++++++++++++++++- .../static/datacenterlight/css/hosting.css | 20 +++++----- .../datacenterlight/css/landing-page.css | 38 +------------------ .../datacenterlight/base_hosting.html | 17 +++------ 6 files changed, 90 insertions(+), 61 deletions(-) create mode 100644 datacenterlight/migrations/0016_cmsintegration.py diff --git a/datacenterlight/cms_models.py b/datacenterlight/cms_models.py index fa01f18a..969deafa 100644 --- a/datacenterlight/cms_models.py +++ b/datacenterlight/cms_models.py @@ -9,11 +9,17 @@ from cms.models.fields import PlaceholderField class CMSIntegration(models.Model): name = models.CharField( max_length=100, unique=True, default='default', - help_text='An optional heading for the Section', + help_text=( + 'A unique name for the Integration. This name will be used to ' + 'fetch the Integration into pages' + ) ) footer_placeholder = PlaceholderField('datacenterlight_footer') navbar_placeholder = PlaceholderField('datacenterlight_navbar') + def __str__(self): + return self.name + # Models for CMS Plugins diff --git a/datacenterlight/migrations/0016_cmsintegration.py b/datacenterlight/migrations/0016_cmsintegration.py new file mode 100644 index 00000000..bdd1813a --- /dev/null +++ b/datacenterlight/migrations/0016_cmsintegration.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2018-03-27 15:31 +from __future__ import unicode_literals + +import cms.models.fields +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('datacenterlight', '0015_auto_20180323_0011'), + ('cms', '0014_auto_20160404_1908'), + ] + + operations = [ + migrations.CreateModel( + name='CMSIntegration', + fields=[ + ('id', models.AutoField(auto_created=True, + primary_key=True, serialize=False, verbose_name='ID')), + ('navbar_placeholder', cms.models.fields.PlaceholderField(editable=False, null=True, + on_delete=django.db.models.deletion.CASCADE, slotname='datacenterlight_navbar', to='cms.Placeholder')), + ('footer_placeholder', cms.models.fields.PlaceholderField(editable=False, null=True, + on_delete=django.db.models.deletion.CASCADE, slotname='datacenterlight_footer', to='cms.Placeholder')), + ('name', models.CharField(default='default', + help_text='A unique name for the Integration. This name will be used to fetch the Integration into pages', max_length=100, unique=True)), + ], + ), + ] diff --git a/datacenterlight/static/datacenterlight/css/common.css b/datacenterlight/static/datacenterlight/css/common.css index 87569ae1..214dbfd9 100644 --- a/datacenterlight/static/datacenterlight/css/common.css +++ b/datacenterlight/static/datacenterlight/css/common.css @@ -84,8 +84,24 @@ a.list-group-item-danger.active:focus { } } +.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; +} + p.copyright { - margin: 15px 0 0; + margin: 15px 0; } footer { @@ -95,4 +111,23 @@ footer { footer a { color: #777; +} + +footer .dcl-link-separator { + position: relative; + padding-left: 10px; +} + +footer .dcl-link-separator::before { + content: ""; + position: absolute; + display: inline-block; + top: 9px; + bottom: 0; + left: -2px; + right: 0; + width: 2px; + height: 2px; + border-radius: 100%; + background: #777; } \ No newline at end of file diff --git a/datacenterlight/static/datacenterlight/css/hosting.css b/datacenterlight/static/datacenterlight/css/hosting.css index 800fb533..8769ed60 100644 --- a/datacenterlight/static/datacenterlight/css/hosting.css +++ b/datacenterlight/static/datacenterlight/css/hosting.css @@ -15,8 +15,8 @@ } @media(min-width: 768px) { - .navbar-default .navbar-nav>li>a, - .navbar-right .highlights-dropdown .dropdown-menu>li>a { + .navbar-default .navbar-nav>li a, + .navbar-right .highlights-dropdown .dropdown-menu>li a { font-weight: 300; } .navbar-right .highlights-dropdown .dropdown-menu { @@ -26,7 +26,7 @@ } } -.navbar-right .highlights-dropdown .dropdown-menu>li>a { +.navbar-right .highlights-dropdown .dropdown-menu>li a { font-size: 13px; font-family: 'Lato', sans-serif; padding: 1px 10px 1px 18px !important; @@ -34,9 +34,9 @@ color: #333; } -.navbar-right .highlights-dropdown .dropdown-menu>li>a:hover, -.navbar-right .highlights-dropdown .dropdown-menu>li>a:focus, -.navbar-right .highlights-dropdown .dropdown-menu>li>a:active { +.navbar-right .highlights-dropdown .dropdown-menu>li a:hover, +.navbar-right .highlights-dropdown .dropdown-menu>li a:focus, +.navbar-right .highlights-dropdown .dropdown-menu>li a:active { background: transparent; text-decoration: underline !important; } @@ -144,9 +144,9 @@ } @media (max-width: 767px) { - .navbar-default .navbar-nav .open .dropdown-menu>.active>a, - .navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus, - .navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover { + .navbar-default .navbar-nav .open .dropdown-menu>.active a, + .navbar-default .navbar-nav .open .dropdown-menu>.active a:focus, + .navbar-default .navbar-nav .open .dropdown-menu>.active a:hover { background-color: transparent; } } @@ -163,7 +163,7 @@ } .content-dashboard { - min-height: calc(100vh - 60px); + min-height: calc(100vh - 86px); width: 100%; margin: 0 auto; max-width: 1120px; diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 3ac46295..38e84a59 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -99,15 +99,13 @@ textarea { } } +.navbar-transparent .navbar-nav>li a, .navbar-transparent .navbar-nav>.open>a, .navbar-transparent .navbar-nav>.open>a:focus, .navbar-transparent .navbar-nav>.open>a:hover { color: #fff; } -.navbar-transparent .navbar-nav>li a { - color: #fff; -} .navbar-transparent .navbar-nav>li a:focus, .navbar-transparent .navbar-nav>li a:active, @@ -123,22 +121,6 @@ textarea { background: transparent; } -.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 { transition: all 0.3s linear; box-shadow: none; @@ -1233,24 +1215,6 @@ footer { transform: rotate(45deg); } -footer .dcl-link-separator { - position: relative; - padding-left: 10px; -} - -footer .dcl-link-separator::before { - content: ""; - position: absolute; - display: inline-block; - top: 9px; - bottom: 0; - left: -2px; - right: 0; - width: 2px; - height: 2px; - border-radius: 100%; - background: #777; -} /* new styles for whydcl section cms plugin (to replace older style) */ diff --git a/datacenterlight/templates/datacenterlight/base_hosting.html b/datacenterlight/templates/datacenterlight/base_hosting.html index 20111878..e1ca1bb4 100644 --- a/datacenterlight/templates/datacenterlight/base_hosting.html +++ b/datacenterlight/templates/datacenterlight/base_hosting.html @@ -23,6 +23,9 @@ + {% if request.toolbar.edit_mode %} + + {% endif %} {% block css_extra %} {% endblock css_extra %} @@ -55,18 +58,8 @@ {% endblock %}
    - - {% if request.user.is_authenticated %} -
    -
    - -
    -
    - {% else %} - - {% endif %} + {% render_placeholder cms_integration.footer_placeholder %} + From 8f6bae6bd61034ba7faabb06ae6be16ab3a210d5 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 28 Mar 2018 08:53:49 +0200 Subject: [PATCH 145/973] Remove conflicting cms/ urlconf --- dynamicweb/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dynamicweb/urls.py b/dynamicweb/urls.py index 884c95b4..6d4f838a 100644 --- a/dynamicweb/urls.py +++ b/dynamicweb/urls.py @@ -56,7 +56,7 @@ urlpatterns += i18n_patterns( url( r'^blog/(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/(?P\w[-\w]*)/$', RedirectView.as_view(pattern_name='ungleich:post-detail')), - url(r'^blog/|cms/$', RedirectView.as_view( + url(r'^blog/$', RedirectView.as_view( url=reverse_lazy('ungleich:post-list')), name='blog_list_view'), url(r'^cms/', include('cms.urls')), ) From 2b27d56e54e490f27f15498bee18f30c655fc39c Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 29 Mar 2018 00:43:38 +0530 Subject: [PATCH 146/973] cmsintegrate management command --- datacenterlight/management/commands/cmsintegrate.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 datacenterlight/management/commands/cmsintegrate.py diff --git a/datacenterlight/management/commands/cmsintegrate.py b/datacenterlight/management/commands/cmsintegrate.py new file mode 100644 index 00000000..5b4f72d2 --- /dev/null +++ b/datacenterlight/management/commands/cmsintegrate.py @@ -0,0 +1,13 @@ +from django.core.management.base import BaseCommand +from datacenterlight.cms_models import CMSIntegration + + +class Command(BaseCommand): + help = '''Creates cms integration objects for datacenterlight''' + + def handle(self, *args, **options): + obj, created = CMSIntegration.objects.get_or_create(name='default') + if created: + print('created the default CMSIntegration object') + else: + print('default CMSIntegration object already exists') From 29a2ee098b7092d41c03cbec98e7a0643b524806 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 29 Mar 2018 00:58:08 +0530 Subject: [PATCH 147/973] fix related name for placeholder fields --- datacenterlight/cms_models.py | 8 ++++-- .../migrations/0017_auto_20180329_0056.py | 27 +++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 datacenterlight/migrations/0017_auto_20180329_0056.py diff --git a/datacenterlight/cms_models.py b/datacenterlight/cms_models.py index 969deafa..a1f285fa 100644 --- a/datacenterlight/cms_models.py +++ b/datacenterlight/cms_models.py @@ -14,8 +14,12 @@ class CMSIntegration(models.Model): 'fetch the Integration into pages' ) ) - footer_placeholder = PlaceholderField('datacenterlight_footer') - navbar_placeholder = PlaceholderField('datacenterlight_navbar') + footer_placeholder = PlaceholderField( + 'datacenterlight_footer', related_name='dcl-footer-placeholder+' + ) + navbar_placeholder = PlaceholderField( + 'datacenterlight_navbar', related_name='dcl-navbar-placeholder+' + ) def __str__(self): return self.name diff --git a/datacenterlight/migrations/0017_auto_20180329_0056.py b/datacenterlight/migrations/0017_auto_20180329_0056.py new file mode 100644 index 00000000..136e6dbd --- /dev/null +++ b/datacenterlight/migrations/0017_auto_20180329_0056.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2018-03-28 19:26 +from __future__ import unicode_literals + +import cms.models.fields +from django.db import migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('datacenterlight', '0016_cmsintegration'), + ] + + operations = [ + migrations.AlterField( + model_name='cmsintegration', + name='footer_placeholder', + field=cms.models.fields.PlaceholderField(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='dcl-footer-placeholder+', slotname='datacenterlight_footer', to='cms.Placeholder'), + ), + migrations.AlterField( + model_name='cmsintegration', + name='navbar_placeholder', + field=cms.models.fields.PlaceholderField(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='dcl-navbar-placeholder+', slotname='datacenterlight_navbar', to='cms.Placeholder'), + ), + ] From 1402c7fde115bc906f6a4d7743bba1cf40a10b99 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 29 Mar 2018 01:19:10 +0530 Subject: [PATCH 148/973] footer padding fix --- datacenterlight/static/datacenterlight/css/common.css | 8 ++++++-- datacenterlight/static/datacenterlight/css/hosting.css | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/datacenterlight/static/datacenterlight/css/common.css b/datacenterlight/static/datacenterlight/css/common.css index 214dbfd9..70902d2d 100644 --- a/datacenterlight/static/datacenterlight/css/common.css +++ b/datacenterlight/static/datacenterlight/css/common.css @@ -101,14 +101,18 @@ a.list-group-item-danger.active:focus { } p.copyright { - margin: 15px 0; + margin: 0; } footer { - padding: 20px 0; + padding: 25px 0; background-color: #f8f8f8; } +footer .list-inline { + margin-bottom: 15px; +} + footer a { color: #777; } diff --git a/datacenterlight/static/datacenterlight/css/hosting.css b/datacenterlight/static/datacenterlight/css/hosting.css index 8769ed60..7764f0c3 100644 --- a/datacenterlight/static/datacenterlight/css/hosting.css +++ b/datacenterlight/static/datacenterlight/css/hosting.css @@ -163,7 +163,7 @@ } .content-dashboard { - min-height: calc(100vh - 86px); + min-height: calc(100vh - 96px); width: 100%; margin: 0 auto; max-width: 1120px; From 141c6a7c0f24074682d959d765dfed650e6478e8 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 29 Mar 2018 01:24:18 +0530 Subject: [PATCH 149/973] Update common.css --- datacenterlight/static/datacenterlight/css/common.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datacenterlight/static/datacenterlight/css/common.css b/datacenterlight/static/datacenterlight/css/common.css index 70902d2d..cddb0f69 100644 --- a/datacenterlight/static/datacenterlight/css/common.css +++ b/datacenterlight/static/datacenterlight/css/common.css @@ -105,6 +105,7 @@ p.copyright { } footer { + font-weight: 300; padding: 25px 0; background-color: #f8f8f8; } @@ -134,4 +135,4 @@ footer .dcl-link-separator::before { height: 2px; border-radius: 100%; background: #777; -} \ No newline at end of file +} From e19844d9acc9550ae26d1c9807285146ec9ba30d Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 29 Mar 2018 01:42:22 +0530 Subject: [PATCH 150/973] Update Changelog --- Changelog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 1c0be867..7477259a 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,7 @@ -next +1.6.1: 2018-03-28 * bgfix: fix header slider interval issue + * #4315: [cms] navbar consistency from cms page to static page + * #4313: [hosting] footer style fix 1.6: 2018-03-25 * #4266: [dcl cms] add promotional section plugin * #3842: [dcl, hosting] change number formatting for all the numbers from german to english locale From b64fe2cb1cab2d79129a1be801f564352d290b0f Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 30 Mar 2018 23:02:44 +0200 Subject: [PATCH 151/973] Attempt to fix user activation html email template --- .../datacenterlight/emails/user_activation.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.html b/datacenterlight/templates/datacenterlight/emails/user_activation.html index 8f270a3f..c2b730b2 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.html +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.html @@ -33,18 +33,22 @@

    {{base_url}}{{activation_link}}

    -

    {% if account_details %} {% url 'hosting:reset_password' as reset_password_url %} +

    {% trans "Your account details are as follows" %}: - - {% trans "Username" %} : {% trans "Your email address" %} +

    +

    + {% trans "Username" %} : {% trans "Your email address" %}
    {% trans "Password" %} : {{account_details}} - +

    +

    {% trans "You can reset your password here" %}: +

    +

    {{base_url}}{{reset_password_url}} +

    {% endif %} -

    From 74e69ff3138e99182da72637425d1eca5139e80e Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 30 Mar 2018 23:45:01 +0200 Subject: [PATCH 152/973] Add some space between account details and activate email linkpacebetween account details and activate email link --- .../templates/datacenterlight/emails/user_activation.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.html b/datacenterlight/templates/datacenterlight/emails/user_activation.html index c2b730b2..c9f92982 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.html +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.html @@ -35,7 +35,7 @@

    {% if account_details %} {% url 'hosting:reset_password' as reset_password_url %} -

    +

    {% trans "Your account details are as follows" %}:

    From 07d15a8144af3530448b0c7b15f1225fd72b8bb6 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 30 Mar 2018 23:46:29 +0200 Subject: [PATCH 153/973] Include password reset link in the text --- .../templates/datacenterlight/emails/user_activation.html | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.html b/datacenterlight/templates/datacenterlight/emails/user_activation.html index c9f92982..16c980fd 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.html +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.html @@ -43,10 +43,7 @@ {% trans "Password" %} : {{account_details}}

    - {% trans "You can reset your password here" %}: -

    -

    - {{base_url}}{{reset_password_url}} + {% blocktrans %}You can reset your password here.{% endblocktrans %}

    {% endif %} From bf4f2f0f87fd4018b26abb6afd895f5ddac8baae Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 30 Mar 2018 23:47:27 +0200 Subject: [PATCH 154/973] Correct a translation and add new translation --- .../locale/de/LC_MESSAGES/django.po | 249 ++++++++++-------- 1 file changed, 134 insertions(+), 115 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index 1b9bd116..f311e1ed 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: 2018-01-15 23:12+0000\n" +"POT-Creation-Date: 2018-03-30 21:29+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,51 +22,17 @@ msgstr "" msgid "Your New VM %(vm_name)s at Data Center Light" msgstr "Deine neue VM %(vm_name)s bei Data Center Light" -msgid "Enter name" -msgstr "Name" +msgid "All Rights Reserved" +msgstr "Alle Rechte vorbehalten" -msgid "Enter email" -msgstr "E-Mail-Adresse" +msgid "Toggle navigation" +msgstr "Umschalten" -msgid "Request Beta Access" -msgstr "Beantrage Beta-Zugang" +msgid "Login" +msgstr "Anmelden" -msgid "Request Sent" -msgstr "Anfrage verschickt" - -msgid "" -"Thank you for your subscription! You will receive a confirmation mail from " -"our team" +msgid "Dashboard" msgstr "" -"Vielen dank für Ihre Anmeldung. Sie erhalten in kürze eine Bestätigungsmail " -"von unserem Team" - -msgid "VM hosting" -msgstr "" - -msgid "month" -msgstr "Monat" - -msgid "VAT included" -msgstr "MwSt. inklusive" - -msgid "Hosted in Switzerland" -msgstr "Standort: Schweiz" - -msgid "Please enter a value in range 1 - 48." -msgstr "Bitte gib einen Wert von 1 bis 48 ein." - -msgid "Please enter a value in range 1 - 200." -msgstr "Bitte gib einen Wert von 1 bis 200 ein." - -msgid "Please enter a value in range 10 - 2000." -msgstr "Bitte gib einen Wert von 10 bis 2000 ein." - -msgid "GB Storage (SSD)" -msgstr "GB Storage (SSD)" - -msgid "Continue" -msgstr "Weiter" msgid "Thank you for contacting us." msgstr "Nachricht gesendet." @@ -100,32 +66,6 @@ msgstr "" msgid "SUBMIT" msgstr "ABSENDEN" -msgid "Your Data Center Light Team" -msgstr "Dein Data Center Light Team" - -msgid "Thank you for your request." -msgstr "Vielen Dank für Deine Anfrage." - -msgid "You are one step away from being our beta tester!" -msgstr "" -"Sie sind nur noch einen Schritt davon entfernt, unser Beta-Tester zu werden!" - -msgid "" -"Currently we are running our tests to make sure everything runs perfectly." -msgstr "" -"Momentan testen wir die Beta-Umgebung um sie für Ihren Gebrauch " -"sicherzustellen." - -msgid "" -"In the meantime, we would like to ask you a little patience
    until our " -"team contacts you with beta access." -msgstr "" -"Wir werden dann sobald als möglich Ihren Beta-Zugang erstellen und Sie " -"daraufhin kontaktieren.Bis dahin bitten wir Sie um etwas Geduld." - -msgid "Thank you!" -msgstr "Vielen Dank!" - msgid "Data Center Light Account Activation" msgstr "Data Center Light Account Aktivierung" @@ -136,7 +76,7 @@ msgid "" "#4382c8; font-weight: 400;\">here." msgstr "" "Klicke here um deinen Data Center " +"none; color: #4382c8; font-weight: 400;\">hier um deinen Data Center " "Light Account zu aktivieren." msgid "" @@ -156,14 +96,25 @@ msgstr "Deine E-Mail-Adresse" msgid "Password" msgstr "Passwort" -msgid "You can reset your password here" -msgstr "Du kannst dein Passwort hier zurück setzen" +msgid "" +"You can reset your password here." +msgstr "" +"Du kannst dein Passwort hier " +"zurück setzen." + +msgid "Your Data Center Light Team" +msgstr "Dein Data Center Light Team" msgid "" "You can copy and paste the following link into the address bar of your " "browser to activate your Data Center Light account." msgstr "Kopiere den folgenden Link in die Adressleiste deines Browsers." +msgid "You can reset your password here" +msgstr "Du kannst dein Passwort hier zurück setzen" + msgid "Welcome to Data Center Light!" msgstr "Willkommen beim Data Center Light!" @@ -178,6 +129,33 @@ msgstr "Unser Angebot beginnt bei 15 CHF pro Monat. Probier's jetzt aus!" msgid "ORDER VM" msgstr "VM BESTELLEN" +msgid "VM hosting" +msgstr "" + +msgid "month" +msgstr "Monat" + +msgid "VAT included" +msgstr "MwSt. inklusive" + +msgid "Hosted in Switzerland" +msgstr "Standort: Schweiz" + +msgid "Please enter a value in range 1 - 48." +msgstr "Bitte gib einen Wert von 1 bis 48 ein." + +msgid "Please enter a value in range 1 - 200." +msgstr "Bitte gib einen Wert von 1 bis 200 ein." + +msgid "Please enter a value in range 10 - 2000." +msgstr "Bitte gib einen Wert von 10 bis 2000 ein." + +msgid "GB Storage (SSD)" +msgstr "GB Storage (SSD)" + +msgid "Continue" +msgstr "Weiter" + msgid "Home" msgstr "Home" @@ -202,21 +180,6 @@ msgstr "Kontakt" msgid "Terms of Service" msgstr "Nutzungsbedingungen" -msgid "All Rights Reserved" -msgstr "Alle Rechte vorbehalten" - -msgid "Toggle navigation" -msgstr "Umschalten" - -msgid "Why Data Center Light?" -msgstr "Warum Data Center Light?" - -msgid "Login" -msgstr "Anmelden" - -msgid "Dashboard" -msgstr "" - msgid "Finally, an affordable VM hosting in Switzerland!" msgstr "Endlich: bezahlbares VM Hosting in der Schweiz" @@ -396,6 +359,28 @@ msgstr "Weiter" msgid "Enter your credit card number" msgstr "Deine Kreditkartennummer" +#, python-format +msgid "%(page_header_text)s" +msgstr "" + +msgid "Date" +msgstr "Datum" + +msgid "Billed to" +msgstr "Rechnungsadresse" + +msgid "Payment method" +msgstr "Bezahlmethode" + +msgid "ending in" +msgstr "endend in" + +msgid "Order summary" +msgstr "Bestellungsübersicht" + +msgid "Product" +msgstr "" + #, python-format msgid "" "By clicking \"Place order\" this plan will charge your credit card account " @@ -407,14 +392,24 @@ msgstr "" msgid "Place order" msgstr "Bestellen" -msgid "Thank you for order! Our team will contact you via email" -msgstr "" -"Vielen Dank für die Bestellung. Unser Team setzt sich sobald wie möglich mit " -"Dir via E-Mail in Verbindung." +msgid "Processing..." +msgstr "Abarbeitung..." -msgid "as soon as possible!" +msgid "Hold tight, we are processing your request" +msgstr "Bitte warten - wir verbeiten Deine Anfrage gerade" + +msgid "OK" msgstr "" +msgid "Close" +msgstr "" + +msgid "Some problem encountered. Please try again later." +msgstr "Ein Problem ist aufgetreten. Bitte versuche es später noch einmal." + +msgid "Why Data Center Light?" +msgstr "Warum Data Center Light?" + msgid "Tech Stack" msgstr "Tech Stack" @@ -523,36 +518,60 @@ msgstr "" "Deine VM ist gleich bereit. Wir senden Dir eine Bestätigungsemail, sobald Du " "auf sie zugreifen kannst." +#~ msgid "Enter name" +#~ msgstr "Name" + +#~ msgid "Enter email" +#~ msgstr "E-Mail-Adresse" + +#~ msgid "Request Beta Access" +#~ msgstr "Beantrage Beta-Zugang" + +#~ msgid "Request Sent" +#~ msgstr "Anfrage verschickt" + +#~ msgid "" +#~ "Thank you for your subscription! You will receive a confirmation mail " +#~ "from our team" +#~ msgstr "" +#~ "Vielen dank für Ihre Anmeldung. Sie erhalten in kürze eine " +#~ "Bestätigungsmail von unserem Team" + +#~ msgid "Thank you for your request." +#~ msgstr "Vielen Dank für Deine Anfrage." + +#~ msgid "You are one step away from being our beta tester!" +#~ msgstr "" +#~ "Sie sind nur noch einen Schritt davon entfernt, unser Beta-Tester zu " +#~ "werden!" + +#~ msgid "" +#~ "Currently we are running our tests to make sure everything runs perfectly." +#~ msgstr "" +#~ "Momentan testen wir die Beta-Umgebung um sie für Ihren Gebrauch " +#~ "sicherzustellen." + +#~ msgid "" +#~ "In the meantime, we would like to ask you a little patience
    until " +#~ "our team contacts you with beta access." +#~ msgstr "" +#~ "Wir werden dann sobald als möglich Ihren Beta-Zugang erstellen und Sie " +#~ "daraufhin kontaktieren.Bis dahin bitten wir Sie um etwas Geduld." + +#~ msgid "Thank you!" +#~ msgstr "Vielen Dank!" + +#~ msgid "Thank you for order! Our team will contact you via email" +#~ msgstr "" +#~ "Vielen Dank für die Bestellung. Unser Team setzt sich sobald wie möglich " +#~ "mit Dir via E-Mail in Verbindung." + #~ msgid "Affordable VM hosting based in Switzerland" #~ msgstr "Bezahlbares VM Hosting in der Schweiz" -#~ msgid "Processing..." -#~ msgstr "Abarbeitung..." - -#~ msgid "Hold tight, we are processing your request" -#~ msgstr "Bitte warten - wir verbeiten Deine Anfrage gerade" - -#~ msgid "Some problem encountered. Please try again later." -#~ msgstr "Ein Problem ist aufgetreten. Bitte versuche es später noch einmal." - #~ msgid "Submit" #~ msgstr "Absenden" -#~ msgid "Date" -#~ msgstr "Datum" - -#~ msgid "Billed To:" -#~ msgstr "Rechnungsadresse" - -#~ msgid "Payment Method:" -#~ msgstr "Bezahlmethode" - -#~ msgid "ending in" -#~ msgstr "endend in" - -#~ msgid "Order summary" -#~ msgstr "Bestellungsübersicht" - #~ msgid "We are cutting down the costs significantly!" #~ msgstr "Wir sorgen dafür, dass die Kosten für Dich signifikant abnehmen" From aa9becdfe76bfc9c60cdb250eb835006f1d27167 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 31 Mar 2018 00:09:49 +0200 Subject: [PATCH 155/973] Reduce space between content and your dcl team --- .../templates/datacenterlight/emails/user_activation.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.html b/datacenterlight/templates/datacenterlight/emails/user_activation.html index 16c980fd..6e70100f 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.html +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.html @@ -42,7 +42,7 @@ {% trans "Username" %} : {% trans "Your email address" %}
    {% trans "Password" %} : {{account_details}}

    -

    +

    {% blocktrans %}You can reset your password here.{% endblocktrans %}

    {% endif %} From fb29bd0128e3096b630618582be98dbcec11a888 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 31 Mar 2018 01:28:56 +0200 Subject: [PATCH 156/973] [DCL] Add DE translations by Sanghee --- .../locale/de/LC_MESSAGES/django.po | 133 +++++++++--------- 1 file changed, 65 insertions(+), 68 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index f311e1ed..5942573b 100644 --- a/datacenterlight/locale/de/LC_MESSAGES/django.po +++ b/datacenterlight/locale/de/LC_MESSAGES/django.po @@ -9,14 +9,15 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-03-30 21:29+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2018-03-30 23:22+0000\n" +"Last-Translator: b'Anonymous User '\n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Translated-Using: django-rosetta 0.8.1\n" #, python-format msgid "Your New VM %(vm_name)s at Data Center Light" @@ -71,9 +72,9 @@ msgstr "Data Center Light Account Aktivierung" #, python-format msgid "" -"You can activate your Data Center Light account by clicking here." +"You can activate your Data Center Light account by clicking here." msgstr "" "Klicke hier um deinen Data Center " @@ -102,7 +103,7 @@ msgid "" msgstr "" "Du kannst dein Passwort hier " -"zurück setzen." +"zurücksetzen." msgid "Your Data Center Light Team" msgstr "Dein Data Center Light Team" @@ -113,7 +114,7 @@ msgid "" msgstr "Kopiere den folgenden Link in die Adressleiste deines Browsers." msgid "You can reset your password here" -msgstr "Du kannst dein Passwort hier zurück setzen" +msgstr "Du kannst dein Passwort hier zurücksetzen" msgid "Welcome to Data Center Light!" msgstr "Willkommen beim Data Center Light!" @@ -202,8 +203,8 @@ msgid "" "order to make it more sustainable and affordable at the same time." msgstr "" "Ist kreativ, indem es sich ein modernes und alternatives Layout zu Nutze " -"macht um Nachhaltigkeit zu fördern und somit erschwingliche Preise bieten zu " -"können.
" +"macht um Nachhaltigkeit zu fördern und somit erschwingliche Preise bieten zu" +" können.
" msgid "" "Cuts down the costs for you by using FOSS (Free Open Source Software) " @@ -231,7 +232,8 @@ msgstr "" "Energieversorgung, sowie schneller Internetverbindung ausgestattet. Unser " "Angebot ist aufgrund unserer leichten Infrastruktur überaus kostengünstig." -msgid "Simple and affordable: Try our virtual machine with featherlight price." +msgid "" +"Simple and affordable: Try our virtual machine with featherlight price." msgstr "" "Einfach und bezahlbar: Teste nun unsere virtuellen Maschinen mit " "federleichten Preisen." @@ -319,20 +321,20 @@ msgid "Credit Card" msgstr "Kreditkarte" msgid "" -"Please fill in your credit card information below. We are using Stripe for payment and do not " -"store your information in our database." +"Please fill in your credit card information below. We are using Stripe for payment and do " +"not store your information in our database." msgstr "" -"Bitte fülle Deine Kreditkarteninformationen unten aus. Wir nutzen Stripe für die Bezahlung und " -"speichern keine Informationen in unserer Datenbank." +"Bitte fülle Deine Kreditkarteninformationen unten aus. Wir nutzen Stripe für die Bezahlung " +"und speichern keine Informationen in unserer Datenbank." msgid "" "You are not making any payment yet. After submitting your card information, " "you will be taken to the Confirm Order Page." msgstr "" -"Es wird noch keine Bezahlung vorgenommen. Die Bezahlung wird erst ausgelöst, " -"nachdem Du die Bestellung auf der nächsten Seite bestätigt hast." +"Es wird noch keine Bezahlung vorgenommen. Die Bezahlung wird erst ausgelöst," +" nachdem Du die Bestellung auf der nächsten Seite bestätigt hast." msgid "Card Number" msgstr "Kreditkartennummer" @@ -350,8 +352,8 @@ msgid "" "You are not making any payment yet. After placing your order, you will be " "taken to the Submit Payment Page." msgstr "" -"Es wird noch keine Bezahlung vorgenommen. Die Bezahlung wird erst ausgelöst, " -"nachdem Du die Bestellung auf der nächsten Seite bestätigt hast." +"Es wird noch keine Bezahlung vorgenommen. Die Bezahlung wird erst ausgelöst," +" nachdem Du die Bestellung auf der nächsten Seite bestätigt hast." msgid "Processing" msgstr "Weiter" @@ -379,7 +381,7 @@ msgid "Order summary" msgstr "Bestellungsübersicht" msgid "Product" -msgstr "" +msgstr "Produkt" #, python-format msgid "" @@ -396,7 +398,7 @@ msgid "Processing..." msgstr "Abarbeitung..." msgid "Hold tight, we are processing your request" -msgstr "Bitte warten - wir verbeiten Deine Anfrage gerade" +msgstr "Bitte warten - wir verarbeiten Deine Anfrage gerade" msgid "OK" msgstr "" @@ -453,25 +455,25 @@ msgstr "Wir unterstützen die FOSS Community." msgid "" "Data Center Light is the child of free and open source software (FOSS) " "movement.
    We grew up with it, live by it, and believe in it.
    The " -"more we work on our data center,
    the more we contribute back to the FOSS " -"community." +"more we work on our data center,
    the more we contribute back to the FOSS" +" community." msgstr "" "Data Center Light ist ein Teil der Free und Opens Source Software (FOSS) " -"Bewegung.
    Wir sind damit gross geworden, leben damit und glauben daran." -"
    Je weiter wir mit unserem Data Center Light vorankommen, desto mehr " -"können wir etwas an die FOSS Community zurückgeben." +"Bewegung.
    Wir sind damit gross geworden, leben damit und glauben " +"daran.
    Je weiter wir mit unserem Data Center Light vorankommen, desto " +"mehr können wir etwas an die FOSS Community zurückgeben." msgid "We bring the future to you." msgstr "Wir bringen die Zukunft zu dir." msgid "" "Data Center Light uses the most modern technologies out there.
    Your VM " -"needs only IPv6. Data Center Light provides
    transparent two-way IPv6/" -"IPv4 translation." +"needs only IPv6. Data Center Light provides
    transparent two-way " +"IPv6/IPv4 translation." msgstr "" "Data Center Light verwendet die zur Zeit modernsten Technologien.
    Deine " -"VM läuft mit IPv6. Data Center Light bietet eine transparente IPv6/IPv4-" -"Zweiweglösung." +"VM läuft mit IPv6. Data Center Light bietet eine transparente " +"IPv6/IPv4-Zweiweglösung." msgid "" " No more spinning metal plates! Data Center Light uses only SSDs. We keep " @@ -505,8 +507,8 @@ msgid "" "There was a payment related error. On close of this popup, you will be " "redirected back to the payment page." msgstr "" -"Es ist ein Fehler bei der Zahlung betreten. Du wirst nach dem Schliessen vom " -"Popup zur Bezahlseite weitergeleitet." +"Es ist ein Fehler bei der Zahlung betreten. Du wirst nach dem Schliessen vom" +" Popup zur Bezahlseite weitergeleitet." msgid "Thank you for the order." msgstr "Danke für Deine Bestellung." @@ -515,8 +517,8 @@ msgid "" "Your VM will be up and running in a few moments. We will send you a " "confirmation email as soon as it is ready." msgstr "" -"Deine VM ist gleich bereit. Wir senden Dir eine Bestätigungsemail, sobald Du " -"auf sie zugreifen kannst." +"Deine VM ist gleich bereit. Wir senden Dir eine Bestätigungsemail, sobald Du" +" auf sie zugreifen kannst." #~ msgid "Enter name" #~ msgstr "Name" @@ -531,19 +533,18 @@ msgstr "" #~ msgstr "Anfrage verschickt" #~ msgid "" -#~ "Thank you for your subscription! You will receive a confirmation mail " -#~ "from our team" +#~ "Thank you for your subscription! You will receive a confirmation mail from " +#~ "our team" #~ msgstr "" -#~ "Vielen dank für Ihre Anmeldung. Sie erhalten in kürze eine " -#~ "Bestätigungsmail von unserem Team" +#~ "Vielen dank für Ihre Anmeldung. Sie erhalten in kürze eine Bestätigungsmail " +#~ "von unserem Team" #~ msgid "Thank you for your request." #~ msgstr "Vielen Dank für Deine Anfrage." #~ msgid "You are one step away from being our beta tester!" #~ msgstr "" -#~ "Sie sind nur noch einen Schritt davon entfernt, unser Beta-Tester zu " -#~ "werden!" +#~ "Sie sind nur noch einen Schritt davon entfernt, unser Beta-Tester zu werden!" #~ msgid "" #~ "Currently we are running our tests to make sure everything runs perfectly." @@ -552,8 +553,8 @@ msgstr "" #~ "sicherzustellen." #~ msgid "" -#~ "In the meantime, we would like to ask you a little patience
    until " -#~ "our team contacts you with beta access." +#~ "In the meantime, we would like to ask you a little patience
    until our " +#~ "team contacts you with beta access." #~ msgstr "" #~ "Wir werden dann sobald als möglich Ihren Beta-Zugang erstellen und Sie " #~ "daraufhin kontaktieren.Bis dahin bitten wir Sie um etwas Geduld." @@ -563,8 +564,8 @@ msgstr "" #~ msgid "Thank you for order! Our team will contact you via email" #~ msgstr "" -#~ "Vielen Dank für die Bestellung. Unser Team setzt sich sobald wie möglich " -#~ "mit Dir via E-Mail in Verbindung." +#~ "Vielen Dank für die Bestellung. Unser Team setzt sich sobald wie möglich mit" +#~ " Dir via E-Mail in Verbindung." #~ msgid "Affordable VM hosting based in Switzerland" #~ msgstr "Bezahlbares VM Hosting in der Schweiz" @@ -580,18 +581,18 @@ msgstr "" #~ msgid "" #~ "Our VMs are hosted in Glarus, Switzerland, and our website is currently " -#~ "running in BETA mode. If you want more information that you did not find " -#~ "on our website, or if your order is more detailed, or if you encounter " -#~ "any technical hiccups, please contact us at support@datacenterlight.ch, " -#~ "our team will get in touch with you asap." +#~ "running in BETA mode. If you want more information that you did not find on " +#~ "our website, or if your order is more detailed, or if you encounter any " +#~ "technical hiccups, please contact us at support@datacenterlight.ch, our team" +#~ " will get in touch with you asap." #~ msgstr "" -#~ "Unsere VMs werden in der Schweiz im Kanton Glarus gehostet und befinden " -#~ "sich zur Zeit noch in der BETA-Phase. Möchtest du mehr über uns erfahren " -#~ "und hast auf unserer Website nicht genügend Informationen gefunden? " -#~ "Möchtest eine detailliertere Bestellung aufgeben? Bist du auf technische " -#~ "Probleme gestossen, die du uns mitteilen möchtest? Dann zögere nicht und " -#~ "kontaktiere uns unter support@datacenterlight.ch. Unser Team wird sich " -#~ "umgehend um dein Anliegen kümmern!" +#~ "Unsere VMs werden in der Schweiz im Kanton Glarus gehostet und befinden sich" +#~ " zur Zeit noch in der BETA-Phase. Möchtest du mehr über uns erfahren und " +#~ "hast auf unserer Website nicht genügend Informationen gefunden? Möchtest " +#~ "eine detailliertere Bestellung aufgeben? Bist du auf technische Probleme " +#~ "gestossen, die du uns mitteilen möchtest? Dann zögere nicht und kontaktiere " +#~ "uns unter support@datacenterlight.ch. Unser Team wird sich umgehend um dein " +#~ "Anliegen kümmern!" #~ msgid "is not a proper name" #~ msgstr "ist kein gültiger Name" @@ -609,14 +610,12 @@ msgstr "" #~ "\n" #~ "Hi,\n" #~ "\n" -#~ "You can activate your %(dcl_text)s account by clicking here %(base_url)s" -#~ "%(activation_link)s\n" +#~ "You can activate your %(dcl_text)s account by clicking here %(base_url)s%(activation_link)s\n" #~ 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" #~ msgid "Your" #~ msgstr "Dein" @@ -651,14 +650,12 @@ msgstr "" #~ msgid "I want to have it!" #~ msgstr "Das möchte ich haben!" -#~ msgid "" -#~ "Reuse existing factory halls intead of building an expensive building." +#~ msgid "Reuse existing factory halls intead of building an expensive building." #~ msgstr "" #~ "Nachhaltigkeit: Wiederverwendung ehemaliger Fabrikhallen an Stelle der " #~ "Errichtung eines neuen Gebäudes" -#~ msgid "" -#~ "Being creative, using modern and alternative design for a datacenter." +#~ msgid "Being creative, using modern and alternative design for a datacenter." #~ msgstr "" #~ "Kreativität: Verwendung eines modernen und alternativen Designs für unser " #~ "Datencenter" @@ -681,8 +678,8 @@ msgstr "" #~ msgstr "Standort des Datacenters ist in der Schweiz" #~ msgid "" -#~ " WARNING: We are currently running in BETA mode. We hope you won't " -#~ "encounter any hiccups, but if you do, please let us know at " +#~ " WARNING: We are currently running in BETA mode. We hope you won't encounter" +#~ " any hiccups, but if you do, please let us know at " #~ "support@datacenterlight.ch" #~ msgstr "" #~ " Achtung: Wir befinden uns zurzeit im Beta-Release. Wir hoffen, dass Sie " @@ -696,8 +693,8 @@ msgstr "" #~ msgstr "Unser Versprechen" #~ msgid "" -#~ "Instead of creating an expensive SLA for availability, we promise that we " -#~ "do our best to run things as smooth as possible." +#~ "Instead of creating an expensive SLA for availability, we promise that we do" +#~ " our best to run things as smooth as possible." #~ msgstr "" #~ "Anstatt eines SLAs (Service Levle Agreements) zu vereinbaren,setzen wir " #~ "unsere persönliche Arbeitskraft ein, um Ihnen ein sorgenfreiesHosting zu " From bf48dc33de9f988866d569eb142e44675a8edaa0 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 31 Mar 2018 01:46:40 +0200 Subject: [PATCH 157/973] Update Changelog --- Changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog b/Changelog index 7477259a..b2492674 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +Next: + * bugfix: [dcl] Fix user activation email style; add/correct some DE text 1.6.1: 2018-03-28 * bgfix: fix header slider interval issue * #4315: [cms] navbar consistency from cms page to static page From 41d073da3b43d9d93a0101f1f86811befb96f32e Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 28 Mar 2018 08:53:49 +0200 Subject: [PATCH 158/973] Remove conflicting cms/ urlconf --- dynamicweb/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dynamicweb/urls.py b/dynamicweb/urls.py index 884c95b4..6d4f838a 100644 --- a/dynamicweb/urls.py +++ b/dynamicweb/urls.py @@ -56,7 +56,7 @@ urlpatterns += i18n_patterns( url( r'^blog/(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/(?P\w[-\w]*)/$', RedirectView.as_view(pattern_name='ungleich:post-detail')), - url(r'^blog/|cms/$', RedirectView.as_view( + url(r'^blog/$', RedirectView.as_view( url=reverse_lazy('ungleich:post-list')), name='blog_list_view'), url(r'^cms/', include('cms.urls')), ) From 1e6fb26051e7b5e33173852c2247c0210822425f Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sun, 1 Apr 2018 18:45:36 +0530 Subject: [PATCH 159/973] hosting login footer fix --- .../datacenterlight/includes/_footer.html | 29 ++----------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/includes/_footer.html b/datacenterlight/templates/datacenterlight/includes/_footer.html index 8643deda..7d27eaef 100644 --- a/datacenterlight/templates/datacenterlight/includes/_footer.html +++ b/datacenterlight/templates/datacenterlight/includes/_footer.html @@ -3,37 +3,14 @@