From 0db4a113e6d1fa281ec0368297240dc254e81bb2 Mon Sep 17 00:00:00 2001 From: PCoder Date: Thu, 5 Jul 2018 23:06:47 +0200 Subject: [PATCH] Add some styles and do not let user remove card if he has only one --- datacenterlight/static/datacenterlight/css/common.css | 8 ++++++++ .../templates/datacenterlight/landing_payment.html | 2 +- hosting/static/hosting/css/commons.css | 9 +++++++++ hosting/templates/hosting/settings.html | 4 ++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/datacenterlight/static/datacenterlight/css/common.css b/datacenterlight/static/datacenterlight/css/common.css index 4b3b7b41..28674b30 100644 --- a/datacenterlight/static/datacenterlight/css/common.css +++ b/datacenterlight/static/datacenterlight/css/common.css @@ -171,4 +171,12 @@ footer .dcl-link-separator::before { .credit-card-info .align-bottom { align-self: flex-end; padding-right: 0 !important; +} + +.new-card-head { + margin-top: 10px; +} +.new-card-button-margin button{ + margin-top: 5px; + margin-bottom: 5px; } \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/landing_payment.html b/datacenterlight/templates/datacenterlight/landing_payment.html index b774f4c2..4c43f41c 100644 --- a/datacenterlight/templates/datacenterlight/landing_payment.html +++ b/datacenterlight/templates/datacenterlight/landing_payment.html @@ -130,7 +130,7 @@

{% trans "Add a new credit card" %}

-
+
diff --git a/hosting/static/hosting/css/commons.css b/hosting/static/hosting/css/commons.css index 5de13353..292aeda9 100644 --- a/hosting/static/hosting/css/commons.css +++ b/hosting/static/hosting/css/commons.css @@ -431,3 +431,12 @@ margin-top: 10px; margin-bottom: 10px; } + + +.new-card-head { + margin-top: 10px; +} +.new-card-button-margin button{ + margin-top: 5px; + margin-bottom: 5px; +} \ No newline at end of file diff --git a/hosting/templates/hosting/settings.html b/hosting/templates/hosting/settings.html index 64057747..62dcc947 100644 --- a/hosting/templates/hosting/settings.html +++ b/hosting/templates/hosting/settings.html @@ -31,6 +31,7 @@

{%trans "Credit Card" %}


+ {% with card_list_len=cards_list|length %} {% for card in cards_list %}
{% trans "Credit Card" %}
@@ -38,6 +39,7 @@
{% trans "Type" %}: {{card.brand}}
+ {% if card_list_len > 1 %}
{% trans "REMOVE CARD" %}
+ {% endif %}
{% if card.preferred %} {% trans "DEFAULT" %} @@ -83,6 +86,7 @@

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

{% endfor %} + {% endwith %}