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, "creation_date": self.creation_date,
"modification_date": self.modification_date, "modification_date": self.modification_date,
"activity_date": self.activity_date, "activity_date": self.activity_date,
"duration": (self.duration.total_seconds() "duration": str(self.duration) if self.duration else None,
if self.duration "pauses": str(self.pauses) if self.pauses else None,
else None), "moving": str(self.moving) if self.moving else None,
"pauses": self.pauses.total_seconds() if self.pauses else None,
"moving": self.moving.total_seconds() if self.moving else None,
"distance": float(self.distance) if self.distance else None, "distance": float(self.distance) if self.distance else None,
"min_alt": float(self.min_alt) if self.min_alt 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, "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"> <div className="container">
{activity && sports.length > 0 && ( {activity && sports.length > 0 && (
<div className="row"> <div className="row">
<div className="col-md-12"> <div className="col-md-6">
<div className="card"> <div className="card">
<div className="card-header"> <div className="card-header">
{sports.filter(sport => sport.id === activity.sport_id) {sports.filter(sport => sport.id === activity.sport_id)
@ -35,8 +35,6 @@ class ActivityDisplay extends React.Component {
{activity.activity_date} {activity.activity_date}
</div> </div>
<div className="card-body"> <div className="card-body">
<div className="row">
<div className="col-md-8">
<p> <p>
<i className="fa fa-calendar" aria-hidden="true" />{' '} <i className="fa fa-calendar" aria-hidden="true" />{' '}
Start at {activity.activity_date} Start at {activity.activity_date}
@ -44,13 +42,13 @@ class ActivityDisplay extends React.Component {
<p> <p>
<i className="fa fa-clock-o" aria-hidden="true" />{' '} <i className="fa fa-clock-o" aria-hidden="true" />{' '}
Duration: {activity.duration} {' '} Duration: {activity.duration} {' '}
{activity.pauses > 0 && ( {activity.pauses !== '0:00:00' && (
`(pauses: ${activity.pauses})` `(pauses: ${activity.pauses})`
)} )}
</p> </p>
<p> <p>
<i className="fa fa-road" aria-hidden="true" />{' '} <i className="fa fa-road" aria-hidden="true" />{' '}
Distance: {activity.distance}km</p> Distance: {activity.distance} km</p>
<p> <p>
<i className="fa fa-tachometer" aria-hidden="true" /> <i className="fa fa-tachometer" aria-hidden="true" />
{' '} {' '}
@ -66,10 +64,15 @@ class ActivityDisplay extends React.Component {
Descent: {activity.descent}m Descent: {activity.descent}m
</p> </p>
</div> </div>
<div className="col-md-4"> </div>
</div>
<div className="col-md-6">
<div className="card">
<div className="card-header">
Map Map
</div> </div>
</div> <div className="card-body">
to do
</div> </div>
</div> </div>
</div> </div>