Activities: minor changes

This commit is contained in:
Sam 2018-05-02 20:47:42 +02:00
parent 37ed5405bb
commit 979833bd07
2 changed files with 42 additions and 41 deletions

View File

@ -67,11 +67,9 @@ class Activity(db.Model):
"creation_date": self.creation_date,
"modification_date": self.modification_date,
"activity_date": self.activity_date,
"duration": (self.duration.total_seconds()
if self.duration
else None),
"pauses": self.pauses.total_seconds() if self.pauses else None,
"moving": self.moving.total_seconds() if self.moving else None,
"duration": str(self.duration) if self.duration else None,
"pauses": str(self.pauses) if self.pauses else None,
"moving": str(self.moving) if self.moving else None,
"distance": float(self.distance) if self.distance else None,
"min_alt": float(self.min_alt) if self.min_alt else None,
"max_alt": float(self.max_alt) if self.max_alt else None,

View File

@ -27,7 +27,7 @@ class ActivityDisplay extends React.Component {
<div className="container">
{activity && sports.length > 0 && (
<div className="row">
<div className="col-md-12">
<div className="col-md-6">
<div className="card">
<div className="card-header">
{sports.filter(sport => sport.id === activity.sport_id)
@ -35,8 +35,6 @@ class ActivityDisplay extends React.Component {
{activity.activity_date}
</div>
<div className="card-body">
<div className="row">
<div className="col-md-8">
<p>
<i className="fa fa-calendar" aria-hidden="true" />{' '}
Start at {activity.activity_date}
@ -44,7 +42,7 @@ class ActivityDisplay extends React.Component {
<p>
<i className="fa fa-clock-o" aria-hidden="true" />{' '}
Duration: {activity.duration} {' '}
{activity.pauses > 0 && (
{activity.pauses !== '0:00:00' && (
`(pauses: ${activity.pauses})`
)}
</p>
@ -66,10 +64,15 @@ class ActivityDisplay extends React.Component {
Descent: {activity.descent}m
</p>
</div>
<div className="col-md-4">
</div>
</div>
<div className="col-md-6">
<div className="card">
<div className="card-header">
Map
</div>
</div>
<div className="card-body">
to do
</div>
</div>
</div>