From dfd910465ca97c9fce1cbb4c427cb420bf790a8e Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 1 Jul 2017 01:40:17 +0530 Subject: [PATCH 1/6] Added dcl translations used in new flow --- .../locale/de/LC_MESSAGES/django.po | 62 ++++++++++++++++--- .../datacenterlight/order_detail.html | 2 +- 2 files changed, 56 insertions(+), 8 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index f6628b9f..69e140f9 100644 --- a/datacenterlight/locale/de/LC_MESSAGES/django.po +++ b/datacenterlight/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-19 12:22+0530\n" +"POT-Creation-Date: 2017-07-01 01:37+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -99,15 +99,18 @@ msgid "" "datacenterlight account.
\n" " %(base_url)s%(activation_link)s\n" " " -msgstr "\n" -" Klicke hier um deinen %(dcl_text)s zu aktivieren.

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

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

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

+
+

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


Total

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

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

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


-

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


Total

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


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


+

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

+

{% trans "Total"%}

{{vm.price}} CHF

{% endwith %} From bd766e207332d183fa32e8150832dcb8840ca645 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 1 Jul 2017 03:11:16 +0530 Subject: [PATCH 5/6] Fixed filling up of users details while going back to payment page from order confirmation page --- datacenterlight/views.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index ffc16eb9..066089b3 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -309,6 +309,30 @@ class IndexView(CreateView): class PaymentOrderView(FormView): template_name = 'hosting/payment.html' form_class = BillingAddressForm + + def get_form_kwargs(self): + form_kwargs = super(PaymentOrderView, self).get_form_kwargs() + user = self.request.session.get('user') + if user: + custom_user = None + try: + custom_user = CustomUser.objects.get(email=user.get('email')) + except CustomUser.DoesNotExist: + return form_kwargs + current_billing_address = custom_user.billing_addresses.first() + form_kwargs = super(PaymentOrderView, self).get_form_kwargs() + if not current_billing_address: + return form_kwargs + form_kwargs.update({ + 'initial': { + 'street_address': current_billing_address.street_address, + 'city': current_billing_address.city, + 'postal_code': current_billing_address.postal_code, + 'country': current_billing_address.country, + } + }) + return form_kwargs + return def get_context_data(self, **kwargs): context = super(PaymentOrderView, self).get_context_data(**kwargs) From 4857bc2cd8735068756bd838c91c34c8fcb94e16 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 1 Jul 2017 03:54:08 +0530 Subject: [PATCH 6/6] Now fetching billing address data from session variable --- datacenterlight/views.py | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 066089b3..c0fbdb6f 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -198,6 +198,8 @@ class IndexView(CreateView): del request.session['specs'] if 'user' in request.session : del request.session['user'] + if 'billing_address_data' in request.session : + del request.session['billing_address_data'] try: manager = OpenNebulaManager() templates = manager.get_templates() @@ -312,27 +314,18 @@ class PaymentOrderView(FormView): def get_form_kwargs(self): form_kwargs = super(PaymentOrderView, self).get_form_kwargs() - user = self.request.session.get('user') - if user: - custom_user = None - try: - custom_user = CustomUser.objects.get(email=user.get('email')) - except CustomUser.DoesNotExist: - return form_kwargs - current_billing_address = custom_user.billing_addresses.first() - form_kwargs = super(PaymentOrderView, self).get_form_kwargs() - if not current_billing_address: - return form_kwargs + billing_address_data = self.request.session.get('billing_address_data') + if billing_address_data: form_kwargs.update({ 'initial': { - 'street_address': current_billing_address.street_address, - 'city': current_billing_address.city, - 'postal_code': current_billing_address.postal_code, - 'country': current_billing_address.country, + 'street_address': billing_address_data['street_address'], + 'city': billing_address_data['city'], + 'postal_code': billing_address_data['postal_code'], + 'country': billing_address_data['country'], } }) - return form_kwargs - return + return form_kwargs + def get_context_data(self, **kwargs): context = super(PaymentOrderView, self).get_context_data(**kwargs)