API & Client: add max speed in filters
This commit is contained in:
@ -133,6 +133,36 @@ export default function ActivitiesList (props) {
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
<div className="form-group">
|
||||
<label>
|
||||
Max speed (km/h):
|
||||
<div className="container">
|
||||
<div className="row">
|
||||
<div className="col-5">
|
||||
<input
|
||||
className="form-control"
|
||||
min={0}
|
||||
name="max_speed_from"
|
||||
onChange={e => updateParams(e)}
|
||||
step="1"
|
||||
type="number"
|
||||
/>
|
||||
</div>
|
||||
<div className="col-2 align-middle text-center">to</div>
|
||||
<div className="col-5">
|
||||
<input
|
||||
className="form-control"
|
||||
min={0}
|
||||
name="max_speed_to"
|
||||
onChange={e => updateParams(e)}
|
||||
step="1"
|
||||
type="number"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
<input
|
||||
className="btn btn-primary btn-lg btn-block"
|
||||
onClick={() => loadActivities()}
|
||||
|
@ -7,7 +7,7 @@ import { getDateWithTZ } from '../../utils'
|
||||
export default function ActivitiesList (props) {
|
||||
const { activities, sports, user } = props
|
||||
return (
|
||||
<div className="card">
|
||||
<div className="card activity-card">
|
||||
<div className="card-body">
|
||||
<table className="table">
|
||||
<thead>
|
||||
@ -18,6 +18,7 @@ export default function ActivitiesList (props) {
|
||||
<th scope="col">Distance</th>
|
||||
<th scope="col">Duration</th>
|
||||
<th scope="col">Ave. speed</th>
|
||||
<th scope="col">Max. speed</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -49,6 +50,7 @@ export default function ActivitiesList (props) {
|
||||
</td>
|
||||
<td className="text-right">{activity.duration}</td>
|
||||
<td className="text-right">{activity.ave_speed} km/h</td>
|
||||
<td className="text-right">{activity.max_speed} km/h</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
|
@ -59,7 +59,7 @@ class Activities extends React.Component {
|
||||
updateParams={e => this.setParams(e)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-md-9">
|
||||
<div className="col-md-9 activities-result">
|
||||
<ActivitiesList
|
||||
activities={activities}
|
||||
sports={sports}
|
||||
|
@ -83,6 +83,10 @@ input, textarea {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.activities-result {
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.activity-sport {
|
||||
margin-right: 1px;
|
||||
max-width: 20px;
|
||||
|
@ -48,10 +48,10 @@ export default function RecordsCard (props) {
|
||||
<td>
|
||||
{rec.record_type}
|
||||
</td>
|
||||
<td>
|
||||
<td className="text-right">
|
||||
{rec.value}
|
||||
</td>
|
||||
<td>
|
||||
<td className="text-right">
|
||||
<Link to={`/activities/${rec.activity_id}`}>
|
||||
{rec.activity_date}
|
||||
</Link>
|
||||
|
Reference in New Issue
Block a user