khana/templates/results.html

210 lines
8.0 KiB
HTML

{% extends "base.html" %}
{% load format %}
<!-- {% block page_title %}.: Search results :.{% endblock %} -->
{% block title %}Search results{% endblock %}
{% block content %}
<div class="card mb-0">
{% if event_list or gymnast_list or accident_list or skill_list or routine_list %}
{% if gymnast_list %}
<div class="card-header">
<h4 class="card-title"> Gymnast's results</h4>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table" data-sort="table">
<thead>
<tr>
<th></th>
<th>Lastname</th>
<th>Firsname</th>
<th>Age</th>
<th>Gender</th>
<th>GSM</th>
<th>GSM Mother</th>
<th>GSM Father</th>
</tr>
</thead>
<tbody>
{% for gymnast in gymnast_list %}
<tr>
<td>
<a href="{% url 'gymnast_update' gymnast.id %}">
<span class="tim-icons icon-pencil text-warning"></span>
</a>&nbsp;
{% if gymnast.email %}
<a href="mailto:{{ gymnast.email }}">
<span class="tim-icons icon-email-85 text-warning"></span>
</a>
{% endif %}
</td>
<td><a href="{% url 'gymnast_details' gymnast.id %}">{{ gymnast.user.last_name }}</a></td>
<td><a href="{% url 'gymnast_details' gymnast.id %}">{{ gymnast.user.first_name }}</a></td>
<td>{{ gymnast.age }}</td>
<td>{{ gymnast.get_gender_display }}</td>
<td>{{ gymnast.gsm | format_number }}</td>
<td>{{ gymnast.gsmm | format_number }}</td>
<td>{{ gymnast.gsmp | format_number }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
{% if event_list %}
<div class="card-header">
<h4 class="card-title"> Event's results</h4>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table" data-sort="table">
<thead>
<tr>
<th></th>
<th>Event</th>
<th>Type</th>
<th>Date</th>
<th>Place</th>
</tr>
</thead>
<tbody>
{% for event in event_list %}
<tr>
<td>
<a href="{% url 'event_update' event.id %}">
<span class="tim-icons icon-pencil text-warning"></span>
</a>
</td>
<td><a href="/event/{{ event.id }}">{{ event.name }}</a></td>
<td>{{ event.eventtype.name }}</td>
<td>{{ event.datebegin }}</td>
<td>{{ event.place.name }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
{% if accident_list %}
<div class="card-header">
<h4 class="card-title"> Accident's results</h4>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table" data-sort="table">
<thead>
<tr>
<th></th>
<th data-sorter="shortDate" data-date-format="ddmmyyyy">Date</th>
<th>Gymnast</th>
<th>Skill</th>
</tr>
</thead>
<tbody>
{% for accident in accident_list %}
<tr>
<td>
<a href="#">
<span class="tim-icons icon-pencil text-warning"></span>
</a>
</td>
<td><a href="{% url 'accident_details' accident.id %}">{{ accident.date | date:"d/m/Y" }}</a></td>
<td>{{ accident.gymnast }}</td>
<td>{{ accident.educative }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
{% if skill_list %}
<div class="card-header">
<h4 class="card-title"> Skill's results</h4>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table" data-sort="table">
<thead>
<tr>
<th></th>
<th>Label</th>
<th>Diff.</th>
<th>Level</th>
<th>Notation</th>
</tr>
</thead>
<tbody>
{% for skill in skill_list %}
<tr>
<td>
<a href="#">
<span class="tim-icons icon-pencil"></span>
</a>
</td>
<td><a href="{% url 'skill_details' skill.id %}">{{ skill.longLabel }}</a></td>
<td>{{ skill.difficulty }}</td>
<td>{{ skill.level }}</td>
<td>{{ skill.notation }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
{% if routine_list %}
<div class="card-header">
<h4 class="card-title"> Routine's results</h4>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table" data-sort="table">
<thead>
<tr>
<th></th>
<th>Label</th>
<th>Diff.</th>
<th>Level</th>
<th>Notation</th>
</tr>
</thead>
<tbody>
{% for routine in routine_list %}
<tr>
<td>
<a href="#">
<span class="tim-icons icon-pencil"></span>
</a>
</td>
<td><a href="{% url 'routine_details' routine.id %}">{{ routine.longLabel }}</a></td>
<td>{{ routines.difficulty }}</td>
<td>{{ routine.level }}</td>
<td>{{ routine.notation }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
{% else %}
<div class="card-header">
<h4 class="card-title"> Search results</h4>
</div>
<div class="card-body">
<p>There are no items corresponding to your criterias</p>
</div>
{% endif %}
{% endblock %}