Ultron/templates/ultron/search/results.html

197 lines
9.4 KiB
HTML

{% extends "base.html" %}
<!-- {% block page_title %}.: Search results :.{% endblock %} -->
{% block title %}Search results{% endblock %}
{% block content %}
<div class="card mb-0">
{% if gymnast_list or skill_list or event_list or place_list or club_list %}
{% if gymnast_list %}
<div class="card- pt-1">
<h4 class="mb-0"> Gymnasts results</h4>
</div>
<div class="card-body pt-1 pb-1">
<div class="table-responsive pb-0">
<table class="table tablesorter table-striped table-condensed" data-sort="table" id="gymnast_table">
<thead>
<tr>
<th style="width: 3%"></th>
<th class="header text-left" style="width: 20%">Lastname</th>
<th class="header text-left" style="width: 20%">Firstname</th>
<th class="header text-left" style="width: 15%">Gender</th>
<th class="header text-left" style="width: 15%">Age</th>
<th class="header text-left" style="width: 15%">Club</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>
</td>
<td class="text-left"><a href="{% url 'gymnast_details' gymnast.id %}">{{ gymnast.last_name }}</a></td>
<td class="text-left"><a href="{% url 'gymnast_details' gymnast.id %}">{{ gymnast.first_name }}</a></td>
<td class="text-left">{{ gymnast.get_gender_display }}</td>
<td class="text-left">{{ gymnast.age }}</td>
<td class="text-left">{{ gymnast.club.acronym }} ({{ gymnast.club.place.city }})</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
{% if skill_list %}
<div class="card-header pt-1">
<h4 class="mb-0"> Skills results</h4>
</div>
<div class="card-body pt-1 pb-1">
<div class="table-responsive pb-0">
<table class="table tablesorter table-striped table-condensed" data-sort="table" id="skill_table">
<thead>
<tr>
<th class="text-left">Short Label</th>
<th class="text-center">Notation</th>
<th class="header text-center">Diff.</th>
<th class="header text-center">Level</th>
<th class="header text-center">Rank</th>
</tr>
</thead>
<tbody>
{% for skill in skill_list %}
<tr>
<td class="text-left">&nbsp;<a href="{% url 'skill_details' skill.id %}">{{ skill.short_label }}</a></td>
<td class="text-center">{{ skill.numeric_notation }}</td>
<td class="text-center">{{ skill.difficulty }}</td>
<td class="text-center">{{ skill.level }}</td>
<td class="text-center">{{ skill.rank }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
{% if event_list %}
<div class="card-header pt-1">
<h4 class="mb-0"> Events results</h4>
</div>
<div class="card-body pt-1 pb-1">
<div class="table-responsive pb-0">
<table class="table tablesorter table-striped table-condensed" data-sort="table" id="event_table">
<thead>
<tr>
<th style="width: 3%"></th>
<th class="text-left">Event</th>
<th class="text-left">Type</th>
<th class="text-center">Date</th>
<th class="text-center"># week</th>
<th class="text-left">Place</th>
</tr>
</thead>
<tbody>
{% for event in event_list %}
<tr>
<td>
<a href="{% url 'event_update' event.id %}">
<button type="button" rel="tooltip" class="btn btn-link btn-sm btn-icon">
<span class="tim-icons icon-pencil text-warning"></span>
</button>
</a>
</td>
<td class="text-left"><a href="{% url 'event_details' event.id %}">{{ event.name }}</a></td>
<td class="text-left">{{ event.eventtype.name }}</td>
<td class="text-center">{{ event.datebegin | date:"d-m-Y"}}</td>
<td class="text-center">{% if event.number_of_week_from_today < 0 %}{{event.number_of_week_from_today}}{% else %}<span class="text-{% if event.number_of_week_from_today > 12 %}success{% elif event.number_of_week_from_today > 9 %}info{% elif event.number_of_week_from_today > 6 %}warning{% else %}danger{% endif %}"><b>{{event.number_of_week_from_today}}</b></span>{% endif %}</td>
<td class="text-left">{{ event.place }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
{% if place_list %}
<div class="card-header pt-1">
<h4 class="mb-0"> Places results</h4>
</div>
<div class="card-body pt-1 pb-1">
<div class="table-responsive pb-0">
<table class="table tablesorter table-striped table-condensed" data-sort="table" id="place_table">
<thead>
<tr>
<th style="width: 3%"></th>
<th class="header text-left" style="width: 27%">Name</th>
<th class="header text-left" style="width: 35%">Address</th>
<th class="header text-center" style="width: 10%">Zip</th>
<th class="header text-left" style="width: 15%">City</th>
</tr>
</thead>
<tbody>
{% for place in place_list %}
<tr>
<td>
<a href="{% url 'place_update' place.id %}">
<button type="button" rel="tooltip" class="btn btn-link btn-sm btn-icon">
<span class="tim-icons icon-pencil text-warning"></span>
</button>
</a>
</td>
<td class="text-left"><a href="{% url 'place_details' place.id %}">{{ place.name }}</a></td>
<td class="text-left">{{ place.address }}</td>
<td class="text-left">{{ place.postal}}</td>
<td class="text-left">{{ place.city }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
{% if club_list %}
<div class="card-header pt-1">
<h4 class="mb-0"> Clubs results</h4>
</div>
<div class="card-body pt-1 pb-1">
<div class="table-responsive pb-0">
<table class="table tablesorter table-striped table-condensed" data-sort="table" id="club_table">
<thead>
<tr>
<th class="header text-left" style="width: 35%">Name</th>
<th class="header text-left" style="width: 10%">Acronym</th>
<th class="header text-left" style="width: 35%">City</th>
</tr>
</thead>
<tbody>
{% for club in club_list %}
<tr>
<td class="text-left"> {{ club.name }}</td>
<td class="text-left">{{ club.acronym }}</td>
<td class="text-left">{{ club.place.city }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
{% else %}
<div class="card-header">
<h4 class="mb-0"> Search results</h4>
</div>
<div class="card-body">
<p>There are no items corresponding to your criterias : "{{ pattern }}"</p>
</div>
{% endif %}
{% endblock %}