From 63ea7dac370e7cb64d593cf705405ca026741162 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 26 Sep 2017 01:04:38 +0530 Subject: [PATCH 01/14] datacenterlight invoice redesigned --- .../locale/de/LC_MESSAGES/django.po | 59 +++++----- .../datacenterlight/css/landing-page.css | 2 + .../templates/datacenterlight/index.html | 2 +- .../datacenterlight/order_detail.html | 105 +----------------- datacenterlight/views.py | 11 +- hosting/templates/hosting/order_detail.html | 20 ++-- 6 files changed, 52 insertions(+), 147 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index 3c7869a1..c3a7b934 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-09-16 14:09+0000\n" +"POT-Creation-Date: 2017-09-26 01:02+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -336,35 +336,6 @@ msgstr "Weiter" msgid "Enter your credit card number" msgstr "Deine Kreditkartennummer" -msgid "Confirm Order" -msgstr "Bestellung Bestätigen" - -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" - -#, python-format -msgid "" -"By clicking \"Place order\" this plan will charge your credit card account " -"with the fee of %(vm_price)sCHF/month" -msgstr "" -"Wenn Du \"bestellen\" auswählst, wird Deine Kreditkarte mit %(vm_price)sCHF " -"pro Monat belastet" - -msgid "Place order" -msgstr "Bestellen" - msgid "We are cutting down the costs significantly!" msgstr "Wir sorgen dafür, dass die Kosten für Dich signifikant abnehmen" @@ -485,6 +456,34 @@ msgstr "ist kein gültiger Name" msgid "is not a proper email" msgstr "ist keine gültige E-Mailadresse" +#~ msgid "Confirm Order" +#~ msgstr "Bestellung Bestätigen" + +#~ 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 "" +#~ "By clicking \"Place order\" this plan will charge your credit card " +#~ "account with the fee of %(vm_price)sCHF/month" +#~ msgstr "" +#~ "Wenn Du \"bestellen\" auswählst, wird Deine Kreditkarte mit " +#~ "%(vm_price)sCHF pro Monat belastet" + +#~ msgid "Place order" +#~ msgstr "Bestellen" + #~ msgid "" #~ "\n" #~ "Hi,\n" diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 6537dd0d..7c2fb564 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -1501,6 +1501,8 @@ tech-sub-sec h2 { font-size: 14px; font-weight: 300; letter-spacing: 2px; + line-height: 24px; + display: block; } .content-section-a { diff --git a/datacenterlight/templates/datacenterlight/index.html b/datacenterlight/templates/datacenterlight/index.html index cde420dd..85e66571 100755 --- a/datacenterlight/templates/datacenterlight/index.html +++ b/datacenterlight/templates/datacenterlight/index.html @@ -16,7 +16,7 @@
  • - {% trans "Highlights" %} + {% trans "Highlights" %}
  • {% trans "I want it!" %} diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index 085b0c37..435c9534 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -1,106 +1,5 @@ -{% extends "hosting/base_short.html" %} -{% load staticfiles bootstrap3 %} -{% load i18n %} -{% load custom_tags %} +{% extends "hosting/order_detail.html" %} {% block navbar %} {% include "datacenterlight/includes/_navbar.html" %} -{% endblock navbar %} - -{% block content %} - -
    - {% if messages %} -
    -
    -
    -
    - {% for message in messages %} - {{ message }} - {% endfor %} -
    -
    -
    - {% endif %} - {% if not error %} -
    -
    -
    -

    {% trans "Confirm Order"%}

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

    -
    -
    -
    -
    -

    {% trans "Billed To:"%}

    - {% with request.session.billing_address_data as billing_address %} - {{billing_address|get_value_from_dict:'cardholder_name'}}
    {{billing_address|get_value_from_dict:'street_address'}}, {{billing_address|get_value_from_dict:'postal_code'}}
    - {{billing_address|get_value_from_dict:'city'}}, {{billing_address|get_value_from_dict:'country'}}. - {% endwith %} -
    -
    -
    -
    -
    -
    - {% trans "Payment Method:"%}
    - {{cc_brand}} {% trans "ending in" %} **** {{cc_last4}}
    - {{request.session.user.email}} -
    -
    -
    -
    -
    - -
    -
    -

    {% trans "Order summary"%}

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

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

    -
    -

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

    -
    -

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

    -
    -

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

    -
    -

    {% trans "Total"%}

    {{vm.price}} CHF /{% trans "Month" %}

    - {% endwith %} -
    -
    -
    - {% 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 %}.

    -
    - -
    -
    -
    -
    - {% endif %} -
    - - - -{%endblock%} +{% endblock navbar %} \ No newline at end of file diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 0521ffef..2b31debd 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -484,10 +484,10 @@ class OrderConfirmationView(DetailView): @cache_control(no_cache=True, must_revalidate=True, no_store=True) def get(self, request, *args, **kwargs): - if 'specs' not in request.session or 'user' not in request.session: - return HttpResponseRedirect(reverse('datacenterlight:index')) - if 'token' not in request.session: - return HttpResponseRedirect(reverse('datacenterlight:payment')) + # if 'specs' not in request.session or 'user' not in request.session: + # return HttpResponseRedirect(reverse('datacenterlight:index')) + # if 'token' not in request.session: + # return HttpResponseRedirect(reverse('datacenterlight:payment')) stripe_customer_id = request.session.get('customer') customer = StripeCustomer.objects.filter(id=stripe_customer_id).first() stripe_utils = StripeUtils() @@ -503,7 +503,8 @@ class OrderConfirmationView(DetailView): context = { 'site_url': reverse('datacenterlight:index'), 'cc_last4': card_details.get('response_object').get('last4'), - 'cc_brand': card_details.get('response_object').get('brand') + 'cc_brand': card_details.get('response_object').get('brand'), + 'vm': request.session.get('specs') } return render(request, self.template_name, context) diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index 345632d2..e9cd3f99 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -17,10 +17,12 @@

    {% blocktrans with page_header_text=page_header_text|default:"Invoice" %}{{page_header_text}}{% endblocktrans %}

    -
    - - -
    + {% if order %} +
    + + +
    + {% endif %}
    {% if order %} @@ -198,8 +200,10 @@ {%endblock%} {% block js_extra %} - - - - + {% if order %} + + + + + {% endif %} {% endblock js_extra %} \ No newline at end of file From 3c32abbf8ed7f67e867ebc9c07fd1bbb2a1ec516 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 26 Sep 2017 03:18:19 +0530 Subject: [PATCH 02/14] dcl form added --- .../templates/datacenterlight/order_detail.html | 9 ++++++++- datacenterlight/views.py | 8 ++++---- hosting/templates/hosting/order_detail.html | 8 +++++--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index 435c9534..8a51337e 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -2,4 +2,11 @@ {% block navbar %} {% include "datacenterlight/includes/_navbar.html" %} -{% endblock navbar %} \ No newline at end of file +{% endblock navbar %} + +{% block submit_btn %} +
    + {% csrf_token %} + +
    +{% endblock submit_btn %} \ No newline at end of file diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 2b31debd..26b8abff 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -484,10 +484,10 @@ class OrderConfirmationView(DetailView): @cache_control(no_cache=True, must_revalidate=True, no_store=True) def get(self, request, *args, **kwargs): - # if 'specs' not in request.session or 'user' not in request.session: - # return HttpResponseRedirect(reverse('datacenterlight:index')) - # if 'token' not in request.session: - # return HttpResponseRedirect(reverse('datacenterlight:payment')) + if 'specs' not in request.session or 'user' not in request.session: + return HttpResponseRedirect(reverse('datacenterlight:index')) + if 'token' not in request.session: + return HttpResponseRedirect(reverse('datacenterlight:payment')) stripe_customer_id = request.session.get('customer') customer = StripeCustomer.objects.filter(id=stripe_customer_id).first() stripe_utils = StripeUtils() diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index e9cd3f99..b332c5c1 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -139,9 +139,11 @@
    {% 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 %}.
    - + {% block submit_btn %} + + {% endblock submit_btn %}
    From dfbda2a53bf624e9ae814020952066fa5f13a274 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 26 Sep 2017 03:21:20 +0530 Subject: [PATCH 03/14] load tag --- datacenterlight/templates/datacenterlight/order_detail.html | 1 + 1 file changed, 1 insertion(+) diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index 8a51337e..cb9cf209 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -1,4 +1,5 @@ {% extends "hosting/order_detail.html" %} +{% load i18n %} {% block navbar %} {% include "datacenterlight/includes/_navbar.html" %} From 3cf28c793c07498423492df91108e16f3d897f14 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 26 Sep 2017 03:29:38 +0530 Subject: [PATCH 04/14] form method fix --- .../datacenterlight/order_detail.html | 11 ++++++++-- hosting/templates/hosting/order_detail.html | 22 +++++++++---------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index cb9cf209..dbb5ebbf 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -7,7 +7,14 @@ {% block submit_btn %}
    - {% csrf_token %} - + {% 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 %}.
    +
    +
    + +
    +
    {% endblock submit_btn %} \ No newline at end of file diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index b332c5c1..8dd61412 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -132,21 +132,21 @@ {% endif %} {% if not order %} -
    - {% 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 %}.
    -
    -
    - {% block submit_btn %} + {% block submit_btn %} + + {% 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 %}.
    +
    +
    - {% endblock submit_btn %} +
    -
    - + + {% endblock submit_btn %} {% endif %} {% endif %}
    From 2a99d053dc67f5575573ac34e7422304e5852b3a Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 26 Sep 2017 03:42:10 +0530 Subject: [PATCH 05/14] text fixes --- datacenterlight/views.py | 3 ++- hosting/templates/hosting/order_detail.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 26b8abff..76d62076 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -504,7 +504,8 @@ class OrderConfirmationView(DetailView): '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') + 'vm': request.session.get('specs'), + 'page_header_text': _('Confirm Order') } return render(request, self.template_name, context) diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index 8dd61412..f755cfdf 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -31,7 +31,7 @@

    {% endif %}

    - {% trans "Invoice Date" %}: + {% trans "Date" %}: {% if order %} {{order.created_at|date:'Y-m-d H:i'}} From 2dbaa1c69343719c0a1bc70aae07f510a8631afe Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 26 Sep 2017 03:57:07 +0530 Subject: [PATCH 06/14] template name --- hosting/templates/hosting/order_detail.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index f755cfdf..283eb7f4 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -94,7 +94,12 @@

    {% trans "Order summary" %}

    - {% trans "Product" %}: {{vm.name}} + {% trans "Product" %}:  + {% if vm.name %} + {{ vm.name }} + {% else %} + {{ request.session.template.name }} + {% endif %}

    From 4379cebbedcca380a9480a9005ee72e364d2fece Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 28 Sep 2017 03:05:47 +0530 Subject: [PATCH 07/14] default 'card' translated --- hosting/templates/hosting/order_detail.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index 283eb7f4..daf4117d 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -80,8 +80,7 @@ {{order.last4}}
    {{user.email}} {% else %} - {{cc_brand|default:'Card'}} {% trans "ending in" %} **** - {{cc_last4}}
    + {{cc_brand|default:_('Credit Card')}} {% trans "ending in" %} ****{{cc_last4}}
    {% if request.user.is_authenticated %} {{request.user.email}} {% else %} From f0a49ef07560939ddc648ee1d7205ad6b37b70a9 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 28 Sep 2017 03:12:03 +0530 Subject: [PATCH 08/14] translations --- .../locale/de/LC_MESSAGES/django.po | 63 ++++++++++--------- hosting/locale/de/LC_MESSAGES/django.po | 45 ++++++------- 2 files changed, 56 insertions(+), 52 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index c3a7b934..b60a5e67 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-09-26 01:02+0530\n" +"POT-Creation-Date: 2017-09-28 03:07+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -336,26 +336,16 @@ msgstr "Weiter" msgid "Enter your credit card number" msgstr "Deine Kreditkartennummer" -msgid "We are cutting down the costs significantly!" -msgstr "Wir sorgen dafür, dass die Kosten für Dich signifikant abnehmen" - -msgid "Order Now!" -msgstr "Bestelle jetzt!" - +#, python-format 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." +"By clicking \"Place order\" this plan will charge your credit card account " +"with the fee of %(vm_price)sCHF/month" 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!" +"Wenn Du \"bestellen\" auswählst, wird Deine Kreditkarte mit %(vm_price)sCHF " +"pro Monat belastet" + +msgid "Place order" +msgstr "Bestellen" msgid "Thank you for order! Our team will contact you via email" msgstr "" @@ -456,8 +446,29 @@ msgstr "ist kein gültiger Name" msgid "is not a proper email" msgstr "ist keine gültige E-Mailadresse" -#~ msgid "Confirm Order" -#~ msgstr "Bestellung Bestätigen" +msgid "Confirm Order" +msgstr "Bestellung Bestätigen" + +#~ msgid "We are cutting down the costs significantly!" +#~ msgstr "Wir sorgen dafür, dass die Kosten für Dich signifikant abnehmen" + +#~ msgid "Order Now!" +#~ msgstr "Bestelle jetzt!" + +#~ 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." +#~ 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!" #~ msgid "Date" #~ msgstr "Datum" @@ -474,16 +485,6 @@ msgstr "ist keine gültige E-Mailadresse" #~ msgid "Order summary" #~ msgstr "Bestellungsübersicht" -#~ msgid "" -#~ "By clicking \"Place order\" this plan will charge your credit card " -#~ "account with the fee of %(vm_price)sCHF/month" -#~ msgstr "" -#~ "Wenn Du \"bestellen\" auswählst, wird Deine Kreditkarte mit " -#~ "%(vm_price)sCHF pro Monat belastet" - -#~ msgid "Place order" -#~ msgstr "Bestellen" - #~ msgid "" #~ "\n" #~ "Hi,\n" diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index 0cf50fd7..74391147 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-09-24 12:34+0000\n" +"POT-Creation-Date: 2017-09-28 03:07+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -331,12 +331,15 @@ msgstr "Alle Benachrichtigungen" msgid "%(page_header_text)s" msgstr "" -msgid "Invoice Date" -msgstr "Rechnung Datum" +msgid "Date" +msgstr "Datum" msgid "Status" msgstr "" +msgid "Terminated" +msgstr "Beendet" + msgid "Approved" msgstr "Akzeptiert" @@ -352,12 +355,18 @@ msgstr "Bezahlmethode" msgid "ending in" msgstr "endend in" +msgid "Credit Card" +msgstr "Kreditkarte" + msgid "Order summary" msgstr "Bestellungsübersicht" msgid "Product" msgstr "Produkt" +msgid "Period" +msgstr "Periode" + msgid "Cores" msgstr "Prozessorkerne" @@ -390,15 +399,18 @@ msgstr "Abarbeitung..." msgid "Hold tight, we are processing your request" msgstr "Bitte warten - wir bearbeiten Deine Anfrage gerade" +msgid "OK" +msgstr "" + +msgid "Close" +msgstr "Schliessen" + msgid "Some problem encountered. Please try again later." msgstr "Ein Problem ist aufgetreten. Bitte versuche es später noch einmal." msgid "Order Nr." msgstr "Bestellung Nr." -msgid "Date" -msgstr "Datum" - msgid "Amount" msgstr "Betrag" @@ -423,9 +435,6 @@ msgstr "inkl. Mehrwertsteuer" msgid "Billing Address" msgstr "Rechnungsadresse" -msgid "Credit Card" -msgstr "Kreditkarte" - msgid "" "\n" " Please fill in your credit card information " @@ -599,16 +608,13 @@ msgstr "Deine Virtuelle Maschine beenden" msgid "Do you want to cancel your Virtual Machine" msgstr "Bist Du sicher, dass Du Deine virtuelle Maschine beenden willst" -msgid "OK" -msgstr "" - #, python-format msgid "" "Your Virtual Machine %(machine_name)s is successfully " "terminated!" msgstr "" -"Deine Virtuelle Machine (VM) %(machine_name)s wurde erfolgreich " -"beendet!" +"Deine Virtuelle Machine (VM) %(machine_name)s wurde " +"erfolgreich beendet!" msgid "Virtual Machines" msgstr "Virtuelle Maschinen" @@ -697,17 +703,14 @@ msgid "" "contact Data Center Light Support." msgstr "Kontaktiere den Data Center Light Support." -msgid "Terminated" -msgstr "Beendet" - msgid "Error terminating VM" msgstr "Fehler beenden VM" msgid "Virtual Machine Cancellation" msgstr "VM Kündigung" -#~ msgid "Close" -#~ msgstr "Schliessen" +#~ msgid "Invoice Date" +#~ msgstr "Rechnung Datum" #~ msgid "VM %(VM_ID)s terminated successfully" #~ msgstr "VM %(VM_ID)s erfolgreich beendet" @@ -842,5 +845,5 @@ msgstr "VM Kündigung" #~ "Your SSH private key was already generated and downloaded, if you lost " #~ "it, contact us. " #~ msgstr "" -#~ "Dein privater SSH Key wurde bereits generiert und heruntergeladen. " -#~ "Falls Du ihn verloren hast, kontaktiere uns." +#~ "Dein privater SSH Key wurde bereits generiert und heruntergeladen. Falls " +#~ "Du ihn verloren hast, kontaktiere uns." From abb7c38d75dc58cc8085d5b583adf139eaa2d697 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 28 Sep 2017 18:27:26 +0530 Subject: [PATCH 09/14] translation fix --- .../locale/de/LC_MESSAGES/django.po | 21 ------------------- datacenterlight/views.py | 2 +- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index c0906022..585efe82 100644 --- a/datacenterlight/locale/de/LC_MESSAGES/django.po +++ b/datacenterlight/locale/de/LC_MESSAGES/django.po @@ -558,27 +558,6 @@ msgstr "" msgid "Confirm Order" msgstr "Bestellung Bestätigen" -#~ msgid "We are cutting down the costs significantly!" -#~ msgstr "Wir sorgen dafür, dass die Kosten für Dich signifikant abnehmen" - -#~ msgid "Order Now!" -#~ msgstr "Bestelle jetzt!" - -#~ 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." -#~ 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!" - #~ msgid "Date" #~ msgstr "Datum" diff --git a/datacenterlight/views.py b/datacenterlight/views.py index ec87616f..1a5332e1 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -438,7 +438,7 @@ class OrderConfirmationView(DetailView): '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') + 'page_header_text': _('Confirm Order'), 'billing_address_data': request.session.get('billing_address_data') } return render(request, self.template_name, context) From 7680e5aa2543f10be1debf685db3cbcb5e47950b Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Mon, 2 Oct 2017 00:13:28 +0200 Subject: [PATCH 10/14] Update hosting django.po --- hosting/locale/de/LC_MESSAGES/django.po | 34 ++++++++++--------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index 528c8884..da8bcf28 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-01 20:57+0000\n" +"POT-Creation-Date: 2017-10-01 22:12+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -331,8 +331,8 @@ msgstr "Alle Benachrichtigungen" msgid "%(page_header_text)s" msgstr "" -msgid "Invoice Date" -msgstr "Rechnung Datum" +msgid "Date" +msgstr "Datum" msgid "Status" msgstr "" @@ -355,6 +355,9 @@ msgstr "Bezahlmethode" msgid "ending in" msgstr "endend in" +msgid "Credit Card" +msgstr "Kreditkarte" + msgid "Order summary" msgstr "Bestellungsübersicht" @@ -408,9 +411,6 @@ msgstr "Ein Problem ist aufgetreten. Bitte versuche es später noch einmal." msgid "Order Nr." msgstr "Bestellung Nr." -msgid "Date" -msgstr "Datum" - msgid "Amount" msgstr "Betrag" @@ -435,9 +435,6 @@ msgstr "inkl. Mehrwertsteuer" msgid "Billing Address" msgstr "Rechnungsadresse" -msgid "Credit Card" -msgstr "Kreditkarte" - msgid "" "\n" " Please fill in your credit card information " @@ -696,8 +693,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." @@ -729,9 +726,6 @@ msgstr "" "Wir konnten die gesucht VM nicht finden. Kontaktiere den Data Center Light " "Support." -msgid "Terminated" -msgstr "Beendet" - msgid "Error terminating VM" msgstr "Fehler beenden VM" @@ -739,11 +733,9 @@ msgid "Virtual Machine Cancellation" msgstr "VM Kündigung" msgid "There was an error processing your request. Please try again." -msgstr "Es gab einen Fehler bei der Bearbeitung Deine Anfrage. Bitte" -" versuche es noch einmal." - -#~ msgid "Close" -#~ msgstr "Schliessen" +msgstr "" +"Es gab einen Fehler bei der Bearbeitung Deine Anfrage. Bitte versuche es " +"noch einmal." #~ msgid "Invoice Date" #~ msgstr "Rechnung Datum" @@ -881,5 +873,5 @@ msgstr "Es gab einen Fehler bei der Bearbeitung Deine Anfrage. Bitte" #~ "Your SSH private key was already generated and downloaded, if you lost " #~ "it, contact us. " #~ msgstr "" -#~ "Dein privater SSH Key wurde bereits generiert und heruntergeladen. " -#~ "Falls Du ihn verloren hast, kontaktiere uns." +#~ "Dein privater SSH Key wurde bereits generiert und heruntergeladen. Falls " +#~ "Du ihn verloren hast, kontaktiere uns." From a60590185091f6cb0ee50ddc7900390f1172742f Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Mon, 2 Oct 2017 00:15:13 +0200 Subject: [PATCH 11/14] Update datacenterlight django.po --- .../locale/de/LC_MESSAGES/django.po | 66 +++++++++---------- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index f10909ef..6a00b341 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-09-29 19:59+0000\n" +"POT-Creation-Date: 2017-10-01 22:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -388,24 +388,6 @@ msgstr "Weiter" msgid "Enter your credit card number" msgstr "Deine Kreditkartennummer" -msgid "Confirm Order" -msgstr "Bestellung Bestätigen" - -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" - #, python-format msgid "" "By clicking \"Place order\" this plan will charge your credit card account " @@ -417,21 +399,6 @@ msgstr "" msgid "Place order" msgstr "Bestellen" -msgid "Processing..." -msgstr "Abarbeitung..." - -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 "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 " @@ -525,6 +492,9 @@ msgstr "Ungültige RAM-Grösse" msgid "Invalid storage size" msgstr "Ungültige Speicher-Grösse" +msgid "Confirm Order" +msgstr "Bestellung Bestätigen" + msgid "Error." msgstr "" @@ -532,8 +502,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." @@ -545,6 +515,30 @@ msgstr "" "Deine VM ist gleich bereit. Wir senden Dir eine Bestätigungsemail, sobald Du " "auf sie zugreifen kannst." +#~ 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 "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 "We are cutting down the costs significantly!" #~ msgstr "Wir sorgen dafür, dass die Kosten für Dich signifikant abnehmen" From 42224a5d385414db56ff21610984a7a346d3ee65 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Mon, 2 Oct 2017 01:34:32 +0200 Subject: [PATCH 12/14] Add missing form ids --- .../templates/datacenterlight/order_detail.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index ad53360e..ec4befc9 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -6,14 +6,17 @@ {% endblock navbar %} {% block submit_btn %} -
    + {% 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 %}.
    - +
    From b848841337670f43f7c317a11cb8ed4ca2dcaede Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Mon, 2 Oct 2017 01:35:28 +0200 Subject: [PATCH 13/14] Add logger error messages for Stripe errors --- utils/stripe_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/stripe_utils.py b/utils/stripe_utils.py index 98f85d62..8fcf0ab1 100644 --- a/utils/stripe_utils.py +++ b/utils/stripe_utils.py @@ -28,28 +28,34 @@ def handleStripeError(f): body = e.json_body err = body['error'] response.update({'error': err['message']}) + logger.error(str(e)) return response except stripe.error.RateLimitError as e: response.update( {'error': "Too many requests made to the API too quickly"}) return response except stripe.error.InvalidRequestError as e: + logger.error(str(e)) response.update({'error': "Invalid parameters"}) return response except stripe.error.AuthenticationError as e: # Authentication with Stripe's API failed # (maybe you changed API keys recently) + logger.error(str(e)) response.update({'error': common_message}) return response except stripe.error.APIConnectionError as e: + logger.error(str(e)) response.update({'error': common_message}) return response except stripe.error.StripeError as e: # maybe send email + logger.error(str(e)) response.update({'error': common_message}) return response except Exception as e: # maybe send email + logger.error(str(e)) response.update({'error': common_message}) return response From 44b5d9bb3a8f5871de8b9ce610f979e2799d0792 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Mon, 2 Oct 2017 23:17:37 +0200 Subject: [PATCH 14/14] hosting order: Add price to vm context --- hosting/views.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hosting/views.py b/hosting/views.py index 46a0775f..e929f60b 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -686,6 +686,11 @@ class OrdersHostingDetailView(LoginRequiredMixin, context['vm'] = vm_detail.__dict__ context['vm']['name'] = '{}-{}'.format( context['vm']['configuration'], context['vm']['vm_id']) + context['vm']['price'] = get_vm_price( + cpu=context['vm']['cores'], + disk_size=context['vm']['disk_size'], + memory=context['vm']['memory'] + ) except VMDetail.DoesNotExist: try: manager = OpenNebulaManager(