[Pharo] Personal fitness tracker web app.
Incorporate Firefox accessibility suggestions and update workout logging form.
Changed files
src/MyFitnessTracker-Core/MFTSetGroupLog.class.st
@@ -130,3 +130,9 @@
130
130
131
131
^ sets groupedBy: #exercise
132
132
]
133
Added:
134
Added:
{ #category : 'testing' }
135
Added:
MFTSetGroupLog >> uniqueExercisesInSets [
136
Added:
137
Added:
^ prescription uniqueExercisesInSets
138
Added:
]
src/MyFitnessTracker-Web/MFTHomePage.class.st
@@ -30,11 +30,13 @@
30
30
html heading
31
31
level: 1;
32
32
with: self session user trainee routine canonicalName capitalized.
33
Added:
self renderStatusOn: html.
34
Added:
html horizontalRule.
33
35
self
34
Removed:
renderStatusOn: html;
35
Removed:
renderMainActionsOn: html;
36
36
renderNextWorkoutPrescriptionOn: html;
37
Removed:
renderWorkoutLogBookOn: html ]
37
Added:
renderMainActionsOn: html.
38
Added:
html horizontalRule.
39
Added:
self renderWorkoutLogBookOn: html ]
38
40
]
39
41
40
42
{ #category : 'rendering' }
@@ -94,8 +96,7 @@
94
96
html heading
95
97
level: 2;
96
98
with: 'Previous workouts'.
97
Removed:
logBook workoutLogs reverseDo: [ :each |
98
Removed:
html render: (MFTWorkoutLogViewerComponent forWorkoutLog: each) ] ]
99
Added:
logBook workoutLogs reverseDo: [ :each | html render: each ] ]
99
100
]
100
101
101
102
{ #category : 'accessing' }
src/MyFitnessTracker-Web/MFTSetGroupLogEditorComponent.class.st
@@ -21,7 +21,7 @@
21
21
MFTSetGroupLogEditorComponent >> renderContentOn: html [
22
22
23
23
html heading
24
Removed:
level: 2;
24
Added:
level: 3;
25
25
with: setGroupLog prescription canonicalName capitalized.
26
26
html form: [
27
27
setGroupLog setsGroupedByExercise keysAndValuesDo: [ :exercise :sets |
@@ -50,7 +50,7 @@
50
50
51
51
html div: [
52
52
html heading
53
Removed:
level: 3;
53
Added:
level: 4;
54
54
with: exercise canonicalName capitalized.
55
55
html button
56
56
class: 'secondary outline';
src/MyFitnessTracker-Web/MFTWorkoutLogEditorComponent.class.st
@@ -41,14 +41,12 @@
41
41
{ #category : 'rendering' }
42
42
MFTWorkoutLogEditorComponent >> renderContentOn: html [
43
43
44
Removed:
html heading
45
Removed:
level: 2;
46
Removed:
with: workoutLog prescription canonicalName.
47
44
html form: [
48
Removed:
self
49
Removed:
renderWorkoutLogMetadataOn: html;
50
Removed:
renderSetGroupLogsOn: html;
51
Removed:
renderFormActionsOn: html ]
45
Added:
self renderWorkoutLogMetadataOn: html.
46
Added:
html horizontalRule.
47
Added:
self renderSetGroupLogsOn: html.
48
Added:
html horizontalRule.
49
Added:
self renderFormActionsOn: html ]
52
50
]
53
51
54
52
{ #category : 'as yet unclassified' }
@@ -57,6 +55,7 @@
57
55
html fieldSet
58
56
class: 'grid';
59
57
with: [
58
Added:
html legend.
60
59
html submitButton
61
60
callback: [ onSaveWorkout value ];
62
61
with: 'Finish and save workout'.
@@ -96,17 +95,16 @@
96
95
| isCompletelyLogged |
97
96
isCompletelyLogged := setGroupLog isCompletelyLogged.
98
97
99
Removed:
html fieldSet: [
98
Added:
html section: [
100
99
html heading
101
Removed:
level: 2;
100
Added:
level: 3;
102
101
with: setGroupLog canonicalName capitalized.
103
102
html heading
104
Removed:
level: 3;
103
Added:
level: 4;
105
104
with:
106
105
(setGroupLog uniqueExercisesInSets asOrderedCollection
107
106
joinUsing: ', ').
108
107
109
Removed:
110
108
isCompletelyLogged ifTrue: [
111
109
self renderSetGroupLogData: setGroupLog on: html ].
112
110
html anchor
@@ -114,51 +112,78 @@
114
112
self call:
115
113
(MFTSetGroupLogEditorComponent forSetGroupLog: setGroupLog) ];
116
114
with: (isCompletelyLogged
117
Removed:
ifTrue: 'Edit'
118
Removed:
ifFalse: 'Log') ] ]
115
Added:
ifTrue: [ 'Edit' ]
116
Added:
ifFalse: [ 'Log' ]) ] ]
119
117
]
120
118
121
119
{ #category : 'as yet unclassified' }
122
120
MFTWorkoutLogEditorComponent >> renderWorkoutLogMetadataOn: html [
123
121
122
Added:
html heading
123
Added:
level: 3;
124
Added:
with: 'Duration'.
124
125
html fieldSet
125
126
class: 'grid';
126
127
with: [
127
128
html legend: 'Start'.
128
Removed:
html dateInput5
129
Removed:
value: Date today yyyymmdd;
130
Removed:
callback: [ :value |
131
Removed:
workoutLog startDate:
132
Removed:
(Date readFrom: value pattern: 'yyyy-mm-dd') ].
133
Removed:
html timeInput5
134
Removed:
value: workoutLog start asTime print24;
135
Removed:
callback: [ :value |
136
Removed:
workoutLog startTime: (Time fromString: value) ].
137
Removed:
html button
138
Removed:
class: 'secondary outline';
139
Removed:
callback: [
140
Removed:
workoutLog startNow.
141
Removed:
workoutLog finish: nil ];
142
Removed:
with: 'Start now' ].
129
Added:
html div: [
130
Added:
html label
131
Added:
for: 'start-date';
132
Added:
with: 'Date'.
133
Added:
html dateInput5
134
Added:
id: 'start-date';
135
Added:
value: Date today yyyymmdd;
136
Added:
callback: [ :value |
137
Added:
workoutLog startDate:
138
Added:
(Date readFrom: value pattern: 'yyyy-mm-dd') ] ].
139
Added:
html div: [
140
Added:
html label
141
Added:
for: 'start-time';
142
Added:
with: 'Time'.
143
Added:
html timeInput5
144
Added:
id: 'start-time';
145
Added:
value: workoutLog start asTime print24;
146
Added:
callback: [ :value |
147
Added:
workoutLog startTime: (Time fromString: value) ] ].
148
Added:
html div
149
Added:
style: 'margin-top: auto';
150
Added:
with: [
151
Added:
html button
152
Added:
class: 'secondary outline';
153
Added:
callback: [
154
Added:
workoutLog startNow.
155
Added:
workoutLog finish: nil ];
156
Added:
with: 'Start now' ] ].
143
157
html fieldSet
144
158
class: 'grid';
145
159
with: [
146
160
html legend: 'Finish'.
147
Removed:
html dateInput5
148
Removed:
value: Date today yyyymmdd;
149
Removed:
callback: [ :value |
150
Removed:
workoutLog finishDate:
151
Removed:
(Date readFrom: value pattern: 'yyyy-mm-dd') ].
152
Removed:
html timeInput5
153
Removed:
value:
154
Removed:
(workoutLog finish ifNotNil: [ workoutLog finish asTime print24 ]);
155
Removed:
callback: [ :value |
156
Removed:
value ifNotEmpty: [
157
Removed:
workoutLog finishTime: (Time fromString: value) ] ].
158
Removed:
html button
159
Removed:
class: 'secondary outline';
160
Removed:
callback: [ workoutLog finishNow ];
161
Removed:
with: 'Finish now' ]
161
Added:
html div: [
162
Added:
html label
163
Added:
for: 'finish-date';
164
Added:
with: 'Date'.
165
Added:
html dateInput5
166
Added:
value: Date today yyyymmdd;
167
Added:
callback: [ :value |
168
Added:
workoutLog finishDate:
169
Added:
(Date readFrom: value pattern: 'yyyy-mm-dd') ] ].
170
Added:
html div: [
171
Added:
html label
172
Added:
for: 'finish-time';
173
Added:
with: 'Time'.
174
Added:
html timeInput5
175
Added:
value:
176
Added:
(workoutLog finish ifNotNil: [ workoutLog finish asTime print24 ]);
177
Added:
callback: [ :value |
178
Added:
value ifNotEmpty: [
179
Added:
workoutLog finishTime: (Time fromString: value) ] ] ].
180
Added:
html div
181
Added:
style: 'margin-top: auto';
182
Added:
with: [
183
Added:
html button
184
Added:
class: 'secondary outline';
185
Added:
callback: [ workoutLog finishNow ];
186
Added:
with: 'Finish now' ] ]
162
187
]
163
188
164
189
{ #category : 'accessing' }
src/MyFitnessTracker-Web/MFTWorkoutLogEditorPage.class.st
@@ -44,6 +44,10 @@
44
44
html heading
45
45
level: 1;
46
46
with: 'Log Workout'.
47
Added:
html heading
48
Added:
level: 2;
49
Added:
with: workoutLog prescription canonicalName.
50
Added:
html horizontalRule.
47
51
html render: workoutLogEditorComponent ]
48
52
]
49
53