216 lines
8.9 KiB
HTML
216 lines
8.9 KiB
HTML
{% load has_group %}
|
|
|
|
{% if latest_published_note %}
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-12 pl-0">
|
|
<div class="card mb-3">
|
|
<div class="card-header">
|
|
<div class="row">
|
|
<div class="col-8">
|
|
<h4 class="mb-0">{{ latest_published_note.title }}</h4>
|
|
<p class="text-muted">{{ latest_published_note.date | date:'j N Y' }}</p>
|
|
</div>
|
|
{% if request.user.id == latest_published_note.coach.id %}
|
|
<div class="col-1 ml-auto text-right">
|
|
<h3><a href="{% url 'note_update' latest_published_note.id %}">
|
|
<span class="far fa-pencil text-warning"></span>
|
|
</a></h3>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<div class="card-body pt-0 text-justify">
|
|
<p>{{ latest_published_note.to_markdown | safe }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-6 pl-0">
|
|
<div class="card">
|
|
<div class="card-header row">
|
|
<div class="col-8">
|
|
<h4>Next events</h4>
|
|
</div>
|
|
<div class="col-4 text-right">
|
|
<h3 class="mb-0"><a href="{% url 'event_list_for_gymnast' gymnast_id %}">
|
|
<i class="far fa-calendar-alt text-warning"></i>
|
|
</a></h3>
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
{% if next_event_list %}
|
|
<table class="table tablesorter table-condensed table-striped" id="next_events">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 25%" class='header text-left'>Name</th>
|
|
<th style="width: 9%" class='header text-center'>Date</th>
|
|
<th style="width: 7%" class='header text-center'># weeks</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for event in next_event_list %}
|
|
<tr>
|
|
<td class="text-left"><a href="{% url 'event_details' event.id %}">{{ event.name }}</a></td>
|
|
<td class="text-center">{{ event.date_begin | 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>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% else %}
|
|
<p class="text-muted">No next event associated to this gymnast.</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-6 pl-0">
|
|
<div class="card">
|
|
<div class="card-header row">
|
|
<div class="col-8">
|
|
<h4>Last notes</h4>
|
|
</div>
|
|
<div class="col-4 text-right">
|
|
<h3 class="mb-0">
|
|
<a href="{% url 'note_list_for_gymnast' gymnast_id %}">
|
|
<i class="far fa-comment-alt-lines text-warning"></i>
|
|
</a>
|
|
{% if request.user|has_group:"trainer" %}
|
|
|
|
<a href="{% url 'note_create_for_gymnast' gymnast_id %}">
|
|
<i class="fas fa-plus text-warning"></i>
|
|
</a>
|
|
{% endif %}
|
|
</h3>
|
|
</div>
|
|
</div>
|
|
<div class="card-body pr-1 pl-1">
|
|
{% if last_notes_list %}
|
|
<table class="table tablesorter table-condensed table-striped" id="notes">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 4%"></th>
|
|
<th style="width: 17%" class='header text-center'>Date</th>
|
|
<th style="width: 59%" class='header text-center'>Title</th>
|
|
<th style="width: 30%" class='header text-center'>Coach</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for note in last_notes_list %}
|
|
<tr>
|
|
<td class="text-left">
|
|
<a href="{% url 'note_update' note.id %}">
|
|
<span class="tim-icons icon-pencil text-warning"></span>
|
|
</a>
|
|
</td>
|
|
<td class="text-right">
|
|
{% if not note.status %}
|
|
<span class="text-danger">
|
|
{{ note.date | date:"j-m-Y" }}
|
|
</span>
|
|
{% else %}
|
|
{{ note.date | date:"j-m-Y" }}
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
<td class="text-left">
|
|
<a href="{% url 'note_details' note.id %}">{{ note.title }}</a>
|
|
</td>
|
|
<td class="text-center">{{ note.coach }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% else %}
|
|
<p class="pl-2 text-muted">No note for this gymnast.</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% if previous_events %}
|
|
<div class="row justify-content-center ml-3 pr-0">
|
|
<div class="col-md-12 pr-0">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h4>Previous event</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<table class="table" id="previous_events">
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
<th class='header text-left'>Event's name</th>
|
|
<th class='header text-left'>Type</th>
|
|
<th class='header text-center'>Date</th>
|
|
<th class='header text-center'># weeks</th>
|
|
<th class='header text-left'>Place</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for event in previous_event %}
|
|
<tr>
|
|
<td class="text-left">
|
|
<a href="{% url 'event_update' event.id %}">
|
|
<span class="tim-icons icon-pencil text-warning"></span>
|
|
</a>
|
|
</td>
|
|
<td class="text-left"><a href="{% url 'event_details' event.id %}">{{ event.name }}</a></td>
|
|
<td class="text-left">{{ event.event_type.name }}</td>
|
|
<td class="text-center">{{ event.date_begin | date:"d-m-Y"}}</td>
|
|
<td class="text-center">{{ event.number_of_week_from_today }}</td>
|
|
<td class="text-left"><a href="{% url 'place_details' event.place.id %}">{{ event.place.name }}</a></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
$('#next_events').tablesorter({
|
|
dateFormat : "ddmmyyyy",
|
|
headers: {
|
|
0: { sorter: false },
|
|
},
|
|
sortList: [[3, 0]]
|
|
});
|
|
|
|
$('#notes').tablesorter({
|
|
dateFormat : "ddmmyyyy",
|
|
headers: {
|
|
0: { sorter: false },
|
|
},
|
|
sortList: [[1, 1]],
|
|
});
|
|
|
|
{% if previous_events %}
|
|
$('#previous_events').tablesorter({
|
|
dateFormat : "ddmmyyyy",
|
|
headers: {
|
|
0: { sorter: false },
|
|
},
|
|
sortList: [[3, 1]],
|
|
});
|
|
{% endif %}
|
|
});
|
|
</script>
|