some more fine tuning
This commit is contained in:
@@ -2401,7 +2401,8 @@ class PlannedSessionStep(models.Model):
|
|||||||
|
|
||||||
durationtypes = (
|
durationtypes = (
|
||||||
("Distance", "Distance"),
|
("Distance", "Distance"),
|
||||||
("Time", "Time")
|
("Time", "Time"),
|
||||||
|
('RepeatUntilStepsCmplt','Repeat previous blocks n times')
|
||||||
)
|
)
|
||||||
|
|
||||||
targettypes = (
|
targettypes = (
|
||||||
@@ -2414,16 +2415,20 @@ class PlannedSessionStep(models.Model):
|
|||||||
manager = models.ForeignKey(User, null=True, on_delete=models.CASCADE)
|
manager = models.ForeignKey(User, null=True, on_delete=models.CASCADE)
|
||||||
name = models.TextField(default='',max_length=200, blank=True, null=True)
|
name = models.TextField(default='',max_length=200, blank=True, null=True)
|
||||||
type = models.TextField(default='',max_length=200, blank=True, null=True)
|
type = models.TextField(default='',max_length=200, blank=True, null=True)
|
||||||
durationvalue = models.FloatField(default=0)
|
durationvalue = models.FloatField(default=0, verbose_name="Duration Value")
|
||||||
durationtype = models.TextField(default='',max_length=200, blank=True, null=True,
|
durationtype = models.TextField(default='Time',max_length=200,
|
||||||
choices=durationtypes)
|
choices=durationtypes,
|
||||||
targetvalue = models.IntegerField(default=0)
|
verbose_name='Duration Type')
|
||||||
|
targetvalue = models.IntegerField(default=0, verbose_name="Target Value")
|
||||||
targettype = models.TextField(default='',max_length=200, blank=True, null=True,
|
targettype = models.TextField(default='',max_length=200, blank=True, null=True,
|
||||||
choices=targettypes)
|
choices=targettypes, verbose_name="Target Type")
|
||||||
targetvaluelow = models.IntegerField(default=0)
|
targetvaluelow = models.IntegerField(default=0,
|
||||||
targetvaluehigh = models.IntegerField(default=0)
|
verbose_name="Target Value Low")
|
||||||
|
targetvaluehigh = models.IntegerField(default=0,
|
||||||
|
verbose_name="Target Value High")
|
||||||
intensity = models.TextField(default='',max_length=200, blank=True, null=True,
|
intensity = models.TextField(default='',max_length=200, blank=True, null=True,
|
||||||
choices=intensitytypes)
|
choices=intensitytypes,
|
||||||
|
verbose_name = "Intensity")
|
||||||
description = models.TextField(default='',max_length=200, blank=True, null=True)
|
description = models.TextField(default='',max_length=200, blank=True, null=True)
|
||||||
color = models.TextField(default='#ddd',max_length=200)
|
color = models.TextField(default='#ddd',max_length=200)
|
||||||
|
|
||||||
@@ -2434,6 +2439,8 @@ class PlannedSessionStep(models.Model):
|
|||||||
self.color = '#90ee90'
|
self.color = '#90ee90'
|
||||||
elif self.intensity == "Rest":
|
elif self.intensity == "Rest":
|
||||||
self.color = 'add8e6'
|
self.color = 'add8e6'
|
||||||
|
if self.durationtype == 'RepeatUntilStepsCmplt':
|
||||||
|
self.color = 'ffffa7'
|
||||||
|
|
||||||
self.durationvalue = int(self.durationvalue)
|
self.durationvalue = int(self.durationvalue)
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,65 @@
|
|||||||
<input name="stepsave_and_return" type="submit" value="Update and Return to Steps">
|
<input name="stepsave_and_return" type="submit" value="Update and Return to Steps">
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="grid_2">
|
||||||
|
<h2>Explanation</h2>
|
||||||
|
<table width=90% class="listtable shortpadded">
|
||||||
|
<tr>
|
||||||
|
<th>Parameter</th>
|
||||||
|
<th>Regular Step</th>
|
||||||
|
<th>Repeat Step</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Duration Type</th><td>Time or Distance</td><td>Repeat</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Duration Value</th><td>Minutes / Meters</td><td>Block number to start repeat from</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Target Type</th><td>Set a target to hold</td><td>---</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Target Value</th>
|
||||||
|
<td>
|
||||||
|
<div>Power: Zone number (1-10), % of FTP (10-1000)</div>
|
||||||
|
<div>Speed: 1000x target speed in m/s</div>
|
||||||
|
<div>Heart Rate: Zone number (1-10), % of max (10-100); </div>
|
||||||
|
<div>Cadence: Strokes per Minute</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
Number of repetitions
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Target Value Low</th>
|
||||||
|
<td>
|
||||||
|
<div>Power: % of FTP (10-1000)</div>
|
||||||
|
<div>Speed: 1000x target speed in m/s</div>
|
||||||
|
<div>Heart Rate: % of max (10-100); </div>
|
||||||
|
<div>Cadence: Strokes per Minute</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Target Value High</th>
|
||||||
|
<td>
|
||||||
|
<div>Power: % of FTP (10-1000)</div>
|
||||||
|
<div>Speed: 1000x target speed in m/s</div>
|
||||||
|
<div>Heart Rate: % of max (10-100); </div>
|
||||||
|
<div>Cadence: Strokes per Minute</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Intensity</th><td>Warming Up, Active, Rest</td><td>Set to Active</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Description</th><td>Any other text</td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
@@ -26,9 +26,15 @@
|
|||||||
</form>
|
</form>
|
||||||
</p>
|
</p>
|
||||||
{% for step in currentsteps %}
|
{% for step in currentsteps %}
|
||||||
<div id="{{ step.id }}" draggable="true" class="trainingstep {{ step.intensity }}" >
|
<div id="{{ step.id }}" draggable="true" class="trainingstep {{ step.intensity }} {{ step.durationtype }}" >
|
||||||
|
<span id="{{ step.id }}" class="stepid">
|
||||||
|
({{ forloop.counter|add:-1 }})
|
||||||
|
</span>
|
||||||
<span id="{{ step.id }}" class="stepcontent">
|
<span id="{{ step.id }}" class="stepcontent">
|
||||||
{{ step.name }}
|
{{ step.name }}
|
||||||
|
{% if step.durationtype == "RepeatUntilStepsCmplt" %}
|
||||||
|
- repeat {{ step.targetvalue }}x from block {{ step.durationvalue|floatformat }}
|
||||||
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
<span id="{{ step.id }}">
|
<span id="{{ step.id }}">
|
||||||
<a href="/rowers/plans/step/{{ step.id }}/edit/{{ ps.id }}/">
|
<a href="/rowers/plans/step/{{ step.id }}/edit/{{ ps.id }}/">
|
||||||
@@ -43,12 +49,22 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</section>
|
</section>
|
||||||
|
<section class="allcentered">
|
||||||
|
<div class="allcenteredchild">
|
||||||
|
<h1><i class="fas fa-arrow-left fa-fw"></i></h1>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
<section class="library">
|
<section class="library">
|
||||||
<h2>Library</h2>
|
<h2>Step Library</h2>
|
||||||
{% for step in steps %}
|
{% for step in steps %}
|
||||||
<div id="{{ step.id }}" draggable="true" class="trainingstep {{ step.intensity }}" >
|
<div id="{{ step.id }}" draggable="true" class="trainingstep {{ step.intensity }} {{ step.durationtype}}" >
|
||||||
|
<span id="{{ step.id }}" class="stepid">
|
||||||
|
</span>
|
||||||
<span id="{{ step.id }}" class="stepcontent">
|
<span id="{{ step.id }}" class="stepcontent">
|
||||||
{{ step.name }}
|
{{ step.name }}
|
||||||
|
{% if step.durationtype == "RepeatUntilStepsCmplt" %}
|
||||||
|
- repeat {{ step.targetvalue }}x from block {{ step.durationvalue|floatformat }}
|
||||||
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
<span id="{{ step.id }}">
|
<span id="{{ step.id }}">
|
||||||
<a href="/rowers/plans/step/{{ step.id }}/edit/{{ ps.id }}/">
|
<a href="/rowers/plans/step/{{ step.id }}/edit/{{ ps.id }}/">
|
||||||
@@ -142,9 +158,11 @@
|
|||||||
console.log(result)
|
console.log(result)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
window.location.reload(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveState() {
|
function saveState() {
|
||||||
|
var cntr = 0;
|
||||||
var list = [];
|
var list = [];
|
||||||
steps = document.querySelector('.drop-zone');
|
steps = document.querySelector('.drop-zone');
|
||||||
steps.childNodes.forEach(function(item) {
|
steps.childNodes.forEach(function(item) {
|
||||||
@@ -153,6 +171,11 @@
|
|||||||
if (child.id && child.className == 'stepcontent') {
|
if (child.id && child.className == 'stepcontent') {
|
||||||
list.push(child.id);
|
list.push(child.id);
|
||||||
}
|
}
|
||||||
|
if (child.className == "stepid") {
|
||||||
|
s = `(${cntr})`
|
||||||
|
child.replaceWith(s);
|
||||||
|
cntr++;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -193,6 +216,7 @@
|
|||||||
dragged = null;
|
dragged = null;
|
||||||
origcolor = null;
|
origcolor = null;
|
||||||
}
|
}
|
||||||
|
saveState();
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleMouseOver(event) {
|
function handleMouseOver(event) {
|
||||||
@@ -242,6 +266,7 @@
|
|||||||
if (dragged.parentNode.className.includes("drop-zone")) {
|
if (dragged.parentNode.className.includes("drop-zone")) {
|
||||||
trash(event);
|
trash(event);
|
||||||
}
|
}
|
||||||
|
saveState();
|
||||||
}
|
}
|
||||||
|
|
||||||
function trash(event) {
|
function trash(event) {
|
||||||
@@ -251,7 +276,6 @@
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (dragged.parentNode.className.includes("drop-zone")) {
|
if (dragged.parentNode.className.includes("drop-zone")) {
|
||||||
dragged.remove();
|
dragged.remove();
|
||||||
saveState();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ th.rotate > div > span {
|
|||||||
|
|
||||||
.stepcontainer {
|
.stepcontainer {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: 4fr 1fr 4fr;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,23 +353,39 @@ th.rotate > div > span {
|
|||||||
background-color: #add8e6;
|
background-color: #add8e6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.RepeatUntilStepsCmplt {
|
||||||
|
background-color: #ffffa7;
|
||||||
|
}
|
||||||
|
|
||||||
.drop-zone {
|
.drop-zone {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: #878787;
|
background-color: #D7D7D7;
|
||||||
/* color: white; */
|
/* color: white; */
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
padding-bottom: 40px;
|
padding-bottom: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.allcentered {
|
||||||
|
/* Center vertically and horizontally */
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.allcenteredchild {
|
||||||
|
margin-top: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
.divlines {
|
.divlines {
|
||||||
display: block;
|
width: 50px;
|
||||||
overflow-x: hidden;
|
height: 50px;
|
||||||
border-width: 1px 0 0 0;
|
background-color: red;
|
||||||
border-color: #333 #333 #333 #333;
|
/* Center vertically and horizontally */
|
||||||
border-style: solid;
|
position: absolute;
|
||||||
padding: 0px;
|
top: 50%;
|
||||||
margin: 0px;
|
left: 50%;
|
||||||
|
margin: -25px 0 0 -25px; /* Apply negative top and left margins to truly center the element */
|
||||||
}
|
}
|
||||||
|
|
||||||
.workoutcontainer {
|
.workoutcontainer {
|
||||||
|
|||||||
Reference in New Issue
Block a user