adding plannedsessionstep model
This commit is contained in:
@@ -2391,6 +2391,41 @@ regularsessiontypechoices = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
# model for Planned Session (Workout, Challenge, Test)
|
# model for Planned Session (Workout, Challenge, Test)
|
||||||
|
class PlannedSessionStep(models.Model):
|
||||||
|
intensitytypes = (
|
||||||
|
("Active", "Active"),
|
||||||
|
("Rest", "Rest"),
|
||||||
|
("Warmup", "Warmup"),
|
||||||
|
("Cooldown", "Cooldown")
|
||||||
|
)
|
||||||
|
|
||||||
|
durationtypes = (
|
||||||
|
("Distance", "Distance"),
|
||||||
|
("Time", "Time")
|
||||||
|
)
|
||||||
|
|
||||||
|
targettypes = (
|
||||||
|
("Speed", "Speed"),
|
||||||
|
("HeartRate", "HeartRate"),
|
||||||
|
("Cadence", "Cadence"),
|
||||||
|
("Power", "Power")
|
||||||
|
)
|
||||||
|
|
||||||
|
manager = models.ForeignKey(User, null=True, on_delete=models.CASCADE)
|
||||||
|
name = models.TextField(default='',max_length=200, blank=True, null=True)
|
||||||
|
type = models.TextField(default='',max_length=200, blank=True, null=True)
|
||||||
|
durationvalue = models.IntegerField(default=0)
|
||||||
|
durationtype = models.TextField(default='',max_length=200, blank=True, null=True,
|
||||||
|
choices=durationtypes)
|
||||||
|
targetvalue = models.IntegerField(default=0)
|
||||||
|
targettype = models.TextField(default='',max_length=200, blank=True, null=True,
|
||||||
|
choices=targettypes)
|
||||||
|
customtargetvaluelow = models.IntegerField(default=0)
|
||||||
|
customtargetvaluehigh = models.IntegerField(default=0)
|
||||||
|
intensity = models.TextField(default='',max_length=200, blank=True, null=True,
|
||||||
|
choices=intensitytypes)
|
||||||
|
notes = models.TextField(default='',max_length=200, blank=True, null=True)
|
||||||
|
color = models.TextField(default='gray',max_length=200)
|
||||||
|
|
||||||
|
|
||||||
class PlannedSession(models.Model):
|
class PlannedSession(models.Model):
|
||||||
|
|||||||
@@ -123,15 +123,20 @@
|
|||||||
<td> {% if plan.status %} active {% else %} inactive {% endif %}</td>
|
<td> {% if plan.status %} active {% else %} inactive {% endif %}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if request.user.rower == plan.manager %}
|
{% if request.user.rower == plan.manager %}
|
||||||
<a href="/rowers/editplan/{{ plan.id }}">Edit</a>
|
<a href="/rowers/editplan/{{ plan.id }}"><i class="fas fa-pencil-alt fa-fw"></i></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td> <a href="/rowers/plan/{{ plan.id }}">Plan</a></td>
|
<td> <a href="/rowers/plan/{{ plan.id }}"><i class="fal fa-calendar-alt fa-fw"></i></a></td>
|
||||||
<td>
|
<td>
|
||||||
{% if request.user.rower == plan.manager %}
|
{% if request.user.rower == plan.manager %}
|
||||||
<a href="/rowers/deleteplan/{{ plan.id }}">Delete</a>
|
<a href="/rowers/deleteplan/{{ plan.id }}"><i class="fas fa-trash-alt fa-fw"></i></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="/rowers/sessions/user/{{ rower.user.id }}?when={{ plan.startdate|date:'Y-m-d' }}/{{ plan.enddate|date:'Y-m-d' }}/">
|
||||||
|
<i class="fas fa-calendar-alt fa-fw"></i>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user