Update chrono add and list management
This commit is contained in:
parent
514807204a
commit
c3d34fe174
|
@ -24,63 +24,63 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body vh-100">
|
<div class="card-body vh-100">
|
||||||
<div class="table-responsive">
|
{% if gymnast %}
|
||||||
{% if gymnast %}
|
<div class="row">
|
||||||
<div class="row">
|
<div class="col-md-6">
|
||||||
<div class="col-md-6">
|
<table class="table table-striped tablesorter" id="chrono_table">
|
||||||
<table class="table table-striped tablesorter" id="chrono_table">
|
<thead>
|
||||||
<thead>
|
<tr>
|
||||||
<tr>
|
<th style="width: 8%"> </th>
|
||||||
<th style="width: 8%"> </th>
|
<th style="width: 12%" class="header text-center">Date</th>
|
||||||
<th style="width: 12%" class="header text-center">Date</th>
|
<th style="width: 20%" class="header text-center">Routine</th>
|
||||||
<th style="width: 20%" class="header text-center">Routine</th>
|
<th style="width: 15%" class="header text-center">Type</th>
|
||||||
<th style="width: 15%" class="header text-center">Type</th>
|
<th style="width: 10%" class="header text-center">Score</th>
|
||||||
<th style="width: 10%" class="header text-center">Score</th>
|
<th style="width: 10%" class="header text-center">TOF</th>
|
||||||
<th style="width: 10%" class="header text-center">TOF</th>
|
</tr>
|
||||||
</tr>
|
</thead>
|
||||||
</thead>
|
<tbody>
|
||||||
<tbody>
|
{% for chrono in chrono_list %}
|
||||||
{% for chrono in chrono_list %}
|
<tr role="row" class="{% cycle 'odd' 'even' %}">
|
||||||
<tr role="row" class="{% cycle 'odd' 'even' %}">
|
<td>
|
||||||
<td>
|
<a href="{% url 'chrono_update' chrono.id %}">
|
||||||
<a href="{% url 'chrono_update' chrono.id %}">
|
<span class="tim-icons icon-pencil text-warning"></span>
|
||||||
<span class="tim-icons icon-pencil text-warning"></span>
|
</a>
|
||||||
|
|
||||||
|
<a href="{% url 'jump_chrono_values_create_or_update' chrono.id %}">
|
||||||
|
<span class="far fa-search-plus text-warning"></span>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
{% if chrono.details.all %}
|
||||||
|
<a href="{% url 'jump_chrono_details' chrono.id %}">
|
||||||
|
{% endif %}
|
||||||
|
{{ chrono.date | date:"j-n-Y" }}
|
||||||
|
{% if chrono.details.all %}
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
<a href="{% url 'jump_chrono_values_create_or_update' chrono.id %}">
|
</td>
|
||||||
<span class="far fa-search-plus text-warning"></span>
|
<td class="text-center">
|
||||||
</a>
|
{% if chrono.routine %}
|
||||||
</td>
|
{{ chrono.routine.long_label }}
|
||||||
<td class="text-center">
|
{% else %}
|
||||||
{% if chrono.details.all %}
|
{{ chrono.get_chrono_type_display }}
|
||||||
<a href="{% url 'jump_chrono_details' chrono.id %}">
|
{% endif %}
|
||||||
{% endif %}
|
</td>
|
||||||
{{ chrono.date | date:"j-n-Y" }}
|
<td class="text-center">{{ chrono.get_score_type_display }}</td>
|
||||||
{% if chrono.details.all %}
|
<td class="text-center">{{ chrono.score }}</td>
|
||||||
</a>
|
<td class="text-center">{{ chrono.tof }}</td>
|
||||||
{% endif %}
|
</tr>
|
||||||
</td>
|
{% endfor %}
|
||||||
<td class="text-center">
|
</tbody>
|
||||||
{% if chrono.routine %}
|
</table>
|
||||||
{{ chrono.routine.long_label }}
|
|
||||||
{% else %}
|
|
||||||
{{ chrono.get_chrono_type_display }}
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">{{ chrono.get_score_type_display }}</td>
|
|
||||||
<td class="text-center">{{ chrono.score }}</td>
|
|
||||||
<td class="text-center">{{ chrono.tof }}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6">
|
|
||||||
<canvas id="chart_chrono" class="chartjs" width="400" height="200"></canvas>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
<div class="col-md-6 pl-0 pr-0">
|
||||||
{% if chrono_list %}
|
<canvas id="chart_chrono" class="chartjs" width="100%"></canvas>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
{% if chrono_list %}
|
||||||
|
<div class="table-responsive">
|
||||||
<table class="table table-striped tablesorter" id="chrono_table">
|
<table class="table table-striped tablesorter" id="chrono_table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -128,8 +128,8 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
<p class="text-muted">There are no chronos corresponding to your criterias.</p>
|
<p class="text-muted">There are no chronos corresponding to your criterias.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -476,7 +476,7 @@ def chrono_create_or_update(request, chrono_id=None, gymnast_id=None):
|
||||||
)
|
)
|
||||||
|
|
||||||
return HttpResponseRedirect(
|
return HttpResponseRedirect(
|
||||||
reverse("gymnast_details_tab", args=(new_chrono.gymnast.id, "scores"))
|
reverse("chrono_list_for_gymnast", args=(new_chrono.gymnast.id,))
|
||||||
)
|
)
|
||||||
|
|
||||||
return render(request, "chronos/create.html", {"form": form})
|
return render(request, "chronos/create.html", {"form": form})
|
||||||
|
|
Loading…
Reference in New Issue