101 lines
5 KiB
HTML
101 lines
5 KiB
HTML
{% extends "hosting/base_short.html" %}
|
|
{% load staticfiles bootstrap3 %}
|
|
{% load i18n %}
|
|
|
|
{% block content %}
|
|
|
|
<div>
|
|
<div class="orders-container">
|
|
<div class="row">
|
|
<div class="container-table col-md-8 col-md-offset-2">
|
|
<table class="table borderless table-hover">
|
|
<h3><i class="fa fa-credit-card fa-separate"></i>{% trans "My Orders"%}</h3>
|
|
<br/>
|
|
<thead>
|
|
<tr>
|
|
<th>#</th>
|
|
<th>{% trans "Date"%}</th>
|
|
<th>{% trans "Amount"%}</th>
|
|
<th>{% trans "Status"%}</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for order in orders %}
|
|
<tr>
|
|
<td scope="row">{{ order.id }}</td>
|
|
<td>{{ order.created_at }}</td>
|
|
<td>{{ order.price }} CHF</td>
|
|
<td>{% if order.approved %}
|
|
<span class="text-success strong">{% trans "Approved"%}</span>
|
|
{% else %}
|
|
<span class="text-danger strong">{% trans "Declined"%}</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<a class="btn btn-default"
|
|
href="{% url 'hosting:orders' order.id %}">{% trans "View Detail"%}</a>
|
|
<button type="button" class="btn btn-default" data-toggle="modal"
|
|
data-target="#Modal{{ order.id }}"><a
|
|
href="#">{% trans "Cancel Order"%}</a>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
<div class="modal fade" id="Modal{{ order.id }}" tabindex="-1" role="dialog"
|
|
aria-labelledby="exampleModalLabel">
|
|
<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">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<h4 class="modal-title" id="ModalLabel">{% trans "Do You want to delete your order?"%}</h4>
|
|
|
|
<form method="post"
|
|
action="{% url 'hosting:delete_order' order.id %}">
|
|
{% csrf_token %}
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default"
|
|
data-dismiss="modal">
|
|
{% trans "Close"%}
|
|
</button>
|
|
<button type="submit" class="btn btn-primary">{% trans "Delete"%}
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
{% if is_paginated %}
|
|
<div class="pagination">
|
|
<span class="page-links">
|
|
{% if page_obj.has_previous %}
|
|
<a href="{{ request.path }}?page={{ page_obj.previous_page_number }}">{% trans "previous"%}</a>
|
|
{% endif %}
|
|
<span class="page-current">
|
|
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
|
|
</span>
|
|
{% if page_obj.has_next %}
|
|
<a href="{{ request.path }}?page={{ page_obj.next_page_number }}">{% trans "next"%}</a>
|
|
{% endif %}
|
|
</span>
|
|
</div>
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|