Now booking is only for users with memberships. Added method to know if a membership is active or not. Added new formula for booking pricing. handling border cases when an user want to book. Added booking order detail view. Added booking order detail html.
This commit is contained in:
parent
2eb2c90b1f
commit
e3d1761d45
14 changed files with 345 additions and 45 deletions
|
|
@ -0,0 +1,88 @@
|
|||
{% extends "new_base_glarus.html" %}
|
||||
{% load staticfiles bootstrap3 i18n %}
|
||||
{% block content %}
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
.invoice-title{
|
||||
text-align: center !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
|
||||
<section id="price">
|
||||
<div class="signup-container">
|
||||
<div class="col-xs-12 col-sm-6 col-lg-8 text-center wow fadeInDown">
|
||||
<div class="payment-box">
|
||||
<h2 class="section-heading payment-head">Your Booking Detail</h2>
|
||||
<hr class="greyline-long">
|
||||
<h2 class="billing-head">Invoice<btn class="btn btn-primary btn-grey btn-edit print" data-print="price">Get PDF</btn></h2>
|
||||
|
||||
<h2 class="order-head">Order Number</h2>
|
||||
<h2 class="member-name">#{{order.id}}</h2>
|
||||
|
||||
<h2 class="order-head">Billed to :</h2>
|
||||
<h2 class="history-name">{{user.name}}<br>
|
||||
{{order.billing_address.street_address}},{{order.billing_address.postal_code}}<br>
|
||||
{{order.billing_address.city}}, {{order.billing_address.country}}.
|
||||
</h2>
|
||||
|
||||
<h2 class="order-head">Payment Method</h2>
|
||||
<h2 class="history-name">
|
||||
{{order.cc_brand}} ending **** {{order.last4}}<br>
|
||||
{{user.email}}
|
||||
</h2>
|
||||
|
||||
<hr class="greyline-long">
|
||||
<h2 class="order-head">Order Summary</h2>
|
||||
<h2 class="history-name">
|
||||
Dates: {{start_date}} - {{end_date}}<br>
|
||||
</h2>
|
||||
<h2 class="col-xs-6 payment-total text-left">Total days {{booking_days}}</h2>
|
||||
<h2 class="order-sum">{{original_price|floatformat}}CHF</h2>
|
||||
{% if free_days %}
|
||||
<h2 class="col-xs-6 payment-total text-left">Free days {{free_days}} </h2>
|
||||
<h2 class="order-sum">-{{total_discount|floatformat}}CHF</h2>
|
||||
{% endif %}
|
||||
<hr class="greyline-long">
|
||||
<h2 class="col-xs-6 payment-total text-left"> Total</h2>
|
||||
<h2 class="order-result">{{final_price|floatformat}}CHF</h2>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-4 col-lg-4 wow fadeInDown">
|
||||
<div class="order-summary">
|
||||
<div class="header text-center">
|
||||
<h2 class="order-name">Order Summary</h2>
|
||||
</div>
|
||||
<div class="order-box">
|
||||
<h2 class="col-xs-6 order-item" style="padding-bottom:10px">Dates: {{start_date}} - {{end_date}}<br></h2>
|
||||
|
||||
<h2 class="col-xs-6 payment-total">Total days {{booking_days}}</h2>
|
||||
<h2 class="order-sum">{{original_price|floatformat}}CHF</h2>
|
||||
{% if free_days %}
|
||||
<h2 class="col-xs-6 payment-total">Free days {{free_days}}</h2>
|
||||
<h2 class="order-sum">-{{total_discount|floatformat}}CHF</h2>
|
||||
{% endif %}
|
||||
<hr class="greyline">
|
||||
<h2 class="col-xs-6 payment-total">Total</h2>
|
||||
<h2 class="order-result">{{final_price|floatformat}}CHF</h2>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- stripe key data -->
|
||||
{% if stripe_key %}
|
||||
<script type="text/javascript">
|
||||
(function () {window.stripeKey = "{{stripe_key}}";})();
|
||||
</script>
|
||||
|
||||
{%endif%}
|
||||
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
{% extends "new_base_glarus.html" %}
|
||||
{% load staticfiles bootstrap3 i18n %}
|
||||
{% block content %}
|
||||
|
||||
|
||||
<!-- Header -->
|
||||
<!-- Services Section -->
|
||||
<section id="price">
|
||||
<div class="signup-container">
|
||||
<div class="col-xs-12 col-sm-6 col-lg-8 text-center wow fadeInDown">
|
||||
<div class="payment-box">
|
||||
<h2 class="section-heading payment-head">Your Order History</h2>
|
||||
<hr class="greyline-long">
|
||||
<h2 class="order-head">Member Name</h2>
|
||||
<h2 class="member-name">{{request.user.name}}</h2>
|
||||
<hr class="greyline-long">
|
||||
<h2 class="order-head">Active Membership</h2>
|
||||
<h2 class="member-name">2016.11.13-2016.12.13</h2>
|
||||
<hr class="greyline-long">
|
||||
<h2 class="order-head">Booking history</h2>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Booking dates</th>
|
||||
<th>Days</th>
|
||||
<th>Invoice</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for order in orders%}
|
||||
<tr>
|
||||
<th scope="row">{{order.id}}</th>
|
||||
<td>{{order.booking.start_date}}-{{order.booking.end_date}}</td>
|
||||
<td>{{order.booking_days}}</td>
|
||||
<td><a class="btn btn-xs btn-primary btn-darkgrey" href="{% url 'digitalglarus:booking_orders_detail' order.id %}">View</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2 class="order-head">Billing Adress<btn class="btn btn-primary btn-grey btn-edit">Edit</btn></h2>
|
||||
<h2 class="history-name">Nico Schottelius<br>
|
||||
In der Au 7 8762 Schwanden<br>
|
||||
Switzerland
|
||||
</h2>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-xs-12 col-sm-4 col-lg-4 wow fadeInDown">
|
||||
<div class="order-summary">
|
||||
<h2 class="thankyou">Thank You!</h2>
|
||||
<div class="order-box">
|
||||
<span class="glyphicon glyphicon-heart icon-up"></span>
|
||||
<h2 class="signup-lead text-center">Digital Glarus lives with your love!<br>
|
||||
Our coworking space is here because of your love and support.</h2>
|
||||
|
||||
<hr class="greyline">
|
||||
|
||||
<p class="order-bottom-text text-center">This box is here just to thank you</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
@ -27,7 +27,17 @@
|
|||
<h2 class="section-heading payment-head">Booking</h2>
|
||||
<!-- <h2 class="membership-amount">35CHF</h2> -->
|
||||
<hr class="greyline-long">
|
||||
<h2 class="billing-head">Billing Adress</h2>
|
||||
<h2 class="billing-head">Billing Adress</h2>
|
||||
<h2 class="membership-lead">
|
||||
Your Digital Glarus Membership enables
|
||||
you to use our coworking space and it includes
|
||||
2 working days for the month you signed up.
|
||||
The membership fee is a monthly subscription.
|
||||
Additional day costs
|
||||
15CHF per day. More than 17 days a month it
|
||||
will charge only 290CHF/month.
|
||||
</h2>
|
||||
|
||||
<div class="signup-form form-group row">
|
||||
<form role="form" id="billing-form" method="post" action="{% url 'digitalglarus:booking_payment' %}" novalidate>
|
||||
{% for field in form %}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<div class="signup-form form-group row">
|
||||
|
||||
<div class="button-booking-box form-inline row">
|
||||
<button type="submit" class="btn btn-primary btn-blue">Go to Booking</button>
|
||||
<a class="btn btn-primary btn-blue" href={% url 'digitalglarus:booking' %}>Go to Booking</a>
|
||||
</div>
|
||||
<div class="notice-box text-left">
|
||||
<p class="order-bottom-text">Your membership will be automatically renewed each month. For deactivating go to<a href=#>my page</a></p>
|
||||
|
|
|
|||
|
|
@ -180,6 +180,9 @@
|
|||
<!-- Booking JavaScript -->
|
||||
<script src="{% static 'digitalglarus/js/booking.js' %}"></script>
|
||||
|
||||
<!-- Utils JavaScript -->
|
||||
<script src="{% static 'digitalglarus/js/utils.js' %}"></script>
|
||||
|
||||
<!-- Custom Fonts -->
|
||||
<link href="//fonts.googleapis.com/css?family=Raleway" rel="stylesheet" type="text/css">
|
||||
<link href="{% static 'digitalglarus/font-awesome-4.1.0/css/font-awesome.min.css' %}" rel="stylesheet" type="text/css">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue