From 1fdc533f4db345f180f1f2303cf3582f510290f9 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 26 Sep 2017 01:18:39 +0530 Subject: [PATCH 01/16] bills list page updated --- hosting/templates/hosting/orders.html | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/hosting/templates/hosting/orders.html b/hosting/templates/hosting/orders.html index 7ec3e91b..e295639c 100644 --- a/hosting/templates/hosting/orders.html +++ b/hosting/templates/hosting/orders.html @@ -1,6 +1,6 @@ {% extends "hosting/base_short.html" %} {% load staticfiles bootstrap3 %} -{% load i18n %} +{% load i18n l10n %} {% block content %}
@@ -30,15 +30,8 @@ {% for order in orders %} {{ order.id }} - {{ order.created_at | date:"M d, Y" }} - {{ order.price }} - - {% if order.approved %} - {% trans "Approved" %} - {% else %} - {% trans "Declined" %} - {% endif %} - + {{ order.created_at | date:"M d, Y H:i" }} + {{ order.price|unlocalize }} {% trans 'See Invoice' %} From 4194a7c2d738446bad9ae87f0c43aca9d9833b90 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Wed, 27 Sep 2017 22:50:42 +0530 Subject: [PATCH 02/16] table header fixed --- hosting/templates/hosting/orders.html | 1 - 1 file changed, 1 deletion(-) diff --git a/hosting/templates/hosting/orders.html b/hosting/templates/hosting/orders.html index e295639c..d747979d 100644 --- a/hosting/templates/hosting/orders.html +++ b/hosting/templates/hosting/orders.html @@ -22,7 +22,6 @@ {% trans "Order Nr." %} {% trans "Date" %} {% trans "Amount" %} - {% trans "Status" %} From 77b2684217e16ce432bfe4d0cc7398fa809d61b9 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 28 Sep 2017 00:50:38 +0530 Subject: [PATCH 03/16] mobile alignment fix for btn --- hosting/templates/hosting/orders.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/templates/hosting/orders.html b/hosting/templates/hosting/orders.html index d747979d..4230ce0b 100644 --- a/hosting/templates/hosting/orders.html +++ b/hosting/templates/hosting/orders.html @@ -31,7 +31,7 @@ {{ order.id }} {{ order.created_at | date:"M d, Y H:i" }} {{ order.price|unlocalize }} - + {% trans 'See Invoice' %} From 8b9935f677b8052d7ae10c86eecc50dc86257c1c Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 28 Sep 2017 00:59:49 +0530 Subject: [PATCH 04/16] padding fix --- hosting/static/hosting/css/virtual-machine.css | 4 +--- hosting/templates/hosting/orders.html | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/hosting/static/hosting/css/virtual-machine.css b/hosting/static/hosting/css/virtual-machine.css index a14abc31..6bd2ab1e 100644 --- a/hosting/static/hosting/css/virtual-machine.css +++ b/hosting/static/hosting/css/virtual-machine.css @@ -618,9 +618,7 @@ left: 8px; } .table-switch .last-td { - position: absolute; - bottom: 13px; - right: 0; + text-align: right; } .table-switch tbody tr .xs-td-inline { text-align: right; diff --git a/hosting/templates/hosting/orders.html b/hosting/templates/hosting/orders.html index 4230ce0b..d747979d 100644 --- a/hosting/templates/hosting/orders.html +++ b/hosting/templates/hosting/orders.html @@ -31,7 +31,7 @@ {{ order.id }} {{ order.created_at | date:"M d, Y H:i" }} {{ order.price|unlocalize }} - + {% trans 'See Invoice' %} From d751aa6d63a0306277627370188dfc4a450d1a78 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 28 Sep 2017 18:48:21 +0530 Subject: [PATCH 05/16] padding fix --- hosting/static/hosting/css/virtual-machine.css | 1 + 1 file changed, 1 insertion(+) diff --git a/hosting/static/hosting/css/virtual-machine.css b/hosting/static/hosting/css/virtual-machine.css index 6bd2ab1e..3329d6fe 100644 --- a/hosting/static/hosting/css/virtual-machine.css +++ b/hosting/static/hosting/css/virtual-machine.css @@ -618,6 +618,7 @@ left: 8px; } .table-switch .last-td { + padding-top: 12px; text-align: right; } .table-switch tbody tr .xs-td-inline { From c6173ed2e66c6a6d256eb551882ab558c8148471 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sat, 30 Sep 2017 16:53:44 +0530 Subject: [PATCH 06/16] lead text added --- hosting/templates/hosting/create_virtual_machine.html | 1 + 1 file changed, 1 insertion(+) diff --git a/hosting/templates/hosting/create_virtual_machine.html b/hosting/templates/hosting/create_virtual_machine.html index 4ba5274e..a614dd78 100644 --- a/hosting/templates/hosting/create_virtual_machine.html +++ b/hosting/templates/hosting/create_virtual_machine.html @@ -7,6 +7,7 @@

{% trans "Create VM" %}

+

{% trans "Affordable VM hosting based in Switzerland" %}

{% if messages %}
{% for message in messages %} From 1fb75112923dd6ffabdf7bd01809ef421281724b Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sat, 30 Sep 2017 17:08:40 +0530 Subject: [PATCH 07/16] favicon link changed --- hosting/templates/hosting/base_short.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/templates/hosting/base_short.html b/hosting/templates/hosting/base_short.html index 5cf0953c..07d3a54b 100644 --- a/hosting/templates/hosting/base_short.html +++ b/hosting/templates/hosting/base_short.html @@ -33,7 +33,7 @@ - + From e4837b063c1567a508acbd45941e05c9a614533e Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 3 Oct 2017 18:18:18 +0530 Subject: [PATCH 08/16] alignment fix --- .../locale/de/LC_MESSAGES/django.po | 8 +- .../datacenterlight/landing_payment.html | 10 +- hosting/locale/de/LC_MESSAGES/django.po | 20 ++- hosting/static/hosting/css/payment.css | 2 +- hosting/templates/hosting/payment.html | 151 ++++++++---------- hosting/urls.py | 1 + hosting/views.py | 1 - 7 files changed, 86 insertions(+), 107 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index 6a00b341..7acb295f 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-01 22:13+0000\n" +"POT-Creation-Date: 2017-10-03 18:13+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -360,9 +360,6 @@ 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" @@ -515,6 +512,9 @@ msgstr "" "Deine VM ist gleich bereit. Wir senden Dir eine Bestätigungsemail, sobald Du " "auf sie zugreifen kannst." +#~ msgid "Submit" +#~ msgstr "Absenden" + #~ msgid "Date" #~ msgstr "Datum" diff --git a/datacenterlight/templates/datacenterlight/landing_payment.html b/datacenterlight/templates/datacenterlight/landing_payment.html index c7ada779..fa638d77 100644 --- a/datacenterlight/templates/datacenterlight/landing_payment.html +++ b/datacenterlight/templates/datacenterlight/landing_payment.html @@ -104,9 +104,11 @@
{% for message in messages %} {% if 'failed_payment' or 'make_charge_error' in message.tags %} -
  • -

    {{ message|safe }}

    -
+
    +
  • +

    {{ message|safe }}

    +
  • +
{% endif %} {% endfor %} {% for error in form.non_field_errors %} @@ -116,7 +118,7 @@ {% endfor %}
- +
{% else %}
diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index da8bcf28..7b687b85 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 22:12+0000\n" +"POT-Creation-Date: 2017-10-03 18:13+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -436,15 +436,10 @@ msgid "Billing Address" msgstr "Rechnungsadresse" msgid "" -"\n" -" Please fill in your credit card information " -"below. We are using Stripe for payment and do not store\n" -" your information in our database.\n" -" " +"Please fill in your credit card information below. We are using Stripe for payment and do not " +"store your information in our database." msgstr "" -"\n" "Bitte füll Deine Kreditkarteninformationen unten aus. Wir nutzen Stripe für die Bezahlung und " "speichern keine Informationen in unserer Datenbank." @@ -456,8 +451,8 @@ 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 "SUBMIT" +msgstr "" msgid "Card Number" msgstr "Kreditkartennummer" @@ -477,6 +472,9 @@ msgstr "Weiter" msgid "Enter your credit card number" msgstr "Deine Kreditkartennummer" +msgid "Submit" +msgstr "Absenden" + msgid "Reset your password" msgstr "Passwort zurücksetzen" diff --git a/hosting/static/hosting/css/payment.css b/hosting/static/hosting/css/payment.css index b1b0460d..60fa147b 100644 --- a/hosting/static/hosting/css/payment.css +++ b/hosting/static/hosting/css/payment.css @@ -47,7 +47,7 @@ font-weight: 600; } .dcl-payment-section p { - padding: 0 5px; + /*padding: 0 5px;*/ font-weight: 400; } .dcl-payment-section .card-warning-content { diff --git a/hosting/templates/hosting/payment.html b/hosting/templates/hosting/payment.html index 9b1c9e45..e9d6476f 100644 --- a/hosting/templates/hosting/payment.html +++ b/hosting/templates/hosting/payment.html @@ -69,83 +69,67 @@

{%trans "Credit 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 %} -

-
-
+

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

+
+
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 %} -
- {% 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 %} + {% endfor %} + {% for error in form.non_field_errors %} +

+ {{ error|escape }} +

+ {% endfor %} +
+
+ +
+ {% else %} +
+ +
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+
+
+ + +
-
-
- -
-
-
- - {% 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." %} @@ -154,9 +138,11 @@

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

    {{ message|safe }}

    -
+
    +
  • +

    {{ message|safe }}

    +
  • +
{% endif %} {% endfor %} @@ -166,22 +152,15 @@

{% endfor %}
-
-
-
- +
+
-
-
diff --git a/hosting/urls.py b/hosting/urls.py index f40e803a..b00a199c 100644 --- a/hosting/urls.py +++ b/hosting/urls.py @@ -10,6 +10,7 @@ from .views import ( HostingBillDetailView, SSHKeyDeleteView, SSHKeyCreateView, SSHKeyListView, SSHKeyChoiceView, DashboardView, SettingsView, ResendActivationEmailView) + urlpatterns = [ url(r'index/?$', IndexView.as_view(), name='index'), url(r'django/?$', DjangoHostingView.as_view(), name='djangohosting'), diff --git a/hosting/views.py b/hosting/views.py index 6d4f15ca..87c5a15c 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -615,7 +615,6 @@ class PaymentVMView(LoginRequiredMixin, FormView): def get(self, request, *args, **kwargs): if 'next' in request.session: del request.session['next'] - return self.render_to_response(self.get_context_data()) def post(self, request, *args, **kwargs): From 2e34d404ea4aa3664209ff5527db56c90e445bec Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 3 Oct 2017 18:25:32 +0530 Subject: [PATCH 09/16] translation --- hosting/locale/de/LC_MESSAGES/django.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index 7b687b85..a3e3c2b4 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -452,7 +452,7 @@ msgstr "" "nachdem Du die Bestellung auf der nächsten Seite bestätigt hast." msgid "SUBMIT" -msgstr "" +msgstr "ABSENDEN" msgid "Card Number" msgstr "Kreditkartennummer" From 026396470572dd34d37ec8f1c07f1161ac54db5f Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 3 Oct 2017 21:04:25 +0530 Subject: [PATCH 10/16] stripe_id used instead of id --- hosting/views.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index 6d4f15ca..1cd29532 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -638,7 +638,7 @@ class PaymentVMView(LoginRequiredMixin, FormView): request.session['billing_address_data'] = billing_address_data request.session['token'] = token - request.session['customer'] = customer.id + request.session['customer'] = customer.stripe_id return HttpResponseRedirect("{url}?{query_params}".format( url=reverse('hosting:order-confirmation'), query_params='page=payment')) @@ -663,16 +663,12 @@ class OrdersHostingDetailView(LoginRequiredMixin, context = super(DetailView, self).get_context_data(**kwargs) obj = self.get_object() owner = self.request.user - stripe_customer_id = self.request.session.get('customer') - customer = StripeCustomer.objects.filter(id=stripe_customer_id).first() + stripe_api_cus_id = self.request.session.get('customer') stripe_utils = StripeUtils() - if customer: - card_details = stripe_utils.get_card_details( - customer.stripe_id, - self.request.session.get('token') - ) - else: - card_details = {} + card_details = stripe_utils.get_card_details( + stripe_api_cus_id, + self.request.session.get('token') + ) if self.request.GET.get('page') == 'payment': context['page_header_text'] = _('Confirm Order') From 315ce92a78e1e63f473eedacc4d5ec389f91f0b2 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 3 Oct 2017 21:24:35 +0530 Subject: [PATCH 11/16] post request attributes changed --- hosting/views.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index 1cd29532..f6a64ad3 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -747,13 +747,12 @@ class OrdersHostingDetailView(LoginRequiredMixin, template = request.session.get('template') specs = request.session.get('specs') stripe_customer_id = request.session.get('customer') - customer = StripeCustomer.objects.filter(id=stripe_customer_id).first() billing_address_data = request.session.get('billing_address_data') vm_template_id = template.get('id', 1) - + stripe_api_cus_id = self.request.session.get('customer') # Make stripe charge to a customer stripe_utils = StripeUtils() - card_details = stripe_utils.get_card_details(customer.stripe_id, + card_details = stripe_utils.get_card_details(stripe_api_cus_id, request.session.get( 'token')) if not card_details.get('response_object'): @@ -780,7 +779,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, name=plan_name, stripe_plan_id=stripe_plan_id) subscription_result = stripe_utils.subscribe_customer_to_plan( - customer.stripe_id, + stripe_api_cus_id, [{"plan": stripe_plan.get( 'response_object').stripe_plan_id}]) stripe_subscription_obj = subscription_result.get('response_object') From c410e2cbc5fe889e606f5d88eb1389c65025ef21 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 3 Oct 2017 21:35:08 +0530 Subject: [PATCH 12/16] stripe_customer_id retrieved from request.user relation --- hosting/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hosting/views.py b/hosting/views.py index f6a64ad3..f0afb0c8 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -746,7 +746,9 @@ class OrdersHostingDetailView(LoginRequiredMixin, def post(self, request): template = request.session.get('template') specs = request.session.get('specs') - stripe_customer_id = request.session.get('customer') + # We assume that if the user is here, his/her StripeCustomer + # object already exists + stripe_customer_id = request.user.stripecustomer.id billing_address_data = request.session.get('billing_address_data') vm_template_id = template.get('id', 1) stripe_api_cus_id = self.request.session.get('customer') From 7e380267b749ae5ea0933d699a00b71b6d976d96 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 3 Oct 2017 21:49:51 +0530 Subject: [PATCH 13/16] Update payment.css --- hosting/static/hosting/css/payment.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hosting/static/hosting/css/payment.css b/hosting/static/hosting/css/payment.css index 60fa147b..c6cc80a9 100644 --- a/hosting/static/hosting/css/payment.css +++ b/hosting/static/hosting/css/payment.css @@ -77,7 +77,6 @@ .dcl-payment-user h4 { font-weight: 600; - padding-left: 5px; font-size: 17px; } @@ -118,4 +117,4 @@ top: 20px; bottom: 20px; } -} \ No newline at end of file +} From 4c8be518a98e7f398d22198021e20511003b637a Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 3 Oct 2017 23:42:15 +0530 Subject: [PATCH 14/16] Update Changelog --- Changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Changelog b/Changelog index 8defa619..392d5cf1 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,6 @@ +Next Release + * #3785: [hosting] update 'my bills' page design + * Bugfix: [hosting] card details input form alignment fix 1.2.4: 2017-10-02 * #3780: [hosting] Store VM details locally * #3764: [hosting] Show cancelled VMs' invoices From 7362a2f14ee4c6451349cadbbd022396b082c9a2 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 3 Oct 2017 23:43:30 +0530 Subject: [PATCH 15/16] Update Changelog --- Changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog b/Changelog index 392d5cf1..11d2443f 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,7 @@ Next Release * #3785: [hosting] update 'my bills' page design * Bugfix: [hosting] card details input form alignment fix + * #3823: [hosting] favicon link fixed 1.2.4: 2017-10-02 * #3780: [hosting] Store VM details locally * #3764: [hosting] Show cancelled VMs' invoices From 5e8b34d39c04f8e1b607387b06b67cc054184223 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 6 Oct 2017 01:02:14 +0530 Subject: [PATCH 16/16] Update hosting favicon to dcl favicon --- hosting/templates/hosting/base_short.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/templates/hosting/base_short.html b/hosting/templates/hosting/base_short.html index 07d3a54b..ee4a82eb 100644 --- a/hosting/templates/hosting/base_short.html +++ b/hosting/templates/hosting/base_short.html @@ -33,7 +33,7 @@ - +