completing new colors
This commit is contained in:
@@ -226,6 +226,7 @@ cratiocolors = {
|
|||||||
'over target': "purple",
|
'over target': "purple",
|
||||||
'way over target': "violet",
|
'way over target': "violet",
|
||||||
'missed': "black",
|
'missed': "black",
|
||||||
|
'not assigned': "",
|
||||||
'not done': "white",
|
'not done': "white",
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -312,9 +313,11 @@ def is_session_complete_ws(ws,ps):
|
|||||||
|
|
||||||
return ratio,'partial',completiondate
|
return ratio,'partial',completiondate
|
||||||
else:
|
else:
|
||||||
|
thevalue = 0
|
||||||
for key,value in cratios.iteritems():
|
for key,value in cratios.iteritems():
|
||||||
if ratio>value:
|
if ratio>value and value>thevalue:
|
||||||
verdict = key
|
verdict = key
|
||||||
|
thevalue = value
|
||||||
|
|
||||||
completiondate = ws.reverse()[0].date
|
completiondate = ws.reverse()[0].date
|
||||||
return ratio,verdict,completiondate
|
return ratio,verdict,completiondate
|
||||||
|
|||||||
@@ -505,8 +505,8 @@ def add_workout_from_data(user,importid,data,strokedata,
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
power = 2.8*velo**3
|
power = 2.8*velo**3
|
||||||
|
|
||||||
if power.std() == 0 and power.mean() == 0:
|
#if power.std() == 0 and power.mean() == 0:
|
||||||
power = 2.8*velo**3
|
# power = 2.8*velo**3
|
||||||
|
|
||||||
# save csv
|
# save csv
|
||||||
# Create data frame with all necessary data to write to csv
|
# Create data frame with all necessary data to write to csv
|
||||||
|
|||||||
@@ -48,11 +48,13 @@
|
|||||||
<td>
|
<td>
|
||||||
{% if ps.sessiontype != 'race' %}
|
{% if ps.sessiontype != 'race' %}
|
||||||
<a class="{{ sessioncolor|lookup:ps.id }} dot"
|
<a class="{{ sessioncolor|lookup:ps.id }} dot"
|
||||||
|
title="{{ completeness|lookup:ps.id }}"
|
||||||
href="/rowers/sessions/manage/session/{{ ps.id }}/user/{{ rower.user.id }}/?when={{ timeperiod }}">
|
href="/rowers/sessions/manage/session/{{ ps.id }}/user/{{ rower.user.id }}/?when={{ timeperiod }}">
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a
|
<a
|
||||||
class="{{ sessioncolor|lookup:ps.id }} dot"
|
class="{{ sessioncolor|lookup:ps.id }} dot"
|
||||||
|
title="{{ completeness|lookup:ps.id }}"
|
||||||
href="/rowers/virtualevent/{{ ps.id }}/submit"> </a>
|
href="/rowers/virtualevent/{{ ps.id }}/submit"> </a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -58,20 +58,12 @@
|
|||||||
</td>
|
</td>
|
||||||
{% for r in rowers %}
|
{% for r in rowers %}
|
||||||
<td>
|
<td>
|
||||||
{% if thedict|lookup:'results'|lookup:r.id == 'completed' %}
|
{% if thedict|lookup:'results'|lookup:r.id != 'not assigned' %}
|
||||||
<a class="green dot"
|
<a class="{{ thedict|lookup:'color'|lookup:r.id }} dot"
|
||||||
|
title="{{ thedict|lookup:'results'|lookup:r.id }}"
|
||||||
href="{% url 'plannedsession_view' id=thedict|lookup:"id" userid=r.user.id %}"> </a>
|
href="{% url 'plannedsession_view' id=thedict|lookup:"id" userid=r.user.id %}"> </a>
|
||||||
{% elif thedict|lookup:'results'|lookup:r.id == 'partial' %}
|
|
||||||
<a class="orange dot"
|
|
||||||
href="{% url 'plannedsession_view' id=thedict|lookup:"id" userid=r.user.id %}"> </a>
|
|
||||||
{% elif thedict|lookup:'results'|lookup:r.id == 'not done' %}
|
|
||||||
<a class="white dot"
|
|
||||||
href="/rowers/sessions/manage/session/{{ thedict|lookup:"id" }}/user/{{ r.user.id }}/?when={{ timeperiod }}"> </a>
|
|
||||||
{% elif thedict|lookup:'results'|lookup:r.id == 'not assigned' %}
|
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="red dot"
|
|
||||||
href="/rowers/sessions/manage/session/{{ thedict|lookup:"id" }}/user/{{ r.user.id }}/?when={{ timeperiod }}"> </a>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -14760,14 +14760,17 @@ def plannedsessions_coach_view(request,
|
|||||||
|
|
||||||
for ps in sps:
|
for ps in sps:
|
||||||
rowerstatus = {}
|
rowerstatus = {}
|
||||||
|
rowercolor = {}
|
||||||
for r in rowers:
|
for r in rowers:
|
||||||
ratio, status,completiondate = is_session_complete(r,ps)
|
ratio, status,completiondate = is_session_complete(r,ps)
|
||||||
rowerstatus[r.id] = status
|
rowerstatus[r.id] = status
|
||||||
|
rowercolor[r.id] = cratiocolors[status]
|
||||||
sessiondict = {
|
sessiondict = {
|
||||||
'id': ps.id,
|
'id': ps.id,
|
||||||
'results':rowerstatus,
|
'results':rowerstatus,
|
||||||
'name': ps.name,
|
'name': ps.name,
|
||||||
'startdate': ps.startdate,
|
'startdate': ps.startdate,
|
||||||
|
'color': rowercolor,
|
||||||
'preferreddate': ps.preferreddate,
|
'preferreddate': ps.preferreddate,
|
||||||
'enddate': ps.enddate,
|
'enddate': ps.enddate,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -389,6 +389,62 @@ th.rotate > div > span {
|
|||||||
color: #a9c08c;
|
color: #a9c08c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.lightgreen {
|
||||||
|
background: #e2f0da;
|
||||||
|
color: #fdffc;
|
||||||
|
border: solid 1px #b2bfaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lightgreen:active {
|
||||||
|
color: #f5faf2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lightgreen:hover {
|
||||||
|
background: #b2bfaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mediumgreen {
|
||||||
|
background: #aad090;
|
||||||
|
color: #fafff7;
|
||||||
|
border: solid 1px #8db374;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mediumgreen:active {
|
||||||
|
color: #d8e6cf;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mediumgreen:hover {
|
||||||
|
background: #8db374;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purple {
|
||||||
|
background: #8c1ec1;
|
||||||
|
color: #e9ddf0;
|
||||||
|
border: solid 1px #6b0f99;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purple:active {
|
||||||
|
color: #cfa160;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purple:hover {
|
||||||
|
background: #6b0f99;
|
||||||
|
}
|
||||||
|
|
||||||
|
.violet {
|
||||||
|
background: #c20d60;
|
||||||
|
color: #f0dae5;
|
||||||
|
border: solid 1px #99034e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.violet:active {
|
||||||
|
color: #e595bd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.violet:hover {
|
||||||
|
background: #99034e;
|
||||||
|
}
|
||||||
|
|
||||||
.blue {
|
.blue {
|
||||||
color: #fae7e9;
|
color: #fae7e9;
|
||||||
border: solid 1px #27aae2;
|
border: solid 1px #27aae2;
|
||||||
@@ -799,21 +855,6 @@ th.rotate > div > span {
|
|||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lightgreen {
|
|
||||||
background: #e2f0da;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mediumgreen {
|
|
||||||
background: #aad090;
|
|
||||||
}
|
|
||||||
|
|
||||||
.purple {
|
|
||||||
background: #8c1ec1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.violet {
|
|
||||||
background: #c20d60;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* blue */
|
/* blue */
|
||||||
|
|||||||
Reference in New Issue
Block a user