2017-09-01 17:36:57 +00:00
{% extends "hosting/base_short.html" %}
{% load staticfiles bootstrap3 i18n %}
2017-09-04 18:54:18 +00:00
{% block css_extra %}
< link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/paymentfont/1.1.2/css/paymentfont.min.css" / >
{% endblock css_extra %}
2017-09-01 17:36:57 +00:00
{% block navbar %}
{% include "datacenterlight/includes/_navbar.html" %}
{% endblock navbar %}
{% block content %}
<!-- Credit card form -->
< div class = "dcl-order-container" >
< div class = "payment-container" >
2017-09-06 21:17:57 +00:00
< div class = "dcl-payment-grid" >
< div class = "dcl-payment-box" >
2017-09-05 18:42:13 +00:00
< div class = "dcl-payment-section" >
2017-09-07 14:26:34 +00:00
{% if request.user.is_authenticated %}
< div class = "dcl-payment-user" >
< h4 > {% trans "Welcome back" %} {{request.user.name}}!< / h4 >
< p > {% trans "Review your billing address and card details and proceed to make payment." %}< / p >
2017-09-05 18:42:13 +00:00
< / div >
2017-09-07 14:26:34 +00:00
{% else %}
< h3 > {%trans "Log in" %}< / h3 >
< hr class = "top-hr" >
< p style = "margin-bottom: 20px;" > {% blocktrans %}Already signed up?< br > By logging in you can retrieve saved billing information.{% endblocktrans %}< / p >
2017-10-07 10:59:40 +00:00
< form role = "form" id = "login-form" method = "post" action = "" novalidate >
2017-09-07 14:26:34 +00:00
{% for field in login_form %}
{% csrf_token %}
{% bootstrap_field field show_label=False type='fields'%}
{% endfor %}
2017-10-08 11:50:43 +00:00
< p class = "text-danger" > {{login_form.non_field_errors|striptags}}< / p >
2017-09-07 14:26:34 +00:00
< input type = 'hidden' name = 'next' value = '{{request.path}}' / >
< div class = "form-group text-right" >
2017-10-07 10:59:40 +00:00
< button type = "submit" class = "btn btn-wide btn-vm-contact" name = "login_form" > {% trans "LOGIN" %}< / button >
2017-09-07 14:26:34 +00:00
< / div >
< / form >
< p >
{% trans "Don't have an account yet?" %}< br >
{% trans "You can sign up by filling in the information below." %}< br >
2017-12-12 20:02:18 +00:00
< a href = "{% url 'hosting:reset_password' %}" target = "_blank" > {% trans "Forgot password?" %}< / a > or < a href = "{% url 'hosting:resend_activation_link' %}" target = "_blank" > {% trans "Resend activation link" %}?< / a >
2017-09-07 14:26:34 +00:00
< / p >
{% endif %}
2017-09-05 18:42:13 +00:00
< / div >
2017-09-04 18:54:18 +00:00
< / div >
2017-09-06 21:17:57 +00:00
< div class = "dcl-payment-box" >
2017-09-05 18:42:13 +00:00
< div class = "dcl-payment-section" >
2017-09-07 14:26:34 +00:00
{% if not request.user.is_authenticated %}
< h3 > < b > {%trans "Sign up"%}< / b > < / h3 >
{% else %}
< h3 > < b > {%trans "Billing Address"%}< / b > < / h3 >
{% endif %}
2017-09-06 21:17:57 +00:00
< hr class = "top-hr" >
2017-09-08 20:40:25 +00:00
{% for message in messages %}
{% if 'duplicate_email' in message.tags %}
< p class = "text-danger" > {{message}}< / p >
{% endif %}
{% endfor %}
2017-09-01 17:36:57 +00:00
< form role = "form" id = "billing-form" method = "post" action = "" novalidate >
{% csrf_token %}
2017-10-08 11:50:43 +00:00
{% for field in billing_address_form %}
2017-09-01 17:36:57 +00:00
{% bootstrap_field field show_label=False type='fields'%}
{% endfor %}
< / form >
< / div >
2017-09-05 18:42:13 +00:00
< / div >
2017-09-12 20:25:58 +00:00
< div class = "dcl-payment-box" >
< div class = "dcl-payment-section" >
< h3 > {%trans "Your Order" %}< / h3 >
< hr class = "top-hr" >
< div class = "dcl-payment-order" >
< p > {% trans "Cores"%} < strong class = "pull-right" > {{request.session.specs.cpu|floatformat}}< / strong > < / p >
< hr >
< p > {% trans "Memory"%} < strong class = "pull-right" > {{request.session.specs.memory|floatformat}} GB< / strong > < / p >
< hr >
< p > {% trans "Disk space"%} < strong class = "pull-right" > {{request.session.specs.disk_size|floatformat}} GB< / strong > < / p >
< hr >
< p > {% trans "Configuration"%} < strong class = "pull-right" > {{request.session.template.name}}< / strong > < / p >
< hr >
< p class = "last-p" > < strong > {%trans "Total" %}< / strong > < small > ({%trans "including VAT" %})< / small > < strong class = "pull-right" > {{request.session.specs.price}} CHF/{% trans "Month" %}< / strong > < / p >
< / div >
< / div >
< / div >
2017-09-06 21:17:57 +00:00
< div class = "dcl-payment-box" >
2017-09-05 18:42:13 +00:00
< div class = "dcl-payment-section" >
2017-09-01 17:36:57 +00:00
< h3 > < b > {%trans "Credit Card"%}< / b > < / h3 >
2017-09-06 21:17:57 +00:00
< hr class = "top-hr" >
2017-09-07 14:26:34 +00:00
< p >
2017-09-08 18:16:29 +00:00
{% blocktrans %}Please fill in your credit card information below. We are using < a href = "https://stripe.com" target = "_blank" > Stripe< / a > for payment and do not store your information in our database.{% endblocktrans %}
2017-09-07 14:26:34 +00:00
< / p >
2017-09-01 17:36:57 +00:00
< div >
2017-09-07 14:26:34 +00:00
{% if credit_card_data.last4 %}
< form role = "form" id = "payment-form-with-creditcard" novalidate >
< h5 class = "billing-head" > Credit Card< / h5 >
< h5 class = "membership-lead" > Last 4: *****{{credit_card_data.last4}}< / h5 >
< h5 class = "membership-lead" > Type: {{credit_card_data.cc_brand}}< / h5 >
< input type = "hidden" name = "credit_card_needed" value = "false" / >
< / form >
{% if not messages and not form.non_field_errors %}
< p class = "card-warning-content card-warning-addtional-margin" >
{% trans "You are not making any payment yet. After submitting your card information, you will be taken to the Confirm Order Page." %}
< / p >
{% endif %}
< div id = 'payment_error' >
{% for message in messages %}
{% if 'failed_payment' or 'make_charge_error' in message.tags %}
2017-10-03 12:48:18 +00:00
< ul class = "list-unstyled" >
< li >
< p class = "card-warning-content card-warning-error" > {{ message|safe }}< / p >
< / li >
< / ul >
2017-09-07 14:26:34 +00:00
{% endif %}
{% endfor %}
{% for error in form.non_field_errors %}
< p class = "card-warning-content card-warning-error" >
{{ error|escape }}
< / p >
{% endfor %}
< / div >
< div class = "text-right" >
2017-10-03 12:48:18 +00:00
< button id = "payment_button_with_creditcard" class = "btn btn-vm-contact" type = "submit" > {%trans "SUBMIT" %}< / button >
2017-09-07 14:26:34 +00:00
< / div >
{% else %}
< form action = "" id = "payment-form-new" method = "POST" >
< input type = "hidden" name = "token" / >
< div class = "group" >
< div class = "credit-card-goup" >
< div class = "card-element card-number-element" >
< label > {%trans "Card Number" %}< / label >
< div id = "card-number-element" class = "field my-input" > < / div >
< / div >
< div class = "row" >
< div class = "col-xs-5 card-element card-expiry-element" >
< label > {%trans "Expiry Date" %}< / label >
< div id = "card-expiry-element" class = "field my-input" > < / div >
< / div >
< div class = "col-xs-3 col-xs-offset-4 card-element card-cvc-element" >
< label > {%trans "CVC" %}< / label >
< div id = "card-cvc-element" class = "field my-input" > < / div >
< / div >
< / div >
< div class = "card-element brand" >
< label > {%trans "Card Type" %}< / label >
< i class = "pf pf-credit-card" id = "brand-icon" > < / i >
< / div >
< / div >
< / div >
< div id = "card-errors" > < / div >
2017-09-06 21:17:57 +00:00
{% if not messages and not form.non_field_errors %}
2017-09-07 14:26:34 +00:00
< p class = "card-warning-content" >
{% trans "You are not making any payment yet. After placing your order, you will be taken to the Submit Payment Page." %}
2017-09-06 21:17:57 +00:00
< / p >
{% endif %}
< div id = 'payment_error' >
{% for message in messages %}
2017-10-12 22:57:30 +00:00
{% if 'failed_payment' in message.tags or 'make_charge_error' in message.tags or 'error' in message.tags %}
2017-09-08 20:40:25 +00:00
< ul class = "list-unstyled" >
< li > < p class = "card-warning-content card-warning-error" > {{ message|safe }}< / p > < / li >
< / ul >
2017-09-01 17:36:57 +00:00
{% endif %}
2017-09-06 21:17:57 +00:00
{% endfor %}
< / div >
< div class = "text-right" >
2017-09-07 14:26:34 +00:00
< button class = "btn btn-vm-contact btn-wide" type = "submit" > {%trans "SUBMIT" %}< / button >
2017-09-01 17:36:57 +00:00
< / div >
2017-09-07 14:26:34 +00:00
< div style = "display:none;" >
< p class = "payment-errors" > < / p >
< / div >
< / form >
{% endif %}
2017-09-01 17:36:57 +00:00
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
<!-- stripe key data -->
{% if stripe_key %}
{% get_current_language as LANGUAGE_CODE %}
< script type = "text/javascript" >
window.processing_text = '{%trans "Processing" %}';
window.enter_your_card_text = '{%trans "Enter your credit card number" %}';
(function () {
window.stripeKey = "{{stripe_key}}";
window.current_lan = "{{LANGUAGE_CODE}}";
})();
< / script >
{%endif%}
{% if credit_card_data.last4 and credit_card_data.cc_brand %}
< script type = "text/javascript" >
(function () {
window.hasCreditcard = true;
})();
< / script >
{%endif%}
{%endblock%}