summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2015-04-26 20:18:06 +0200
committerChris Schlaeger <chris@linux.com>2015-04-26 20:18:06 +0200
commit9e61a603ff582eae6140737727f7624751d668a8 (patch)
treee151831c07f9eeeb38a69bdffb9ac8e537ff2bdb /lib
parentec68637f9f3488b1cc006c59d3949bea5fff097b (diff)
downloadpostrunner-9e61a603ff582eae6140737727f7624751d668a8.zip
Select Pace/Speed display based on Activity sport setting.
Diffstat (limited to 'lib')
-rw-r--r--lib/postrunner/ChartView.rb12
-rw-r--r--lib/postrunner/Main.rb8
2 files changed, 12 insertions, 8 deletions
diff --git a/lib/postrunner/ChartView.rb b/lib/postrunner/ChartView.rb
index 33e413d..54b6a44 100644
--- a/lib/postrunner/ChartView.rb
+++ b/lib/postrunner/ChartView.rb
@@ -15,7 +15,7 @@ module PostRunner
def initialize(activity, unit_system)
@activity = activity
- @sport = activity.fit_activity.sessions[0].sport
+ @sport = activity.sport
@unit_system = unit_system
@empty_charts = {}
end
@@ -33,9 +33,10 @@ module PostRunner
}
doc.script(java_script)
- if @sport == 'running'
+ if @sport == 'running' || @sport == 'multisport'
chart_div(doc, 'pace', "Pace (#{select_unit('min/km')})")
- else
+ end
+ if @sport != 'running'
chart_div(doc, 'speed', "Speed (#{select_unit('km/h')})")
end
chart_div(doc, 'altitude', "Elevation (#{select_unit('m')})")
@@ -94,9 +95,10 @@ EOT
s = "$(function() {\n"
s << tooltip_div
- if @sport == 'running'
+ if @sport == 'running' || @sport == 'multisport'
s << line_graph('pace', 'Pace', 'min/km', '#0A7BEE' )
- else
+ end
+ if @sport != 'running'
s << line_graph('speed', 'Speed', 'km/h', '#0A7BEE' )
end
s << line_graph('altitude', 'Elevation', 'm', '#5AAA44')
diff --git a/lib/postrunner/Main.rb b/lib/postrunner/Main.rb
index 1e75767..617f278 100644
--- a/lib/postrunner/Main.rb
+++ b/lib/postrunner/Main.rb
@@ -145,9 +145,11 @@ set <attribute> <value> <ref>
For the specified activies set the attribute to the given value. The
following attributes are supported:
- name: The activity name (defaults to FIT file name)
- type: The type of the activity
- subtype: The subtype of the activity
+ name: The activity name (defaults to FIT file name)
+ norecord: Ignore all records from this activity (value must true
+ or false)
+ type: The type of the activity
+ subtype: The subtype of the activity
show [ <ref> ]
Show the referenced FIT activity in a web browser. If no reference