Add intensity détails
This commit is contained in:
parent
1812793d21
commit
db44425d73
|
@ -576,6 +576,10 @@ class Intensity(Markdownizable, Seasonisable):
|
||||||
def mean_difficulty_by_passe(self):
|
def mean_difficulty_by_passe(self):
|
||||||
return self.difficulty / self.number_of_passes
|
return self.difficulty / self.number_of_passes
|
||||||
|
|
||||||
|
@property
|
||||||
|
def mean_difficulty_by_passe_in_unit(self):
|
||||||
|
return (self.difficulty / 10) / self.number_of_passes
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def mean_quantity_of_skill(self):
|
def mean_quantity_of_skill(self):
|
||||||
return self.quantity_of_skill / self.time
|
return self.quantity_of_skill / self.time
|
||||||
|
|
|
@ -46,20 +46,20 @@
|
||||||
<span class="tim-icons icon-pencil text-warning"></span>
|
<span class="tim-icons icon-pencil text-warning"></span>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ intensity.date | date:"d-m-Y" }}</td>
|
<td><a href="{% url 'intensity_details' intensity.id %}">{{ intensity.date | date:"d-m-Y" }}</a></td>
|
||||||
<td class="text-left">
|
<td class="text-left">
|
||||||
<a href="{% url 'gymnast_details_tab' intensity.gymnast.id 'routine' %}">
|
<a href="{% url 'gymnast_details_tab' intensity.gymnast.id 'routine' %}">
|
||||||
{{ intensity.gymnast }}
|
{{ intensity.gymnast }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">{{ intensity.time }}</td>
|
<td class="text-right">{{ intensity.time }}</td>
|
||||||
<td class="text-center">{{ intensity.difficulty }}</td>
|
<td class="text-right">{{ intensity.difficulty }}</td>
|
||||||
<td class="text-center">{{ intensity.quantity_of_skill }}</td>
|
<td class="text-right">{{ intensity.quantity_of_skill }}</td>
|
||||||
<td class="text-center">{{ intensity.number_of_passes }}</td>
|
<td class="text-right">{{ intensity.number_of_passes }}</td>
|
||||||
<td class="text-center">{{ intensity.mean_difficulty_by_passe | floatformat:2 }}</td>
|
<td class="text-right">{{ intensity.mean_difficulty_by_passe | floatformat:2 }}</td>
|
||||||
<td class="text-center">{{ intensity.mean_quantity_of_skill | floatformat:2 }}</td>
|
<td class="text-right">{{ intensity.mean_quantity_of_skill | floatformat:2 }}</td>
|
||||||
<td class="text-center">{{ intensity.quantity_of_skill_by_passe | floatformat:2 }}</td>
|
<td class="text-right">{{ intensity.quantity_of_skill_by_passe | floatformat:2 }}</td>
|
||||||
<td class="text-center">{{ intensity.mean_difficulty_by_skill | floatformat:2 }}</td>
|
<td class="text-right">{{ intensity.mean_difficulty_by_skill | floatformat:2 }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -101,7 +101,7 @@ urlpatterns = [
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# INTENSITY
|
# INTENSITY
|
||||||
path(r"intensity/", views.chrono_listing, name="intensity_list"),
|
path(r"intensity/", views.intensity_listing, name="intensity_list"),
|
||||||
path(
|
path(
|
||||||
r"intensity/gymnast/<int:gymnast_id>/",
|
r"intensity/gymnast/<int:gymnast_id>/",
|
||||||
views.intensity_listing,
|
views.intensity_listing,
|
||||||
|
@ -118,6 +118,11 @@ urlpatterns = [
|
||||||
views.intensity_create_or_update,
|
views.intensity_create_or_update,
|
||||||
name="intensity_update",
|
name="intensity_update",
|
||||||
),
|
),
|
||||||
|
path(
|
||||||
|
r"intensity/details/<int:intensity_id>/",
|
||||||
|
views.intensity_details,
|
||||||
|
name="intensity_details",
|
||||||
|
),
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# LEARNEDSKILL
|
# LEARNEDSKILL
|
||||||
|
|
|
@ -1316,6 +1316,19 @@ def plan_create_or_update(request, plan_id=None, gymnast_id=None, skill_id=None)
|
||||||
return render(request, "plan/create.html", context)
|
return render(request, "plan/create.html", context)
|
||||||
|
|
||||||
|
|
||||||
|
@login_required
|
||||||
|
@require_http_methods(["GET"])
|
||||||
|
def intensity_details(request, intensity_id):
|
||||||
|
"""
|
||||||
|
Récupère toutes les informations d'une intensité.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
intensity_id (int) identifiant d'une intensité
|
||||||
|
"""
|
||||||
|
intensity = get_object_or_404(Intensity, pk=intensity_id)
|
||||||
|
return render(request, "intensities/details.html", {"intensity": intensity})
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@require_http_methods(["GET"])
|
@require_http_methods(["GET"])
|
||||||
def intensity_listing(request, gymnast_id=None):
|
def intensity_listing(request, gymnast_id=None):
|
||||||
|
|
Loading…
Reference in New Issue