Project_Camper/vagus/template/users/profile.html
2021-02-06 12:31:59 +01:00

113 lines
4.4 KiB
HTML
Executable File

{% extends 'index.html' %}
{% load static %}
{% block content %}
<div class='profile-wrapper'>
<div class='profile-wrapper-row'>
<div class='profile-wrapper-row-information'>
<div class='profile-information-row'>
<div class='profile-information-avatar'>
{% if user.avatar %}
<img src={{ user.avatar.url }}>
{% else %}
<img src='media/avatars/default.png'>
{%endif%}
</div>
<div class='profile-information-content'>
<div class='profile-email'> @{{user.email}} </div>
<div class='profile-date-joined'>Data dołączenia: {{user.date_joined|date}} </div>
<div class='profile-logout'> <p><a href="{% url 'logout_user' %}">Log Out</a></p> </div>
</div>
</div>
</div>
<div class='profile-wrapper-row-content'>
{% if user_offers %}
<h4> Moje oferty </h4>
<table class="table ">
<thead>
<tr>
<th scope="col">Tytuł oferty</th>
<th scope="col">Data Dodania</th>
<th scope="col">Kategoria</th>
<th scope="col">Cena</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
{% for offer in user_offers %}
<tr>
<td>
<a href="{{ offer.get_absolute_url }}">{{ offer.title }}</a>
</td>
<td title="{{ offer.date_added}}">{{ offer.date_added }}</td>
<td>{{ offer.category }}</td>
<td>{{ offer.price|capfirst }}</td>
<td> {{offer.status}} </td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif%}
{% if reservations %}
<h4> Rezerwacje klientów </h4>
<table class="table ">
<thead>
<tr>
<th scope="col">Wynajęty kamper</th>
<th scope="col">Uzytkownik </th>
<th scope="col">Początek rezerwacji</th>
<th scope="col">Koniec rezerwacji</th>
<th scope="col"> Koszt </th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
{% for reservation in reservations %}
<tr>
<td>
<a href="{{ reservation.get_absolute_url }}">{{ reservation.offer.title }}</a>
</td>
<td >{{reservation.user.email}}</td>
<td>{{ reservation.reservation_start_date }}</td>
<td>{{ reservation.reservation_end_date }}</td>
<td> {{ reservation.get_total_cost}} </td>
<td> {{reservation.status}} </td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if user_reservations %}
<h4> Moje rezerwacje </h4>
<table class="table ">
<thead>
<tr>
<th scope="col">Tytuł oferty</th>
<th scope="col">Data rezerwacji</th>
<th scope="col">Początek rezerwacji</th>
<th scope="col">Koniec rezerwacji</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
{% for reservation in user_reservations %}
<tr>
<td>
<a href="{{ reservation.get_absolute_url }}">{{ reservation.offer.title }}</a>
</td>
<td title="{{ reservation.created_date}}">{{ reservation.created_date }}</td>
<td>{{ reservation.reservation_start_date }}</td>
<td>{{ reservation.reservation_end_date }}</td>
<td> {{reservation.status}} </td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
</div>
</div>
{% endblock %}