Client: add notes to activities - fix 10
+ minor fix on weather
This commit is contained in:
@ -64,6 +64,18 @@ function FormWithGpx (props) {
|
||||
</label>
|
||||
</div>
|
||||
)}
|
||||
<div className="form-group">
|
||||
<label>
|
||||
Notes:
|
||||
<textarea
|
||||
name="notes"
|
||||
defaultValue={activity ? activity.notes : ''}
|
||||
disabled={loading}
|
||||
className="form-control input-lg"
|
||||
maxLength="500"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
{loading ? (
|
||||
<div className="loader" />
|
||||
) : (
|
||||
@ -100,13 +112,16 @@ export default connect(
|
||||
const form = new FormData()
|
||||
form.append('file', e.target.form.gpxFile.files[0])
|
||||
form.append(
|
||||
'data', `{"sport_id": ${e.target.form.sport.value}}`
|
||||
'data',
|
||||
`{"sport_id": ${e.target.form.sport.value
|
||||
}, "notes": "${e.target.form.notes.value}"}`
|
||||
)
|
||||
dispatch(addActivity(form))
|
||||
},
|
||||
onEditActivity: (e, activity) => {
|
||||
dispatch(editActivity({
|
||||
id: activity.id,
|
||||
notes: e.target.form.notes.value,
|
||||
sport_id: +e.target.form.sport.value,
|
||||
title: e.target.form.title.value,
|
||||
}))
|
||||
|
@ -103,6 +103,17 @@ function FormWithoutGpx (props) {
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
<div className="form-group">
|
||||
<label>
|
||||
Notes:
|
||||
<textarea
|
||||
name="notes"
|
||||
defaultValue={activity ? activity.notes : ''}
|
||||
className="form-control input-lg"
|
||||
maxLength="500"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
<input
|
||||
type="submit"
|
||||
className="btn btn-primary btn-lg btn-block"
|
||||
@ -133,6 +144,7 @@ export default connect(
|
||||
activity_date: activityDate,
|
||||
distance: +e.target.form.distance.value,
|
||||
duration,
|
||||
notes: e.target.form.notes.value,
|
||||
sport_id: +e.target.form.sport_id.value,
|
||||
title: e.target.form.title.value,
|
||||
}
|
||||
|
Reference in New Issue
Block a user