Merge branch 'release/v10.72'
This commit is contained in:
@@ -1388,7 +1388,7 @@ def parsenonpainsled(fileformat,f2,summary):
|
||||
try:
|
||||
row = parsers[fileformat](f2)
|
||||
hasrecognized = True
|
||||
except KeyError:
|
||||
except (KeyError,IndexError):
|
||||
hasrecognized = False
|
||||
return None, hasrecognized, '', 'unknown'
|
||||
|
||||
|
||||
@@ -715,6 +715,8 @@ def getsmallrowdata_db(columns,ids=[],debug=False):
|
||||
data = []
|
||||
columns = [c for c in columns if c != 'None']
|
||||
|
||||
df = pd.DataFrame()
|
||||
|
||||
if len(ids)>1:
|
||||
for id, f in zip(ids,csvfilenames):
|
||||
try:
|
||||
@@ -728,11 +730,13 @@ def getsmallrowdata_db(columns,ids=[],debug=False):
|
||||
df = pd.concat(data,axis=0)
|
||||
except ValueError:
|
||||
df = pd.DataFrame()
|
||||
else:
|
||||
elif len(ids)==1:
|
||||
try:
|
||||
df = pd.read_parquet(csvfilenames[0],columns=columns,engine='pyarrow')
|
||||
except (OSError,IndexError):
|
||||
df = pd.DataFrame()
|
||||
else:
|
||||
df = pd.DataFrame()
|
||||
|
||||
|
||||
return df
|
||||
|
||||
@@ -1754,15 +1754,15 @@ def handle_updatefitnessmetric(user_id,mode,workoutids,debug=False,
|
||||
def handle_updatecp(rower_id,workoutids,debug=False,table='cpdata',**kwargs):
|
||||
columns = ['power','workoutid','time']
|
||||
df = getsmallrowdata_db(columns,ids=workoutids,debug=debug)
|
||||
dfgrouped = df.groupby(['workoutid'])
|
||||
|
||||
if not df.empty:
|
||||
if df.empty:
|
||||
return 0
|
||||
|
||||
maxt = 1.05*df['time'].max()/1000.
|
||||
else:
|
||||
maxt = 1000.
|
||||
|
||||
logarr = datautils.getlogarr(maxt)
|
||||
|
||||
dfgrouped = df.groupby(['workoutid'])
|
||||
|
||||
delta,cpvalue,avgpower = datautils.getcp(dfgrouped,logarr)
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
function copyText() {
|
||||
var tempInput = document.createElement("input");
|
||||
tempInput.style = "position: absolute; left: -1000px; top: -1000px";
|
||||
tempInput.value = "https://rowsandall.com/rowers/video/{{ analysis.id|encode }}/";
|
||||
tempInput.value = "{{ siteurl }}/rowers/video/{{ analysis.id|encode }}/";
|
||||
document.body.appendChild(tempInput);
|
||||
tempInput.select();
|
||||
document.execCommand("copy");
|
||||
@@ -123,7 +123,7 @@ function copyText() {
|
||||
{% if analysis %}
|
||||
<li class="grid_2">
|
||||
<span class="fb-share-button" style="height:20px; vertical-align: top;"
|
||||
data-href="https://rowsandall.com/rowers/video/{{ analysis.id|encode }}"
|
||||
data-href="{{ siteurl }}/rowers/video/{{ analysis.id|encode }}"
|
||||
data-layout="button" data-size="small" data-mobile-iframe="false">
|
||||
<a class="fb-xfbml-parse-ignore" target="_blank"
|
||||
href="https://www.facebook.com/sharer/sharer.php?u=https://rowsandall.com/rowers/video/{{ analysis.id|encode }}/">
|
||||
@@ -132,7 +132,7 @@ function copyText() {
|
||||
<span>
|
||||
<a class="twitter-share-button"
|
||||
href="https://twitter.com/intent/tweet"
|
||||
data-url="https://rowsandall.com/rowers/video/{{ analysis.id|encode }}/"
|
||||
data-url="{{ siteurl }}/rowers/video/{{ analysis.id|encode }}/"
|
||||
data-text="@rowsandall #rowingdata">Tweet</a>
|
||||
</span>
|
||||
<span>
|
||||
@@ -306,7 +306,7 @@ function copyText() {
|
||||
}
|
||||
</script>
|
||||
</li>
|
||||
{% if user.is_authenticated and user == workout.user.user %}
|
||||
{% if user.is_authenticated and workout|may_edit:request %}
|
||||
<li class="grid_4">
|
||||
<input type="checkbox" name="lock" id="lock" value="Lock">Lock Data and Video
|
||||
</li>
|
||||
@@ -322,7 +322,7 @@ function copyText() {
|
||||
<li class="grid_2">
|
||||
|
||||
|
||||
{% if form and user.is_authenticated and user == workout.user.user %}
|
||||
{% if form and user.is_authenticated and workout|may_edit:request %}
|
||||
|
||||
<table>
|
||||
{{ form.as_table }}
|
||||
|
||||
@@ -23,10 +23,10 @@
|
||||
</p>
|
||||
</li>
|
||||
<li class="grid_2">
|
||||
<p><a href="/rowers/sessions/?startdate={{ timeperiod|previousperiodstart }}&enddate={{ timeperiod|previousperiodend}}">Back by
|
||||
<p><a href="/rowers/sessions/coach/?startdate={{ timeperiod|previousperiodstart }}&enddate={{ timeperiod|previousperiodend}}">Back by
|
||||
{{ timeperiod|timedeltadays }} days</a>
|
||||
</p>
|
||||
<p><a href="/rowers/sessions/?startdate={{ timeperiod|nextperiodstart }}&enddate={{ timeperiod|nextperiodend}}">Forward by
|
||||
<p><a href="/rowers/sessions/coach/?startdate={{ timeperiod|nextperiodstart }}&enddate={{ timeperiod|nextperiodend}}">Forward by
|
||||
{{ timeperiod|timedeltadays }} days</a>
|
||||
</p>
|
||||
</li>
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
</p>
|
||||
</li>
|
||||
<li class="grid_2">
|
||||
<p><a href="/rowers/sessions/?startdate={{ timeperiod|previousperiodstart }}&enddate={{ timeperiod|previousperiodend}}">Back by
|
||||
<p><a href="/rowers/sessions/teamcreate/?startdate={{ timeperiod|previousperiodstart }}&enddate={{ timeperiod|previousperiodend}}">Back by
|
||||
{{ timeperiod|timedeltadays }} days</a>
|
||||
</p>
|
||||
<p><a href="/rowers/sessions/?startdate={{ timeperiod|nextperiodstart }}&enddate={{ timeperiod|nextperiodend}}">Forward by
|
||||
<p><a href="/rowers/sessions/teamcreate/?startdate={{ timeperiod|nextperiodstart }}&enddate={{ timeperiod|nextperiodend}}">Forward by
|
||||
{{ timeperiod|timedeltadays }} days</a>
|
||||
</p>
|
||||
</li>
|
||||
@@ -93,6 +93,9 @@
|
||||
|
||||
<td>
|
||||
<a class="small" href="/rowers/sessions/{{ ps.id }}/deleteconfirm/">Delete</a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="small" href="/rowers/sessions/{{ ps.id }}/maketemplate/">Save</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
</p>
|
||||
</li>
|
||||
<li class="grid_2">
|
||||
<p><a href="/rowers/sessions/?startdate={{ timeperiod|previousperiodstart }}&enddate={{ timeperiod|previousperiodend}}">Back by
|
||||
<p><a href="/rowers/sessions/coach/?startdate={{ timeperiod|previousperiodstart }}&enddate={{ timeperiod|previousperiodend}}">Back by
|
||||
{{ timeperiod|timedeltadays }} days</a>
|
||||
</p>
|
||||
<p><a href="/rowers/sessions/?startdate={{ timeperiod|nextperiodstart }}&enddate={{ timeperiod|nextperiodend}}">Forward by
|
||||
<p><a href="/rowers/sessions/coach/?startdate={{ timeperiod|nextperiodstart }}&enddate={{ timeperiod|nextperiodend}}">Forward by
|
||||
{{ timeperiod|timedeltadays }} days</a>
|
||||
</p>
|
||||
</li>
|
||||
@@ -116,6 +116,9 @@
|
||||
<td>
|
||||
<a class="small" href="/rowers/sessions/{{ ps.id }}/deleteconfirm">Delete</a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="small" href="/rowers/sessions/{{ ps.id }}/maketemplate/">Save</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
|
||||
{% endif %}
|
||||
</p>
|
||||
<p>
|
||||
Login <em>{{ rower.user }}</em>
|
||||
</p>
|
||||
{% if userform.errors %}
|
||||
<p style="color: red;">
|
||||
Please correct the error{{ form.errors|pluralize }} below.
|
||||
|
||||
@@ -156,6 +156,7 @@ def workout_video_view(request,id=''):
|
||||
'locked': True,
|
||||
'metricsform':metricsform,
|
||||
'metricsgroups': metricsgroups,
|
||||
'siteurl': settings.SITE_URL,
|
||||
})
|
||||
|
||||
|
||||
@@ -171,6 +172,9 @@ def workout_video_create_view(request,id=0):
|
||||
else:
|
||||
mode = 'erg'
|
||||
|
||||
|
||||
mayedit = checkworkoutuser(request.user,w) and isprorower(request.user.rower)
|
||||
|
||||
# get video ID and offset
|
||||
if request.method == 'POST':
|
||||
form = VideoAnalysisCreateForm(request.POST)
|
||||
@@ -265,6 +269,7 @@ def workout_video_create_view(request,id=0):
|
||||
'metrics':metrics,
|
||||
'metricsgroups': metricsgroups,
|
||||
'locked': False,
|
||||
'siteurl': settings.SITE_URL,
|
||||
})
|
||||
|
||||
# Show the EMpower Oarlock generated Stroke Profile
|
||||
|
||||
Reference in New Issue
Block a user