dynamicweb/hosting/templates/hosting/settings.html
2019-12-31 17:28:11 +05:30

145 lines
8.9 KiB
HTML

{% extends "hosting/base_short.html" %}
{% load staticfiles bootstrap3 i18n %}
{% block css_extra %}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/paymentfont/1.1.2/css/paymentfont.min.css"/>
{% endblock css_extra %}
{% block content %}
<div class="dashboard-container wide">
{% include 'hosting/includes/_messages.html' %}
<div class="dashboard-container-head">
<h1 class="dashboard-title-thin"><img src="{% static 'hosting/img/dashboard_settings.svg' %}" class="un-icon wide"> {% trans "My Settings" %}</h1>
</div>
<!-- Credit card form -->
<div class="settings-container">
<div class="row">
<div class="col-sm-5 col-md-6 billing dcl-billing">
<h3><b>{%trans "My Username"%}</b></h3>
<hr class="top-hr">
<p>{{request.user.username}}</p>
<br>
<h3>{%trans "Billing Address" %}</h3>
<hr>
<form role="form" id="billing-form" method="post" action="" novalidate>
{% csrf_token %}
{% for field in form %}
{% bootstrap_field field show_label=False type='fields' bound_css_class='' %}
{% endfor %}
{% if form.instance.vat_number %}
{% if form.instance.vat_validation_status != "ch_vat" and form.instance.vat_validation_status != "not_needed" %}
{% if form.instance.vat_validation_status == "verified" %}
<span class="fa fa-fw fa-check-circle" aria-hidden="true" title='{% trans "Your VAT number has been verified" %}'></span>
{% elif form.instance.vat_validation_status == "pending" %}
<span class="fa fa-fw fa-info-circle" aria-hidden="true" title='{% trans "Your VAT number is under validation. VAT will be adjusted, once the validation is complete." %}'></span>
{% endif %}
{% endif %}
{% endif %}
<div class="form-group text-right">
<button type="submit" class="btn btn-vm-contact btn-wide" name="billing-form">{% trans "UPDATE" %}</button>
</div>
</form>
</div>
<div class="col-sm-7 col-md-6 creditcard-box dcl-creditcard">
<h3>{%trans "Credit Card" %}</h3>
<hr>
<div>
{% with card_list_len=cards_list|length %}
{% for card in cards_list %}
<div class="credit-card-details">
<h5 class="billing-head">{% trans "Credit Card" %}</h5>
<h5 class="membership-lead">{% trans "Last" %} 4: ***** {{card.last4}}</h5>
<h5 class="membership-lead">{% trans "Type" %}: {{card.brand}}</h5>
<h5 class="membership-lead">{% trans "Expiry" %}: {{card.exp_month}}/{{card.exp_year}}</h5>
<div class="credit-card-details-opt">
<div class="row">
{% if card_list_len > 1 %}
<div class="col-xs-6">
<a class="caps-link" href="" data-toggle="modal" data-target="#Modal{{ card.id }}"><img src="{% static 'hosting/img/delete.svg' %}" class="svg-img">{% trans "REMOVE CARD" %}</a>
<div class="modal fade" id="Modal{{card.id }}" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Confirm"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<div class="modal-icon"><i class="fa fa-trash" aria-hidden="true"></i></div>
<h4 class="modal-title" id="ModalLabel">{% trans "Remove Card"%}</h4>
<div class="modal-text">
<p>{% trans "Do you want to remove this associated card?"%}</p>
</div>
<form method="post" action="{% url 'hosting:delete_card' card.id %}">
{% csrf_token %}
<div class="modal-footer">
<button type="submit" class="btn btn-danger btn-wide" name="delete_card">{% trans "Delete"%}</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{% endif %}
<div class="col-xs-6 text-right">
{% if card.preferred %}
{% trans "DEFAULT" %}
{% else %}
<form method="post" action="">
{% csrf_token %}
<input type="hidden" name="card" value="{{card.id}}">
<a class="btn choice-btn choice-btn-faded" href="#" onclick="$(this).closest('form').submit()">{% trans "SELECT" %}</a>
</form>
{% endif %}
</div>
</div>
</div>
</div>
{% empty %}
<div class="no-cards">
<h4>{% trans "No Credit Cards Added" %}</h4>
<p>{% blocktrans %}We are using <a href="https://stripe.com">Stripe</a> for payment and do not store your information in our database.{% endblocktrans %}</p>
</div>
{% endfor %}
{% endwith %}
<div class="new-card-head">
<div class="row">
<div class="col-xs-6">
<h4>{% trans "Add a new credit card" %}</h4>
</div>
<div class="col-xs-6 text-right">
<button data-toggle="collapse" data-target="#newcard" class="btn choice-btn">
<span class="fa fa-plus"></span>&nbsp;&nbsp;{% trans "NEW CARD" %}
</button>
</div>
</div>
</div>
<div id="newcard" class="collapse">
<hr class="thick-hr">
<div class="card-details-box">
<h3>{%trans "New Credit Card" %}</h3>
<hr>
{% include "hosting/includes/_card_input.html" %}
</div>
</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%}
{%endblock%}