Cleanup MFTExercise.

Commit
70c0fb4634838320fe879a84143576a1e81293fd
Author
Marius Peter <marius.peter@tutanota.com>
Author date
Committer
Marius Peter <marius.peter@tutanota.com>
Committer date
Changed files
src/MyFitnessTracker/MFTAboutPage.class.st
index 149efe85..a46cb4a9 100644..100644
@@ -1,17 +1,19 @@
1 1 Class {
2 Removed: #name : #MFTAboutPage,
3 Removed: #superclass : #MFTPage,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTAboutPage',
3 Added: #superclass : 'MFTPage',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #initialization }
9 Added: { #category : 'initialization' }
8 10 MFTAboutPage >> initialize [
9 11
10 12 super initialize.
11 13 title := 'about'
12 14 ]
13 15
14 Removed: { #category : #rendering }
16 Added: { #category : 'rendering' }
15 17 MFTAboutPage >> renderBackgroundOn: html [
16 18
17 19 html heading level1 with: 'Background'.
@@ -34,7 +36,7 @@
34 36 'I am an engineer working in Europe, with a deep passion for health and fitness. Publishing My Fitness Tracker is a way for me to give thanks to everyone who has inspired me throughtout my fitness journey.'
35 37 ]
36 38
37 Removed: { #category : #rendering }
39 Added: { #category : 'rendering' }
38 40 MFTAboutPage >> renderCatchOn: html [
39 41
40 42 html heading level1 dangerText with: 'The catch'.
@@ -62,7 +64,7 @@
62 64 'The paid feature enables me to increase the amount of fitness enthusiasts I can cater to.'
63 65 ]
64 66
65 Removed: { #category : #rendering }
67 Added: { #category : 'rendering' }
66 68 MFTAboutPage >> renderContentOn: html [
67 69
68 70 self renderPageOn: html with: [
@@ -71,7 +73,7 @@
71 73 self renderCatchOn: html ]
72 74 ]
73 75
74 Removed: { #category : #rendering }
76 Added: { #category : 'rendering' }
75 77 MFTAboutPage >> renderVisionOn: html [
76 78
77 79 html heading level1 with: 'The Vision'.
src/MyFitnessTracker/MFTActionsCard.class.st
index 525f4939..57837d27 100644..100644
@@ -1,10 +1,12 @@
1 1 Class {
2 Removed: #name : #MFTActionsCard,
3 Removed: #superclass : #MFTCard,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTActionsCard',
3 Added: #superclass : 'MFTCard',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #rendering }
9 Added: { #category : 'rendering' }
8 10 MFTActionsCard >> renderContentOn: html [
9 11
10 12 self renderCardOn: html with: [
src/MyFitnessTracker/MFTAnalyticsPage.class.st
index 65916218..c806b3f3 100644..100644
@@ -1,13 +1,15 @@
1 1 Class {
2 Removed: #name : #MFTAnalyticsPage,
3 Removed: #superclass : #MFTPage,
2 Added: #name : 'MFTAnalyticsPage',
3 Added: #superclass : 'MFTPage',
4 4 #instVars : [
5 5 'type'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Components'
7 Added: #category : 'MyFitnessTracker-Components',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Components'
8 10 }
9 11
10 Removed: { #category : #'instance creation' }
12 Added: { #category : 'instance creation' }
11 13 MFTAnalyticsPage class >> for: aSymbol [
12 14
13 15 ^ self new
@@ -15,7 +17,7 @@
15 17 yourself
16 18 ]
17 19
18 Removed: { #category : #accessing }
20 Added: { #category : 'accessing' }
19 21 MFTAnalyticsPage >> analytics [
20 22
21 23 ^ Dictionary newFrom: {
@@ -26,7 +28,7 @@
26 28 (#weights -> { MFTWeightVsTimeGraph new }) }
27 29 ]
28 30
29 Removed: { #category : #rendering }
31 Added: { #category : 'rendering' }
30 32 MFTAnalyticsPage >> renderActionsButtonGroupOn: html [
31 33
32 34 html form class: 'my-3'; with: [
@@ -37,7 +39,7 @@
37 39 with: 'Return' ] ]
38 40 ]
39 41
40 Removed: { #category : #rendering }
42 Added: { #category : 'rendering' }
41 43 MFTAnalyticsPage >> renderContentOn: html [
42 44
43 45 | components |
@@ -55,13 +57,13 @@
55 57 html render: each ] ] ] ]
56 58 ]
57 59
58 Removed: { #category : #accessing }
60 Added: { #category : 'accessing' }
59 61 MFTAnalyticsPage >> type [
60 62
61 63 ^ type
62 64 ]
63 65
64 Removed: { #category : #accessing }
66 Added: { #category : 'accessing' }
65 67 MFTAnalyticsPage >> type: anObject [
66 68
67 69 type := anObject
src/MyFitnessTracker/MFTArticle.class.st
index 80c9ca6d..3a67931c 100644..100644
@@ -1,19 +1,21 @@
1 1 Class {
2 Removed: #name : #MFTArticle,
3 Removed: #superclass : #SBSComponent,
2 Added: #name : 'MFTArticle',
3 Added: #superclass : 'SBSComponent',
4 4 #instVars : [
5 5 'title'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Components'
7 Added: #category : 'MyFitnessTracker-Components',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Components'
8 10 }
9 11
10 Removed: { #category : #accessing }
12 Added: { #category : 'accessing' }
11 13 MFTArticle >> title [
12 14
13 15 ^ title
14 16 ]
15 17
16 Removed: { #category : #accessing }
18 Added: { #category : 'accessing' }
17 19 MFTArticle >> title: aString [
18 20
19 21 title := aString
src/MyFitnessTracker/MFTAthlete.class.st
index f5de01a2..f7dbb1ca 100644..100644
@@ -1,6 +1,6 @@
1 1 Class {
2 Removed: #name : #MFTAthlete,
3 Removed: #superclass : #SBSComponent,
2 Added: #name : 'MFTAthlete',
3 Added: #superclass : 'SBSComponent',
4 4 #instVars : [
5 5 'name',
6 6 'nickname',
@@ -9,35 +9,37 @@
9 9 'bio',
10 10 'workouts'
11 11 ],
12 Removed: #category : #'MyFitnessTracker-Model'
12 Added: #category : 'MyFitnessTracker-Model',
13 Added: #package : 'MyFitnessTracker',
14 Added: #tag : 'Model'
13 15 }
14 16
15 Removed: { #category : #'as yet unclassified' }
17 Added: { #category : 'as yet unclassified' }
16 18 MFTAthlete class >> allAthletes [
17 19
18 20 ^ { #'Arnold Alois Schwarzenneger'. #'Michael John Mentzer'.
19 21 #'Thomas Steven Platz' }
20 22 ]
21 23
22 Removed: { #category : #accessing }
24 Added: { #category : 'accessing' }
23 25 MFTAthlete >> bio [
24 26
25 27 ^ bio
26 28 ]
27 29
28 Removed: { #category : #accessing }
30 Added: { #category : 'accessing' }
29 31 MFTAthlete >> born [
30 32
31 33 ^ born
32 34 ]
33 35
34 Removed: { #category : #accessing }
36 Added: { #category : 'accessing' }
35 37 MFTAthlete >> died [
36 38
37 39 ^ died
38 40 ]
39 41
40 Removed: { #category : #initialization }
42 Added: { #category : 'initialization' }
41 43 MFTAthlete >> initialize [
42 44
43 45 super initialize.
@@ -48,19 +50,19 @@
48 50 bio := 'John Default is still today regarded as one of the most default bodybuilders ever.'
49 51 ]
50 52
51 Removed: { #category : #accessing }
53 Added: { #category : 'accessing' }
52 54 MFTAthlete >> name [
53 55
54 56 ^ name
55 57 ]
56 58
57 Removed: { #category : #accessing }
59 Added: { #category : 'accessing' }
58 60 MFTAthlete >> nickname [
59 61
60 62 ^ nickname
61 63 ]
62 64
63 Removed: { #category : #accessing }
65 Added: { #category : 'accessing' }
64 66 MFTAthlete >> prizes [
65 67
66 68 ^ {
@@ -68,7 +70,7 @@
68 70 (MFTPrize year: 1988 competition: 'Default Prize' place: 2) }
69 71 ]
70 72
71 Removed: { #category : #rendering }
73 Added: { #category : 'rendering' }
72 74 MFTAthlete >> renderContentOn: html [
73 75
74 76 html heading level2 with: name.
@@ -89,7 +91,7 @@
89 91 html paragraph: bio
90 92 ]
91 93
92 Removed: { #category : #rendering }
94 Added: { #category : 'rendering' }
93 95 MFTAthlete >> renderPrizesTableOn: html [
94 96
95 97 html table
@@ -110,7 +112,7 @@
110 112 html tableData: prize category ] ] ] ]
111 113 ]
112 114
113 Removed: { #category : #accessing }
115 Added: { #category : 'accessing' }
114 116 MFTAthlete >> workouts [
115 117
116 118 self subclassResponsibility
src/MyFitnessTracker/MFTAthletesArticle.class.st
index 4a48bc53..02da5743 100644..100644
@@ -1,13 +1,15 @@
1 1 Class {
2 Removed: #name : #MFTAthletesArticle,
3 Removed: #superclass : #MFTArticle,
2 Added: #name : 'MFTAthletesArticle',
3 Added: #superclass : 'MFTArticle',
4 4 #instVars : [
5 5 'athletes'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Components'
7 Added: #category : 'MyFitnessTracker-Components',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Components'
8 10 }
9 11
10 Removed: { #category : #initialization }
12 Added: { #category : 'initialization' }
11 13 MFTAthletesArticle >> initialize [
12 14
13 15 super initialize.
@@ -15,7 +17,7 @@
15 17 athletes := { MFTMikeMentzer new}
16 18 ]
17 19
18 Removed: { #category : #rendering }
20 Added: { #category : 'rendering' }
19 21 MFTAthletesArticle >> renderContentOn: html [
20 22
21 23 html heading: title.
src/MyFitnessTracker/MFTCard.class.st
index e4c0e6a5..5aaa8269 100644..100644
@@ -1,16 +1,18 @@
1 1 Class {
2 Removed: #name : #MFTCard,
3 Removed: #superclass : #MFTWidget,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTCard',
3 Added: #superclass : 'MFTWidget',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #rendering }
9 Added: { #category : 'rendering' }
8 10 MFTCard >> renderCardOn: html with: aBlock [
9 11
10 12 html card: aBlock
11 13 ]
12 14
13 Removed: { #category : #rendering }
15 Added: { #category : 'rendering' }
14 16 MFTCard >> renderContentOn: html [
15 17
16 18 self
src/MyFitnessTracker/MFTConfirmDialog.class.st
index 629ac8ce..877618a9 100644..100644
@@ -1,10 +1,12 @@
1 1 Class {
2 Removed: #name : #MFTConfirmDialog,
3 Removed: #superclass : #MFTDialog,
4 Removed: #category : #'MyFitnessTracker-Dialog'
2 Added: #name : 'MFTConfirmDialog',
3 Added: #superclass : 'MFTDialog',
4 Added: #category : 'MyFitnessTracker-Dialog',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Dialog'
5 7 }
6 8
7 Removed: { #category : #'as yet unclassified' }
9 Added: { #category : 'as yet unclassified' }
8 10 MFTConfirmDialog >> heading [
9 11
10 12 ^ 'You are about to {1} a {2}:' format: {
@@ -12,7 +14,7 @@
12 14 component class }
13 15 ]
14 16
15 Removed: { #category : #rendering }
17 Added: { #category : 'rendering' }
16 18 MFTConfirmDialog >> renderContentOn: html [
17 19
18 20 self renderDialogOn: html with: [
src/MyFitnessTracker/MFTDateDialog.class.st
index a05f7316..bc31e935 100644..100644
@@ -1,32 +1,34 @@
1 1 Class {
2 Removed: #name : #MFTDateDialog,
3 Removed: #superclass : #MFTDialog,
2 Added: #name : 'MFTDateDialog',
3 Added: #superclass : 'MFTDialog',
4 4 #instVars : [
5 5 'date'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Dialog'
7 Added: #category : 'MyFitnessTracker-Dialog',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Dialog'
8 10 }
9 11
10 Removed: { #category : #accessing }
12 Added: { #category : 'accessing' }
11 13 MFTDateDialog >> date [
12 14
13 15 ^ date
14 16 ]
15 17
16 Removed: { #category : #accessing }
18 Added: { #category : 'accessing' }
17 19 MFTDateDialog >> date: anObject [
18 20
19 21 date := anObject
20 22 ]
21 23
22 Removed: { #category : #initialization }
24 Added: { #category : 'initialization' }
23 25 MFTDateDialog >> initialize [
24 26
25 27 super initialize.
26 28 date := Date today
27 29 ]
28 30
29 Removed: { #category : #rendering }
31 Added: { #category : 'rendering' }
30 32 MFTDateDialog >> renderContentOn: html [
31 33
32 34 self renderDialogOn: html with: [
@@ -35,7 +37,7 @@
35 37 callback: [ :value | date := Date fromString: value ] ]
36 38 ]
37 39
38 Removed: { #category : #rendering }
40 Added: { #category : 'rendering' }
39 41 MFTDateDialog >> renderSubmitOn: html [
40 42
41 43 html buttonGroup: [
src/MyFitnessTracker/MFTDefaultFooter.class.st
index 576c735d..d372c071 100644..100644
@@ -1,10 +1,12 @@
1 1 Class {
2 Removed: #name : #MFTDefaultFooter,
3 Removed: #superclass : #MFTFooter,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTDefaultFooter',
3 Added: #superclass : 'MFTFooter',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #rendering }
9 Added: { #category : 'rendering' }
8 10 MFTDefaultFooter >> renderContentOn: html [
9 11
10 12 self renderFooterOn: html with: [
@@ -12,7 +14,7 @@
12 14 'Copyright 2023–' , Date today year asString , ' Marius PETER' ]
13 15 ]
14 16
15 Removed: { #category : #rendering }
17 Added: { #category : 'rendering' }
16 18 MFTDefaultFooter >> renderFooterOn: html [
17 19
18 20 html card
src/MyFitnessTracker/MFTDialog.class.st
index f39b68c5..b80c10a0 100644..100644
@@ -1,6 +1,6 @@
1 1 Class {
2 Removed: #name : #MFTDialog,
3 Removed: #superclass : #SBSComponent,
2 Added: #name : 'MFTDialog',
3 Added: #superclass : 'SBSComponent',
4 4 #instVars : [
5 5 'heading',
6 6 'subheading',
@@ -8,10 +8,12 @@
8 8 'action',
9 9 'completion'
10 10 ],
11 Removed: #category : #'MyFitnessTracker-Dialog'
11 Added: #category : 'MyFitnessTracker-Dialog',
12 Added: #package : 'MyFitnessTracker',
13 Added: #tag : 'Dialog'
12 14 }
13 15
14 Removed: { #category : #actions }
16 Added: { #category : 'actions' }
15 17 MFTDialog class >> add: anObject [
16 18
17 19 ^ self new
@@ -20,7 +22,7 @@
20 22 yourself
21 23 ]
22 24
23 Removed: { #category : #actions }
25 Added: { #category : 'actions' }
24 26 MFTDialog class >> delete: anObject [
25 27
26 28 ^ self new
@@ -29,7 +31,7 @@
29 31 yourself
30 32 ]
31 33
32 Removed: { #category : #actions }
34 Added: { #category : 'actions' }
33 35 MFTDialog class >> edit: anObject [
34 36
35 37 ^ self new
@@ -38,49 +40,49 @@
38 40 yourself
39 41 ]
40 42
41 Removed: { #category : #accessing }
43 Added: { #category : 'accessing' }
42 44 MFTDialog >> action [
43 45
44 46 ^ action
45 47 ]
46 48
47 Removed: { #category : #accessing }
49 Added: { #category : 'accessing' }
48 50 MFTDialog >> action: anObject [
49 51
50 52 action := anObject
51 53 ]
52 54
53 Removed: { #category : #delegation }
55 Added: { #category : 'delegation' }
54 56 MFTDialog >> answer [
55 57
56 58 self answer: component
57 59 ]
58 60
59 Removed: { #category : #accessing }
61 Added: { #category : 'accessing' }
60 62 MFTDialog >> completion [
61 63
62 64 ^ completion
63 65 ]
64 66
65 Removed: { #category : #accessing }
67 Added: { #category : 'accessing' }
66 68 MFTDialog >> completion: anObject [
67 69
68 70 completion := anObject
69 71 ]
70 72
71 Removed: { #category : #accessing }
73 Added: { #category : 'accessing' }
72 74 MFTDialog >> component [
73 75
74 76 ^ component
75 77 ]
76 78
77 Removed: { #category : #accessing }
79 Added: { #category : 'accessing' }
78 80 MFTDialog >> component: anObject [
79 81
80 82 component := anObject
81 83 ]
82 84
83 Removed: { #category : #'t - rotating' }
85 Added: { #category : 't - rotating' }
84 86 MFTDialog >> heading [
85 87
86 88 ^ action capitalized , ' ' , (heading ifNil: [
@@ -90,20 +92,20 @@
90 92 'Default Component' ] ])
91 93 ]
92 94
93 Removed: { #category : #accessing }
95 Added: { #category : 'accessing' }
94 96 MFTDialog >> heading: aString [
95 97
96 98 heading := aString
97 99 ]
98 100
99 Removed: { #category : #initialization }
101 Added: { #category : 'initialization' }
100 102 MFTDialog >> initialize [
101 103
102 104 super initialize.
103 105 action := #add
104 106 ]
105 107
106 Removed: { #category : #rendering }
108 Added: { #category : 'rendering' }
107 109 MFTDialog >> renderCompletionOn: html [
108 110
109 111 completion ifNotNil: [
@@ -118,7 +120,7 @@
118 120 with: completion percent ] ]
119 121 ]
120 122
121 Removed: { #category : #rendering }
123 Added: { #category : 'rendering' }
122 124 MFTDialog >> renderContentOn: html [
123 125
124 126 self renderDialogOn: html with: [
@@ -126,7 +128,7 @@
126 128 'By default, ' , self class name , ' doesn''t do anything.' ]
127 129 ]
128 130
129 Removed: { #category : #rendering }
131 Added: { #category : 'rendering' }
130 132 MFTDialog >> renderDialogOn: html with: aBlock [
131 133
132 134 html container
@@ -142,7 +144,7 @@
142 144 self renderCompletionOn: html ]
143 145 ]
144 146
145 Removed: { #category : #rendering }
147 Added: { #category : 'rendering' }
146 148 MFTDialog >> renderSubmitOn: html [
147 149
148 150 html buttonGroup: [
@@ -159,13 +161,13 @@
159 161 with: (completion ifNil: [ 'Cancel' ] ifNotNil: [ 'Skip' ]) ]
160 162 ]
161 163
162 Removed: { #category : #accessing }
164 Added: { #category : 'accessing' }
163 165 MFTDialog >> subheading [
164 166
165 167 ^ subheading
166 168 ]
167 169
168 Removed: { #category : #accessing }
170 Added: { #category : 'accessing' }
169 171 MFTDialog >> subheading: aString [
170 172
171 173 subheading := aString
src/MyFitnessTracker/MFTDietArticle.class.st
index 62009084..f1b9ec41 100644..100644
@@ -1,5 +1,7 @@
1 1 Class {
2 Removed: #name : #MFTDietArticle,
3 Removed: #superclass : #MFTArticle,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTDietArticle',
3 Added: #superclass : 'MFTArticle',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
src/MyFitnessTracker/MFTEmailSignupDialog.class.st
index 4842540f..e34a11ad 100644..100644
@@ -1,14 +1,16 @@
1 1 Class {
2 Removed: #name : #MFTEmailSignupDialog,
3 Removed: #superclass : #SBSComponent,
2 Added: #name : 'MFTEmailSignupDialog',
3 Added: #superclass : 'SBSComponent',
4 4 #instVars : [
5 5 'localPart',
6 6 'domain'
7 7 ],
8 Removed: #category : #'MyFitnessTracker-Dialog'
8 Added: #category : 'MyFitnessTracker-Dialog',
9 Added: #package : 'MyFitnessTracker',
10 Added: #tag : 'Dialog'
9 11 }
10 12
11 Removed: { #category : #initialization }
13 Added: { #category : 'initialization' }
12 14 MFTEmailSignupDialog >> initialize [
13 15
14 16 super initialize.
@@ -16,7 +18,7 @@
16 18 domain := String new
17 19 ]
18 20
19 Removed: { #category : #rendering }
21 Added: { #category : 'rendering' }
20 22 MFTEmailSignupDialog >> renderContentOn: html [
21 23
22 24 html div
src/MyFitnessTracker/MFTExercise.class.st
index 6460ef13..dfe778d9 100644..100644
@@ -31,125 +31,20 @@
31 31 Implementation Points
32 32 "
33 33 Class {
34 Removed: #name : #MFTExercise,
35 Removed: #superclass : #Object,
34 Added: #name : 'MFTExercise',
35 Added: #superclass : 'Object',
36 36 #instVars : [
37 37 'id',
38 38 'primaryMuscleGroupId',
39 39 'englishName',
40 40 'frenchName'
41 41 ],
42 Removed: #category : #'MyFitnessTracker-Model'
42 Added: #category : 'MyFitnessTracker-Model',
43 Added: #package : 'MyFitnessTracker',
44 Added: #tag : 'Model'
43 45 }
44 46
45 Removed: { #category : #exercise }
46 Removed: MFTExercise class >> benchPress [
47 Removed:
48 Removed: ^ self newWithEnglishName
49 Removed: primaryMuscle: MFTMuscle pectoralisMajor;
50 Removed: secondaryMuscles: {
51 Removed: MFTMuscle tricepsBrachii.
52 Removed: MFTMuscleGroup shoulder };
53 Removed: yourself
54 Removed: ]
55 Removed:
56 Removed: { #category : #exercise }
57 Removed: MFTExercise class >> bicepCurl [
58 Removed:
59 Removed: ^ self newWithEnglishName
60 Removed: primaryMuscle: MFTMuscle bicepsBrachii;
61 Removed: secondaryMuscles: { MFTMuscleGroup forearm };
62 Removed: yourself
63 Removed: ]
64 Removed:
65 Removed: { #category : #exercise }
66 Removed: MFTExercise class >> cableRow [
67 Removed:
68 Removed: ^ self newWithEnglishName
69 Removed: primaryMuscle: MFTMuscleGroup back;
70 Removed: secondaryMuscles: { MFTMuscle bicepsBrachii };
71 Removed: yourself
72 Removed: ]
73 Removed:
74 Removed: { #category : #exercise }
75 Removed: MFTExercise class >> cleanAndJerk [
76 Removed:
77 Removed: ^ self newWithEnglishName
78 Removed: primaryMuscle: MFTMuscle quadricepsFemoris;
79 Removed: secondaryMuscles: {
80 Removed: MFTMuscleGroup shoulder.
81 Removed: MFTMuscle trapezius };
82 Removed: yourself
83 Removed: ]
84 Removed:
85 Removed: { #category : #exercise }
86 Removed: MFTExercise class >> deadlift [
87 Removed:
88 Removed: ^ self newWithEnglishName
89 Removed: primaryMuscle: MFTMuscle hamstring;
90 Removed: secondaryMuscles: {
91 Removed: MFTMuscleGroup back.
92 Removed: MFTMuscleGroup hip };
93 Removed: yourself
94 Removed: ]
95 Removed:
96 Removed: { #category : #exercise }
97 Removed: MFTExercise class >> declineBenchPress [
98 Removed:
99 Removed: ^ self newWithEnglishName
100 Removed: primaryMuscle: MFTMuscleGroup chest;
101 Removed: secondaryMuscles: { MFTMuscle tricepsBrachii };
102 Removed: yourself
103 Removed: ]
104 Removed:
105 Removed: { #category : #exercise }
106 Removed: MFTExercise class >> gobletSquat [
107 Removed:
108 Removed: ^ self newWithEnglishName
109 Removed: primaryMuscle: MFTMuscleGroup leg;
110 Removed: secondaryMuscles: {
111 Removed: MFTMuscleGroup abdominal.
112 Removed: MFTMuscleGroup back };
113 Removed: yourself
114 Removed: ]
115 Removed:
116 Removed: { #category : #exercise }
117 Removed: MFTExercise class >> hammerCurl [
118 Removed:
119 Removed: ^ self newWithEnglishName
120 Removed: primaryMuscle: MFTMuscle bicepsBrachii;
121 Removed: secondaryMuscles: { MFTMuscleGroup forearm };
122 Removed: yourself
123 Removed: ]
124 Removed:
125 Removed: { #category : #exercise }
126 Removed: MFTExercise class >> latPulldown [
127 Removed:
128 Removed: ^ self newWithEnglishName
129 Removed: primaryMuscle: MFTMuscle latissimusDorsi;
130 Removed: secondaryMuscles: {
131 Removed: MFTMuscle bicepsBrachii.
132 Removed: MFTMuscleGroup shoulder };
133 Removed: yourself
134 Removed: ]
135 Removed:
136 Removed: { #category : #exercise }
137 Removed: MFTExercise class >> legCurl [
138 Removed:
139 Removed: ^ self newWithEnglishName
140 Removed: primaryMuscle: MFTMuscleGroup leg;
141 Removed: yourself
142 Removed: ]
143 Removed:
144 Removed: { #category : #exercise }
145 Removed: MFTExercise class >> legExtension [
146 Removed:
147 Removed: ^ self newWithEnglishName
148 Removed: primaryMuscle: MFTMuscleGroup leg;
149 Removed: yourself
150 Removed: ]
151 Removed:
152 Removed: { #category : #'instance creation' }
47 Added: { #category : 'instance creation' }
153 48 MFTExercise class >> newFromDictionary: aDictionary [
154 49
155 50 ^ self new
@@ -160,149 +55,64 @@
160 55 yourself
161 56 ]
162 57
163 Removed: { #category : #'instance creation' }
164 Removed: MFTExercise class >> newWithEnglishName [
165 Removed: "I return a MFTExercise instance for which englishName is set to the calling method selector, as a space-separated string."
166 Removed:
167 Removed: | senderSelector exerciseNameFromSender |
168 Removed: senderSelector := thisContext sender selector.
169 Removed: exerciseNameFromSender := (thisContext sender selector splitCamelCase
170 Removed: collect: #asLowercase) joinUsing:
171 Removed: Character space.
172 Removed: ^ self new
173 Removed: canonicalName: senderSelector;
174 Removed: englishName: exerciseNameFromSender;
175 Removed: yourself
176 Removed: ]
177 Removed:
178 Removed: { #category : #exercise }
179 Removed: MFTExercise class >> pullUp [
180 Removed:
181 Removed: ^ self newWithEnglishName
182 Removed: primaryMuscle: MFTMuscleGroup back;
183 Removed: secondaryMuscles: { MFTMuscle bicepsBrachii };
184 Removed: yourself
185 Removed: ]
186 Removed:
187 Removed: { #category : #'instance creation' }
188 Removed: MFTExercise class >> sets: aMFTSetCollection [
189 Removed:
190 Removed: ^ self new
191 Removed: sets: aMFTSetCollection;
192 Removed: yourself
193 Removed: ]
194 Removed:
195 Removed: { #category : #exercise }
196 Removed: MFTExercise class >> shoulderPressDumbell [
197 Removed:
198 Removed: ^ self newWithEnglishName
199 Removed: englishName: 'shoulder press (dumbell)';
200 Removed: primaryMuscle: MFTMuscle deltoidAnterior;
201 Removed: secondaryMuscles: { MFTMuscle deltoidMedial };
202 Removed: yourself
203 Removed: ]
204 Removed:
205 Removed: { #category : #exercise }
206 Removed: MFTExercise class >> snatch [
207 Removed:
208 Removed: ^ self newWithEnglishName
209 Removed: primaryMuscle: MFTMuscle quadricepsFemoris;
210 Removed: secondaryMuscles: {
211 Removed: MFTMuscleGroup shoulder.
212 Removed: MFTMuscle trapezius };
213 Removed: yourself
214 Removed: ]
215 Removed:
216 Removed: { #category : #exercise }
217 Removed: MFTExercise class >> squat [
218 Removed:
219 Removed: ^ self newWithEnglishName
220 Removed: primaryMuscle: MFTMuscleGroup leg;
221 Removed: secondaryMuscles: {
222 Removed: MFTMuscleGroup abdominal.
223 Removed: MFTMuscleGroup back };
224 Removed: yourself
225 Removed: ]
226 Removed:
227 Removed: { #category : #exercise }
228 Removed: MFTExercise class >> tricepExtension [
229 Removed:
230 Removed: ^ self newWithEnglishName
231 Removed: primaryMuscle: MFTMuscle tricepsBrachii;
232 Removed: secondaryMuscles: { };
233 Removed: yourself
234 Removed: ]
235 Removed:
236 Removed: { #category : #accessing }
58 Added: { #category : 'accessing' }
237 59 MFTExercise >> englishName [
238 60
239 61 ^ englishName
240 62 ]
241 63
242 Removed: { #category : #accessing }
64 Added: { #category : 'accessing' }
243 65 MFTExercise >> englishName: aString [
244 66
245 67 englishName := aString
246 68 ]
247 69
248 Removed: { #category : #accessing }
70 Added: { #category : 'accessing' }
249 71 MFTExercise >> frenchName [
250 72
251 73 ^ frenchName
252 74 ]
253 75
254 Removed: { #category : #accessing }
76 Added: { #category : 'accessing' }
255 77 MFTExercise >> frenchName: anObject [
256 78
257 79 frenchName := anObject
258 80 ]
259 81
260 Removed: { #category : #accessing }
82 Added: { #category : 'accessing' }
261 83 MFTExercise >> id [
262 84
263 85 ^ id
264 86 ]
265 87
266 Removed: { #category : #accessing }
88 Added: { #category : 'accessing' }
267 89 MFTExercise >> id: anObject [
268 90
269 91 id := anObject
270 92 ]
271 93
272 Removed: { #category : #initialization }
94 Added: { #category : 'initialization' }
273 95 MFTExercise >> initialize [
274 96
275 97 super initialize.
276 98 englishName := String new
277 99 ]
278 100
279 Removed: { #category : #accessing }
101 Added: { #category : 'accessing' }
280 102 MFTExercise >> primaryMuscleGroup [
281 103
282 104 ^ MFTSQLite3Database allMuscleGroups detect: [ :group |
283 105 group id = primaryMuscleGroupId ]
284 106 ]
285 107
286 Removed: { #category : #accessing }
108 Added: { #category : 'accessing' }
287 109 MFTExercise >> primaryMuscleGroupId [
288 110
289 111 ^ primaryMuscleGroupId
290 112 ]
291 113
292 Removed: { #category : #accessing }
114 Added: { #category : 'accessing' }
293 115 MFTExercise >> primaryMuscleGroupId: anObject [
294 116
295 117 primaryMuscleGroupId := anObject
296 Removed: ]
297 Removed:
298 Removed: { #category : #'as yet unclassified' }
299 Removed: MFTExercise >> repsBySet [
300 Removed:
301 Removed: ^ (sets collect: #reps) ifEmpty: [ Array with: 0 ]
302 Removed: ]
303 Removed:
304 Removed: { #category : #'as yet unclassified' }
305 Removed: MFTExercise >> volume [
306 Removed:
307 Removed: ^ sets ifNotEmpty: [ (sets collect: #volume) sum ] ifEmpty: 0
308 118 ]
src/MyFitnessTracker/MFTFooter.class.st
index dc6c132b..3c8edfc3 100644..100644
@@ -1,10 +1,12 @@
1 1 Class {
2 Removed: #name : #MFTFooter,
3 Removed: #superclass : #SBSComponent,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTFooter',
3 Added: #superclass : 'SBSComponent',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #rendering }
9 Added: { #category : 'rendering' }
8 10 MFTFooter >> renderContentOn: html [
9 11
10 12 self
@@ -12,7 +14,7 @@
12 14 with: [ html text: 'I am the default footer' ]
13 15 ]
14 16
15 Removed: { #category : #rendering }
17 Added: { #category : 'rendering' }
16 18 MFTFooter >> renderFooterOn: html with: aBlock [
17 19
18 20 html div
src/MyFitnessTracker/MFTGraph.class.st
index 5d1e0371..1cc0ec4e 100644..100644
@@ -1,26 +1,28 @@
1 1 Class {
2 Removed: #name : #MFTGraph,
3 Removed: #superclass : #MFTWidget,
2 Added: #name : 'MFTGraph',
3 Added: #superclass : 'MFTWidget',
4 4 #instVars : [
5 5 'labels',
6 6 'data'
7 7 ],
8 Removed: #category : #'MyFitnessTracker-Components'
8 Added: #category : 'MyFitnessTracker-Components',
9 Added: #package : 'MyFitnessTracker',
10 Added: #tag : 'Components'
9 11 }
10 12
11 Removed: { #category : #accessing }
13 Added: { #category : 'accessing' }
12 14 MFTGraph >> data [
13 15
14 16 ^ data
15 17 ]
16 18
17 Removed: { #category : #accessing }
19 Added: { #category : 'accessing' }
18 20 MFTGraph >> data: anObject [
19 21
20 22 data := anObject
21 23 ]
22 24
23 Removed: { #category : #initialization }
25 Added: { #category : 'initialization' }
24 26 MFTGraph >> initialize [
25 27
26 28 super initialize.
@@ -28,19 +30,19 @@
28 30 data := #( 5 1 6 2 7 )
29 31 ]
30 32
31 Removed: { #category : #accessing }
33 Added: { #category : 'accessing' }
32 34 MFTGraph >> labels [
33 35
34 36 ^ labels
35 37 ]
36 38
37 Removed: { #category : #accessing }
39 Added: { #category : 'accessing' }
38 40 MFTGraph >> labels: anObject [
39 41
40 42 labels := anObject
41 43 ]
42 44
43 Removed: { #category : #rendering }
45 Added: { #category : 'rendering' }
44 46 MFTGraph >> renderContentOn: html [
45 47
46 48 html heading level5 with: self defaultDescription.
@@ -60,7 +62,7 @@
60 62 });'
61 63 ]
62 64
63 Removed: { #category : #accessing }
65 Added: { #category : 'accessing' }
64 66 MFTGraph >> title [
65 67
66 68 ^ ('^MFT(.*)Graph$' asRegex
src/MyFitnessTracker/MFTHeaderComponent.class.st
index a3c860d5..166ad8a5 100644..100644
@@ -1,5 +1,7 @@
1 1 Class {
2 Removed: #name : #MFTHeaderComponent,
3 Removed: #superclass : #SBSComponent,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTHeaderComponent',
3 Added: #superclass : 'SBSComponent',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
src/MyFitnessTracker/MFTLandingPage.class.st
index 5f80f393..d5ca9f4c 100644..100644
@@ -1,31 +1,33 @@
1 1 Class {
2 Removed: #name : #MFTLandingPage,
3 Removed: #superclass : #MFTPage,
2 Added: #name : 'MFTLandingPage',
3 Added: #superclass : 'MFTPage',
4 4 #instVars : [
5 5 'cards'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Components'
7 Added: #category : 'MyFitnessTracker-Components',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Components'
8 10 }
9 11
10 Removed: { #category : #accessing }
12 Added: { #category : 'accessing' }
11 13 MFTLandingPage >> cards [
12 14
13 15 ^ cards
14 16 ]
15 17
16 Removed: { #category : #accessing }
18 Added: { #category : 'accessing' }
17 19 MFTLandingPage >> cards: aMFTCardCollection [
18 20
19 21 cards := aMFTCardCollection
20 22 ]
21 23
22 Removed: { #category : #hooks }
24 Added: { #category : 'hooks' }
23 25 MFTLandingPage >> children [
24 26
25 27 ^ cards
26 28 ]
27 29
28 Removed: { #category : #'as yet unclassified' }
30 Added: { #category : 'as yet unclassified' }
29 31 MFTLandingPage >> defaultCards [
30 32
31 33 ^ {
@@ -34,7 +36,7 @@
34 36 MFTCard new }
35 37 ]
36 38
37 Removed: { #category : #'as yet unclassified' }
39 Added: { #category : 'as yet unclassified' }
38 40 MFTLandingPage >> initialize [
39 41
40 42 super initialize.
@@ -42,7 +44,7 @@
42 44 cards := self defaultCards
43 45 ]
44 46
45 Removed: { #category : #rendering }
47 Added: { #category : 'rendering' }
46 48 MFTLandingPage >> renderContentOn: html [
47 49
48 50 self renderPageOn: html with: [
src/MyFitnessTracker/MFTLearnPage.class.st
index 5d7f5a33..ae6db2c4 100644..100644
@@ -1,14 +1,16 @@
1 1 Class {
2 Removed: #name : #MFTLearnPage,
3 Removed: #superclass : #MFTPage,
2 Added: #name : 'MFTLearnPage',
3 Added: #superclass : 'MFTPage',
4 4 #instVars : [
5 5 'articles',
6 6 'activeArticle'
7 7 ],
8 Removed: #category : #'MyFitnessTracker-Components'
8 Added: #category : 'MyFitnessTracker-Components',
9 Added: #package : 'MyFitnessTracker',
10 Added: #tag : 'Components'
9 11 }
10 12
11 Removed: { #category : #initialization }
13 Added: { #category : 'initialization' }
12 14 MFTLearnPage >> initialize [
13 15
14 16 super initialize.
@@ -19,7 +21,7 @@
19 21 activeArticle := articles first
20 22 ]
21 23
22 Removed: { #category : #rendering }
24 Added: { #category : 'rendering' }
23 25 MFTLearnPage >> renderContentOn: html [
24 26
25 27 self renderPageOn: html with: [
src/MyFitnessTracker/MFTLoginRegisterLogoutComponent.class.st
index db1318aa..5b60fe29 100644..100644
@@ -1,13 +1,15 @@
1 1 Class {
2 Removed: #name : #MFTLoginRegisterLogoutComponent,
3 Removed: #superclass : #SBSComponent,
2 Added: #name : 'MFTLoginRegisterLogoutComponent',
3 Added: #superclass : 'SBSComponent',
4 4 #instVars : [
5 5 'user'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Components'
7 Added: #category : 'MyFitnessTracker-Components',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Components'
8 10 }
9 11
10 Removed: { #category : #'as yet unclassified' }
12 Added: { #category : 'as yet unclassified' }
11 13 MFTLoginRegisterLogoutComponent >> attemptLogin: aMFTUser [
12 14 "Attempt to match aMFTUser passwordHash against an existing user password_hash in the database."
13 15
@@ -20,20 +22,20 @@
20 22 ifFalse: [ self inform: 'Login failed' ]
21 23 ]
22 24
23 Removed: { #category : #initialization }
25 Added: { #category : 'initialization' }
24 26 MFTLoginRegisterLogoutComponent >> initialize [
25 27
26 28 super initialize.
27 29 user := MFTUser new
28 30 ]
29 31
30 Removed: { #category : #'as yet unclassified' }
32 Added: { #category : 'as yet unclassified' }
31 33 MFTLoginRegisterLogoutComponent >> logout [
32 34
33 35 self session logout
34 36 ]
35 37
36 Removed: { #category : #rendering }
38 Added: { #category : 'rendering' }
37 39 MFTLoginRegisterLogoutComponent >> renderContentOn: html [
38 40
39 41 self session user isLoggedIn
@@ -41,7 +43,7 @@
41 43 ifTrue: [ self renderLogoutButtonOn: html ]
42 44 ]
43 45
44 Removed: { #category : #rendering }
46 Added: { #category : 'rendering' }
45 47 MFTLoginRegisterLogoutComponent >> renderLoginAndRegisterModalsOn: html [
46 48 "Logging in and registering display modal components; they are not in a form."
47 49
@@ -62,7 +64,7 @@
62 64 self renderRegisterModalOn: html
63 65 ]
64 66
65 Removed: { #category : #rendering }
67 Added: { #category : 'rendering' }
66 68 MFTLoginRegisterLogoutComponent >> renderLoginModalOn: html [
67 69
68 70 html modal
@@ -100,7 +102,7 @@
100 102 with: 'Cancel' ] ] ] ] ] ]
101 103 ]
102 104
103 Removed: { #category : #rendering }
105 Added: { #category : 'rendering' }
104 106 MFTLoginRegisterLogoutComponent >> renderLogoutButtonOn: html [
105 107 "Logging out is an action; the button is in a form."
106 108
@@ -112,7 +114,7 @@
112 114 with: 'Logout' ]
113 115 ]
114 116
115 Removed: { #category : #rendering }
117 Added: { #category : 'rendering' }
116 118 MFTLoginRegisterLogoutComponent >> renderRegisterModalOn: html [
117 119
118 120 html modal
src/MyFitnessTracker/MFTMainNavigationBarComponent.class.st
index 88f24dec..2cf415a3 100644..100644
@@ -1,26 +1,28 @@
1 1 Class {
2 Removed: #name : #MFTMainNavigationBarComponent,
3 Removed: #superclass : #SBSComponent,
2 Added: #name : 'MFTMainNavigationBarComponent',
3 Added: #superclass : 'SBSComponent',
4 4 #instVars : [
5 5 'loginRegisterLogout'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Components'
7 Added: #category : 'MyFitnessTracker-Components',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Components'
8 10 }
9 11
10 Removed: { #category : #hooks }
12 Added: { #category : 'hooks' }
11 13 MFTMainNavigationBarComponent >> children [
12 14
13 15 ^ { loginRegisterLogout }
14 16 ]
15 17
16 Removed: { #category : #initialization }
18 Added: { #category : 'initialization' }
17 19 MFTMainNavigationBarComponent >> initialize [
18 20
19 21 super initialize.
20 22 loginRegisterLogout := MFTLoginRegisterLogoutComponent new
21 23 ]
22 24
23 Removed: { #category : #rendering }
25 Added: { #category : 'rendering' }
24 26 MFTMainNavigationBarComponent >> renderContentOn: html [
25 27
26 28 html navigationBar
@@ -33,7 +35,7 @@
33 35 with: [ self renderNavigationBarItemsOn: html ]
34 36 ]
35 37
36 Removed: { #category : #rendering }
38 Added: { #category : 'rendering' }
37 39 MFTMainNavigationBarComponent >> renderNavigationBarItemsOn: html [
38 40
39 41 | pm |
src/MyFitnessTracker/MFTMainPublicCard.class.st
index 79731258..2642a6e6 100644..100644
@@ -1,10 +1,12 @@
1 1 Class {
2 Removed: #name : #MFTMainPublicCard,
3 Removed: #superclass : #MFTCard,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTMainPublicCard',
3 Added: #superclass : 'MFTCard',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #adding }
9 Added: { #category : 'adding' }
8 10 MFTMainPublicCard >> addWorkout [
9 11
10 12 | newWorkout |
@@ -17,7 +19,7 @@
17 19 ifFalse: [ self session user workouts add: newWorkout ]
18 20 ]
19 21
20 Removed: { #category : #rendering }
22 Added: { #category : 'rendering' }
21 23 MFTMainPublicCard >> renderContentOn: html [
22 24
23 25 self renderCardOn: html with: [
src/MyFitnessTracker/MFTMainUserCard.class.st
index 0b14af28..78e58fb9 100644..100644
@@ -1,14 +1,16 @@
1 1 Class {
2 Removed: #name : #MFTMainUserCard,
3 Removed: #superclass : #MFTCard,
2 Added: #name : 'MFTMainUserCard',
3 Added: #superclass : 'MFTCard',
4 4 #instVars : [
5 5 'lastLoginDate',
6 6 'subtitle'
7 7 ],
8 Removed: #category : #'MyFitnessTracker-Components'
8 Added: #category : 'MyFitnessTracker-Components',
9 Added: #package : 'MyFitnessTracker',
10 Added: #tag : 'Components'
9 11 }
10 12
11 Removed: { #category : #initialization }
13 Added: { #category : 'initialization' }
12 14 MFTMainUserCard >> initialize [
13 15
14 16 super initialize.
@@ -19,7 +21,7 @@
19 21 lastLoginDate asTimeUTC asString }
20 22 ]
21 23
22 Removed: { #category : #rendering }
24 Added: { #category : 'rendering' }
23 25 MFTMainUserCard >> renderContentOn: html [
24 26
25 27 | user |
src/MyFitnessTracker/MFTMikeMentzer.class.st
index e5596340..9a720e84 100644..100644
@@ -1,10 +1,12 @@
1 1 Class {
2 Removed: #name : #MFTMikeMentzer,
3 Removed: #superclass : #MFTAthlete,
4 Removed: #category : #'MyFitnessTracker-Model'
2 Added: #name : 'MFTMikeMentzer',
3 Added: #superclass : 'MFTAthlete',
4 Added: #category : 'MyFitnessTracker-Model',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Model'
5 7 }
6 8
7 Removed: { #category : #initialization }
9 Added: { #category : 'initialization' }
8 10 MFTMikeMentzer >> initialize [
9 11
10 12 super initialize.
@@ -15,7 +17,7 @@
15 17 bio := 'Mike Mentzer is most famous for his Heavy Duty training regimen.'
16 18 ]
17 19
18 Removed: { #category : #accessing }
20 Added: { #category : 'accessing' }
19 21 MFTMikeMentzer >> prizes [
20 22
21 23 ^ {
src/MyFitnessTracker/MFTMuscle.class.st
index f7721b4c..7db82229 100644..100644
@@ -1,6 +1,6 @@
1 1 Class {
2 Removed: #name : #MFTMuscle,
3 Removed: #superclass : #Object,
2 Added: #name : 'MFTMuscle',
3 Added: #superclass : 'Object',
4 4 #instVars : [
5 5 'id',
6 6 'primaryMuscleGroupId',
@@ -8,10 +8,12 @@
8 8 'englishName',
9 9 'function'
10 10 ],
11 Removed: #category : #'MyFitnessTracker-Model'
11 Added: #category : 'MyFitnessTracker-Model',
12 Added: #package : 'MyFitnessTracker',
13 Added: #tag : 'Model'
12 14 }
13 15
14 Removed: { #category : #'instance creation' }
16 Added: { #category : 'instance creation' }
15 17 MFTMuscle class >> newFromDictionary: aDictionary [
16 18
17 19 ^ self new
@@ -23,74 +25,74 @@
23 25 yourself
24 26 ]
25 27
26 Removed: { #category : #accessing }
28 Added: { #category : 'accessing' }
27 29 MFTMuscle >> englishName [
28 30
29 31 ^ englishName
30 32 ]
31 33
32 Removed: { #category : #accessing }
34 Added: { #category : 'accessing' }
33 35 MFTMuscle >> englishName: aString [
34 36
35 37 englishName := aString
36 38 ]
37 39
38 Removed: { #category : #accessing }
40 Added: { #category : 'accessing' }
39 41 MFTMuscle >> function [
40 42
41 43 ^ function
42 44 ]
43 45
44 Removed: { #category : #accessing }
46 Added: { #category : 'accessing' }
45 47 MFTMuscle >> function: anObject [
46 48
47 49 function := anObject
48 50 ]
49 51
50 Removed: { #category : #accessing }
52 Added: { #category : 'accessing' }
51 53 MFTMuscle >> id [
52 54
53 55 ^ id
54 56 ]
55 57
56 Removed: { #category : #accessing }
58 Added: { #category : 'accessing' }
57 59 MFTMuscle >> id: anObject [
58 60
59 61 id := anObject
60 62 ]
61 63
62 Removed: { #category : #accessing }
64 Added: { #category : 'accessing' }
63 65 MFTMuscle >> latinName [
64 66
65 67 ^ latinName
66 68 ]
67 69
68 Removed: { #category : #accessing }
70 Added: { #category : 'accessing' }
69 71 MFTMuscle >> latinName: aString [
70 72
71 73 latinName := aString
72 74 ]
73 75
74 Removed: { #category : #accessing }
76 Added: { #category : 'accessing' }
75 77 MFTMuscle >> linkTerminologiaAnatomica [
76 78
77 79 ^ 'http://terminologia-anatomica.org/en/Search?query=musculus {1}'
78 80 format: { latinName }
79 81 ]
80 82
81 Removed: { #category : #accessing }
83 Added: { #category : 'accessing' }
82 84 MFTMuscle >> primaryMuscleGroupId [
83 85
84 86 ^ primaryMuscleGroupId
85 87 ]
86 88
87 Removed: { #category : #accessing }
89 Added: { #category : 'accessing' }
88 90 MFTMuscle >> primaryMuscleGroupId: anObject [
89 91
90 92 primaryMuscleGroupId := anObject
91 93 ]
92 94
93 Removed: { #category : #rendering }
95 Added: { #category : 'rendering' }
94 96 MFTMuscle >> renderContentOn: html [
95 97
96 98 html table
src/MyFitnessTracker/MFTMuscleGroup.class.st
index fb0cbdae..c3fd89a5 100644..100644
@@ -1,6 +1,6 @@
1 1 Class {
2 Removed: #name : #MFTMuscleGroup,
3 Removed: #superclass : #SBSComponent,
2 Added: #name : 'MFTMuscleGroup',
3 Added: #superclass : 'SBSComponent',
4 4 #instVars : [
5 5 'id',
6 6 'englishName',
@@ -8,10 +8,12 @@
8 8 'function',
9 9 'muscles'
10 10 ],
11 Removed: #category : #'MyFitnessTracker-Model'
11 Added: #category : 'MyFitnessTracker-Model',
12 Added: #package : 'MyFitnessTracker',
13 Added: #tag : 'Model'
12 14 }
13 15
14 Removed: { #category : #'as yet unclassified' }
16 Added: { #category : 'as yet unclassified' }
15 17 MFTMuscleGroup class >> antagonistIds [
16 18 "TODO: is this sufficiently robust ?"
17 19
@@ -23,7 +25,7 @@
23 25 { 12. 13 } asSet }
24 26 ]
25 27
26 Removed: { #category : #'instance creation' }
28 Added: { #category : 'instance creation' }
27 29 MFTMuscleGroup class >> newFromDictionary: aDictionary [
28 30
29 31 | id |
@@ -39,55 +41,55 @@
39 41 yourself
40 42 ]
41 43
42 Removed: { #category : #accessing }
44 Added: { #category : 'accessing' }
43 45 MFTMuscleGroup >> englishName [
44 46
45 47 ^ englishName
46 48 ]
47 49
48 Removed: { #category : #accessing }
50 Added: { #category : 'accessing' }
49 51 MFTMuscleGroup >> englishName: aString [
50 52
51 53 englishName := aString
52 54 ]
53 55
54 Removed: { #category : #accessing }
56 Added: { #category : 'accessing' }
55 57 MFTMuscleGroup >> frenchName [
56 58
57 59 ^ frenchName
58 60 ]
59 61
60 Removed: { #category : #accessing }
62 Added: { #category : 'accessing' }
61 63 MFTMuscleGroup >> frenchName: anObject [
62 64
63 65 frenchName := anObject
64 66 ]
65 67
66 Removed: { #category : #accessing }
68 Added: { #category : 'accessing' }
67 69 MFTMuscleGroup >> function [
68 70
69 71 ^ function
70 72 ]
71 73
72 Removed: { #category : #accessing }
74 Added: { #category : 'accessing' }
73 75 MFTMuscleGroup >> function: anObject [
74 76
75 77 function := anObject
76 78 ]
77 79
78 Removed: { #category : #accessing }
80 Added: { #category : 'accessing' }
79 81 MFTMuscleGroup >> id [
80 82
81 83 ^ id
82 84 ]
83 85
84 Removed: { #category : #accessing }
86 Added: { #category : 'accessing' }
85 87 MFTMuscleGroup >> id: anObject [
86 88
87 89 id := anObject
88 90 ]
89 91
90 Removed: { #category : #initialization }
92 Added: { #category : 'initialization' }
91 93 MFTMuscleGroup >> initialize [
92 94
93 95 super initialize.
@@ -97,19 +99,19 @@
97 99 muscles := OrderedCollection new
98 100 ]
99 101
100 Removed: { #category : #accessing }
102 Added: { #category : 'accessing' }
101 103 MFTMuscleGroup >> muscles [
102 104
103 105 ^ muscles
104 106 ]
105 107
106 Removed: { #category : #accessing }
108 Added: { #category : 'accessing' }
107 109 MFTMuscleGroup >> muscles: anObject [
108 110
109 111 muscles := anObject
110 112 ]
111 113
112 Removed: { #category : #rendering }
114 Added: { #category : 'rendering' }
113 115 MFTMuscleGroup >> renderContentOn: html [
114 116
115 117 html heading level2 with: englishName capitalized.
src/MyFitnessTracker/MFTMusclesArticle.class.st
index ef493044..b45a4819 100644..100644
@@ -1,19 +1,21 @@
1 1 Class {
2 Removed: #name : #MFTMusclesArticle,
3 Removed: #superclass : #MFTArticle,
2 Added: #name : 'MFTMusclesArticle',
3 Added: #superclass : 'MFTArticle',
4 4 #instVars : [
5 5 'muscleGroups'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Components'
7 Added: #category : 'MyFitnessTracker-Components',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Components'
8 10 }
9 11
10 Removed: { #category : #hooks }
12 Added: { #category : 'hooks' }
11 13 MFTMusclesArticle >> children [
12 14
13 15 ^ muscleGroups
14 16 ]
15 17
16 Removed: { #category : #initialization }
18 Added: { #category : 'initialization' }
17 19 MFTMusclesArticle >> initialize [
18 20
19 21 | methods instances |
@@ -26,7 +28,7 @@
26 28 muscleGroups := instances sorted: [ :a :b | a englishName < b englishName ]
27 29 ]
28 30
29 Removed: { #category : #rendering }
31 Added: { #category : 'rendering' }
30 32 MFTMusclesArticle >> renderContentOn: html [
31 33
32 34 html heading: title.
src/MyFitnessTracker/MFTPage.class.st
index d4b7c588..ddecdb8e 100644..100644
@@ -1,13 +1,15 @@
1 1 Class {
2 Removed: #name : #MFTPage,
3 Removed: #superclass : #SBSComponent,
2 Added: #name : 'MFTPage',
3 Added: #superclass : 'SBSComponent',
4 4 #instVars : [
5 5 'title'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Components'
7 Added: #category : 'MyFitnessTracker-Components',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Components'
8 10 }
9 11
10 Removed: { #category : #rendering }
12 Added: { #category : 'rendering' }
11 13 MFTPage >> renderPageOn: html with: aBlock [
12 14
13 15 html container
@@ -15,7 +17,7 @@
15 17 with: aBlock
16 18 ]
17 19
18 Removed: { #category : #accessing }
20 Added: { #category : 'accessing' }
19 21 MFTPage >> title [
20 22
21 23 ^ title asString
src/MyFitnessTracker/MFTPageManager.class.st
index ea23e98e..4a205e88 100644..100644
@@ -1,6 +1,6 @@
1 1 Class {
2 Removed: #name : #MFTPageManager,
3 Removed: #superclass : #Object,
2 Added: #name : 'MFTPageManager',
3 Added: #superclass : 'Object',
4 4 #instVars : [
5 5 'mainNavigationBar',
6 6 'mainPages',
@@ -8,22 +8,24 @@
8 8 'footer',
9 9 'activePage'
10 10 ],
11 Removed: #category : #'MyFitnessTracker-Utils'
11 Added: #category : 'MyFitnessTracker-Utils',
12 Added: #package : 'MyFitnessTracker',
13 Added: #tag : 'Utils'
12 14 }
13 15
14 Removed: { #category : #accessing }
16 Added: { #category : 'accessing' }
15 17 MFTPageManager >> activePage [
16 18
17 19 ^ activePage
18 20 ]
19 21
20 Removed: { #category : #accessing }
22 Added: { #category : 'accessing' }
21 23 MFTPageManager >> activePage: aMFTPage [
22 24
23 25 activePage := aMFTPage
24 26 ]
25 27
26 Removed: { #category : #'as yet unclassified' }
28 Added: { #category : 'as yet unclassified' }
27 29 MFTPageManager >> defaultPublicPages [
28 30
29 31 ^ OrderedDictionary newFrom: {
@@ -35,31 +37,31 @@
35 37 (#profile -> MFTProfilePage new) }
36 38 ]
37 39
38 Removed: { #category : #accessing }
40 Added: { #category : 'accessing' }
39 41 MFTPageManager >> footer [
40 42
41 43 ^ footer
42 44 ]
43 45
44 Removed: { #category : #accessing }
46 Added: { #category : 'accessing' }
45 47 MFTPageManager >> footer: anObject [
46 48
47 49 footer := anObject
48 50 ]
49 51
50 Removed: { #category : #accessing }
52 Added: { #category : 'accessing' }
51 53 MFTPageManager >> header [
52 54
53 55 ^ header
54 56 ]
55 57
56 Removed: { #category : #accessing }
58 Added: { #category : 'accessing' }
57 59 MFTPageManager >> header: anObject [
58 60
59 61 header := anObject
60 62 ]
61 63
62 Removed: { #category : #initialization }
64 Added: { #category : 'initialization' }
63 65 MFTPageManager >> initialize [
64 66
65 67 mainPages := self defaultPublicPages.
@@ -69,45 +71,45 @@
69 71 footer := MFTDefaultFooter new
70 72 ]
71 73
72 Removed: { #category : #'as yet unclassified' }
74 Added: { #category : 'as yet unclassified' }
73 75 MFTPageManager >> loadPublicPages [
74 76
75 77 mainPages := self defaultPublicPages.
76 78 self setActivePageAt: #landing
77 79 ]
78 80
79 Removed: { #category : #'as yet unclassified' }
81 Added: { #category : 'as yet unclassified' }
80 82 MFTPageManager >> loadUserPages [
81 83
82 84 mainPages at: #landing put: MFTUserLandingPage new.
83 85 self setActivePageAt: #landing
84 86 ]
85 87
86 Removed: { #category : #accessing }
88 Added: { #category : 'accessing' }
87 89 MFTPageManager >> mainNavigationBar [
88 90
89 91 ^ mainNavigationBar
90 92 ]
91 93
92 Removed: { #category : #accessing }
94 Added: { #category : 'accessing' }
93 95 MFTPageManager >> mainNavigationBar: anObject [
94 96
95 97 mainNavigationBar := anObject
96 98 ]
97 99
98 Removed: { #category : #accessing }
100 Added: { #category : 'accessing' }
99 101 MFTPageManager >> mainPages [
100 102
101 103 ^ mainPages
102 104 ]
103 105
104 Removed: { #category : #accessing }
106 Added: { #category : 'accessing' }
105 107 MFTPageManager >> mainPages: aCollection [
106 108
107 109 mainPages := aCollection
108 110 ]
109 111
110 Removed: { #category : #accessing }
112 Added: { #category : 'accessing' }
111 113 MFTPageManager >> setActivePageAt: aKey [
112 114
113 115 activePage := mainPages at: aKey
src/MyFitnessTracker/MFTPrimaryMuscleGroupDialog.class.st
index 8828e1c2..008d853c 100644..100644
@@ -1,13 +1,15 @@
1 1 Class {
2 Removed: #name : #MFTPrimaryMuscleGroupDialog,
3 Removed: #superclass : #MFTDialog,
2 Added: #name : 'MFTPrimaryMuscleGroupDialog',
3 Added: #superclass : 'MFTDialog',
4 4 #instVars : [
5 5 'primaryMuscleGroup'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Dialog'
7 Added: #category : 'MyFitnessTracker-Dialog',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Dialog'
8 10 }
9 11
10 Removed: { #category : #initialization }
12 Added: { #category : 'initialization' }
11 13 MFTPrimaryMuscleGroupDialog >> initialize [
12 14
13 15 super initialize.
@@ -15,19 +17,19 @@
15 17
16 18 ]
17 19
18 Removed: { #category : #accessing }
20 Added: { #category : 'accessing' }
19 21 MFTPrimaryMuscleGroupDialog >> primaryMuscleGroup [
20 22
21 23 ^ primaryMuscleGroup
22 24 ]
23 25
24 Removed: { #category : #accessing }
26 Added: { #category : 'accessing' }
25 27 MFTPrimaryMuscleGroupDialog >> primaryMuscleGroup: anObject [
26 28
27 29 primaryMuscleGroup := anObject
28 30 ]
29 31
30 Removed: { #category : #rendering }
32 Added: { #category : 'rendering' }
31 33 MFTPrimaryMuscleGroupDialog >> renderContentOn: html [
32 34
33 35 | allMuscleGroups selectedMuscleGroup |
@@ -45,7 +47,7 @@
45 47 callback: [ :group | primaryMuscleGroup := group ] ] ]
46 48 ]
47 49
48 Removed: { #category : #rendering }
50 Added: { #category : 'rendering' }
49 51 MFTPrimaryMuscleGroupDialog >> renderSubmitOn: html [
50 52
51 53 html buttonGroup: [
src/MyFitnessTracker/MFTPrize.class.st
index 2c4e54c2..610652d9 100644..100644
@@ -1,16 +1,18 @@
1 1 Class {
2 Removed: #name : #MFTPrize,
3 Removed: #superclass : #Object,
2 Added: #name : 'MFTPrize',
3 Added: #superclass : 'Object',
4 4 #instVars : [
5 5 'year',
6 6 'competition',
7 7 'place',
8 8 'category'
9 9 ],
10 Removed: #category : #'MyFitnessTracker-Model'
10 Added: #category : 'MyFitnessTracker-Model',
11 Added: #package : 'MyFitnessTracker',
12 Added: #tag : 'Model'
11 13 }
12 14
13 Removed: { #category : #'as yet unclassified' }
15 Added: { #category : 'as yet unclassified' }
14 16 MFTPrize class >> year: aDate competition: aCompetition place: anInteger [
15 17
16 18 ^ self new
@@ -20,7 +22,7 @@
20 22 yourself
21 23 ]
22 24
23 Removed: { #category : #'as yet unclassified' }
25 Added: { #category : 'as yet unclassified' }
24 26 MFTPrize class >> year: aDate competition: aCompetition place: anInteger category: aCategory [
25 27
26 28 ^ self new
@@ -31,49 +33,49 @@
31 33 yourself
32 34 ]
33 35
34 Removed: { #category : #accessing }
36 Added: { #category : 'accessing' }
35 37 MFTPrize >> category [
36 38
37 39 ^ category
38 40 ]
39 41
40 Removed: { #category : #accessing }
42 Added: { #category : 'accessing' }
41 43 MFTPrize >> category: anObject [
42 44
43 45 category := anObject
44 46 ]
45 47
46 Removed: { #category : #accessing }
48 Added: { #category : 'accessing' }
47 49 MFTPrize >> competition [
48 50
49 51 ^ competition
50 52 ]
51 53
52 Removed: { #category : #accessing }
54 Added: { #category : 'accessing' }
53 55 MFTPrize >> competition: anObject [
54 56
55 57 competition := anObject
56 58 ]
57 59
58 Removed: { #category : #accessing }
60 Added: { #category : 'accessing' }
59 61 MFTPrize >> place [
60 62
61 63 ^ place
62 64 ]
63 65
64 Removed: { #category : #accessing }
66 Added: { #category : 'accessing' }
65 67 MFTPrize >> place: aValue [
66 68
67 69 place := aValue asInteger
68 70 ]
69 71
70 Removed: { #category : #accessing }
72 Added: { #category : 'accessing' }
71 73 MFTPrize >> year [
72 74
73 75 ^ year
74 76 ]
75 77
76 Removed: { #category : #accessing }
78 Added: { #category : 'accessing' }
77 79 MFTPrize >> year: aDate [
78 80
79 81 year := aDate
src/MyFitnessTracker/MFTProfilePage.class.st
index 56a19068..2fd9a4bc 100644..100644
@@ -1,10 +1,12 @@
1 1 Class {
2 Removed: #name : #MFTProfilePage,
3 Removed: #superclass : #MFTPage,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTProfilePage',
3 Added: #superclass : 'MFTPage',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #'as yet unclassified' }
9 Added: { #category : 'as yet unclassified' }
8 10 MFTProfilePage >> editProfile [
9 11
10 12 | updatedUser |
@@ -15,14 +17,14 @@
15 17 self session db updateUserWith: updatedUser ]
16 18 ]
17 19
18 Removed: { #category : #initialization }
20 Added: { #category : 'initialization' }
19 21 MFTProfilePage >> initialize [
20 22
21 23 super initialize.
22 24 title := 'profile'
23 25 ]
24 26
25 Removed: { #category : #rendering }
27 Added: { #category : 'rendering' }
26 28 MFTProfilePage >> renderContentOn: html [
27 29
28 30 | user |
@@ -37,7 +39,7 @@
37 39 html render: user ]
38 40 ]
39 41
40 Removed: { #category : #rendering }
42 Added: { #category : 'rendering' }
41 43 MFTProfilePage >> renderProfileActionsOn: html [
42 44
43 45 html form: [
src/MyFitnessTracker/MFTPromisesCard.class.st
index 42206b2d..fa5e114a 100644..100644
@@ -1,10 +1,12 @@
1 1 Class {
2 Removed: #name : #MFTPromisesCard,
3 Removed: #superclass : #MFTCard,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTPromisesCard',
3 Added: #superclass : 'MFTCard',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #rendering }
9 Added: { #category : 'rendering' }
8 10 MFTPromisesCard >> renderContentOn: html [
9 11
10 12 self renderCardOn: html with: [
src/MyFitnessTracker/MFTPublicLandingPage.class.st
index ccb5a479..ce89d2ed 100644..100644
@@ -1,10 +1,12 @@
1 1 Class {
2 Removed: #name : #MFTPublicLandingPage,
3 Removed: #superclass : #MFTLandingPage,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTPublicLandingPage',
3 Added: #superclass : 'MFTLandingPage',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #'as yet unclassified' }
9 Added: { #category : 'as yet unclassified' }
8 10 MFTPublicLandingPage >> defaultCards [
9 11
10 12 ^ {
@@ -14,7 +16,7 @@
14 16 MFTPromisesCard new }
15 17 ]
16 18
17 Removed: { #category : #initialization }
19 Added: { #category : 'initialization' }
18 20 MFTPublicLandingPage >> initialize [
19 21
20 22 super initialize.
src/MyFitnessTracker/MFTRegisterProspectEmailHeader.class.st
index 3b42d44d..bd0b7df8 100644..100644
@@ -1,16 +1,18 @@
1 1 Class {
2 Removed: #name : #MFTRegisterProspectEmailHeader,
3 Removed: #superclass : #MFTHeaderComponent,
2 Added: #name : 'MFTRegisterProspectEmailHeader',
3 Added: #superclass : 'MFTHeaderComponent',
4 4 #instVars : [
5 5 'email',
6 6 'localPart',
7 7 'domain',
8 8 'isDismissed'
9 9 ],
10 Removed: #category : #'MyFitnessTracker-Components'
10 Added: #category : 'MyFitnessTracker-Components',
11 Added: #package : 'MyFitnessTracker',
12 Added: #tag : 'Components'
11 13 }
12 14
13 Removed: { #category : #adding }
15 Added: { #category : 'adding' }
14 16 MFTRegisterProspectEmailHeader >> addUserEmail [
15 17
16 18 | emailToCheck emailPattern |
@@ -23,26 +25,26 @@
23 25 MFTSQLite3Database storeProspectEmail: email
24 26 ]
25 27
26 Removed: { #category : #initialization }
28 Added: { #category : 'initialization' }
27 29 MFTRegisterProspectEmailHeader >> initialize [
28 30
29 31 super initialize.
30 32 isDismissed := false
31 33 ]
32 34
33 Removed: { #category : #accessing }
35 Added: { #category : 'accessing' }
34 36 MFTRegisterProspectEmailHeader >> isDismissed [
35 37
36 38 ^ isDismissed
37 39 ]
38 40
39 Removed: { #category : #accessing }
41 Added: { #category : 'accessing' }
40 42 MFTRegisterProspectEmailHeader >> isDismissed: anObject [
41 43
42 44 isDismissed := anObject
43 45 ]
44 46
45 Removed: { #category : #rendering }
47 Added: { #category : 'rendering' }
46 48 MFTRegisterProspectEmailHeader >> renderContentOn: html [
47 49
48 50 isDismissed ifTrue: [ ^ self ].
@@ -85,7 +87,7 @@
85 87 text: ' when My Fitness Tracker is ready for you!' ] ]
86 88 ]
87 89
88 Removed: { #category : #rendering }
90 Added: { #category : 'rendering' }
89 91 MFTRegisterProspectEmailHeader >> renderEmailInputModalButtonOn: html [
90 92
91 93 html formButton
@@ -96,7 +98,7 @@
96 98 with: 'E-mail me!'
97 99 ]
98 100
99 Removed: { #category : #rendering }
101 Added: { #category : 'rendering' }
100 102 MFTRegisterProspectEmailHeader >> renderEmailInputModalOn: html [
101 103
102 104 html modal
src/MyFitnessTracker/MFTRepsDistributionGraph.class.st
index e464de73..35600615 100644..100644
@@ -1,10 +1,12 @@
1 1 Class {
2 Removed: #name : #MFTRepsDistributionGraph,
3 Removed: #superclass : #MFTGraph,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTRepsDistributionGraph',
3 Added: #superclass : 'MFTGraph',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #'as yet unclassified' }
9 Added: { #category : 'as yet unclassified' }
8 10 MFTRepsDistributionGraph >> crunchTheNumbers [
9 11 "TODO: This looks ugly."
10 12
@@ -21,14 +23,14 @@
21 23 data := repTally values
22 24 ]
23 25
24 Removed: { #category : #initialization }
26 Added: { #category : 'initialization' }
25 27 MFTRepsDistributionGraph >> initialize [
26 28
27 29 super initialize.
28 30 self crunchTheNumbers
29 31 ]
30 32
31 Removed: { #category : #rendering }
33 Added: { #category : 'rendering' }
32 34 MFTRepsDistributionGraph >> renderContentOn: html [
33 35
34 36 html canvas id: 'repsVsTimeChart'.
src/MyFitnessTracker/MFTRootComponent.class.st
index 8a34e712..f12fdb93 100644..100644
@@ -1,19 +1,21 @@
1 1 Class {
2 Removed: #name : #MFTRootComponent,
3 Removed: #superclass : #SBSRootComponent,
2 Added: #name : 'MFTRootComponent',
3 Added: #superclass : 'SBSRootComponent',
4 4 #instVars : [
5 5 'main'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Components'
7 Added: #category : 'MyFitnessTracker-Components',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Components'
8 10 }
9 11
10 Removed: { #category : #testing }
12 Added: { #category : 'testing' }
11 13 MFTRootComponent class >> canBeRoot [
12 14
13 15 ^ true
14 16 ]
15 17
16 Removed: { #category : #'class initialization' }
18 Added: { #category : 'class initialization' }
17 19 MFTRootComponent class >> initialize [
18 20
19 21 | application libraries |
@@ -26,7 +28,7 @@
26 28 ^ application
27 29 ]
28 30
29 Removed: { #category : #'class initialization' }
31 Added: { #category : 'class initialization' }
30 32 MFTRootComponent class >> libraries [
31 33
32 34 ^ Dictionary new
@@ -42,7 +44,7 @@
42 44 yourself
43 45 ]
44 46
45 Removed: { #category : #adding }
47 Added: { #category : 'adding' }
46 48 MFTRootComponent >> addBootstrapJSScriptTo: html [
47 49
48 50 | library |
@@ -52,26 +54,26 @@
52 54 library addLoadScriptTo: html
53 55 ]
54 56
55 Removed: { #category : #rendering }
57 Added: { #category : 'rendering' }
56 58 MFTRootComponent >> children [
57 59
58 60 ^ { main }
59 61 ]
60 62
61 Removed: { #category : #initialization }
63 Added: { #category : 'initialization' }
62 64 MFTRootComponent >> initialize [
63 65
64 66 super initialize.
65 67 main := MFTScreenComponent new
66 68 ]
67 69
68 Removed: { #category : #initialization }
70 Added: { #category : 'initialization' }
69 71 MFTRootComponent >> main: aComponent [
70 72
71 73 main := aComponent
72 74 ]
73 75
74 Removed: { #category : #rendering }
76 Added: { #category : 'rendering' }
75 77 MFTRootComponent >> renderContentOn: html [
76 78
77 79 html script url: 'https://cdn.jsdelivr.net/npm/chart.js'.
@@ -79,7 +81,7 @@
79 81 self addBootstrapJSScriptTo: html
80 82 ]
81 83
82 Removed: { #category : #updating }
84 Added: { #category : 'updating' }
83 85 MFTRootComponent >> updateRoot: anHtmlRoot [
84 86
85 87 super updateRoot: anHtmlRoot.
@@ -93,7 +95,7 @@
93 95 url: MFTFileLibrary / #faviconPng"
94 96 ]
95 97
96 Removed: { #category : #versions }
98 Added: { #category : 'versions' }
97 99 MFTRootComponent >> version [
98 100
99 101 | version |
src/MyFitnessTracker/MFTSQLite3Database.class.st
index ce554e8f..0aa8ab58 100644..100644
@@ -1,6 +1,6 @@
1 1 Class {
2 Removed: #name : #MFTSQLite3Database,
3 Removed: #superclass : #SQLite3Database,
2 Added: #name : 'MFTSQLite3Database',
3 Added: #superclass : 'SQLite3Database',
4 4 #instVars : [
5 5 'user'
6 6 ],
@@ -11,40 +11,42 @@
11 11 'allExercises',
12 12 'testUser'
13 13 ],
14 Removed: #category : #'MyFitnessTracker-Model'
14 Added: #category : 'MyFitnessTracker-Model',
15 Added: #package : 'MyFitnessTracker',
16 Added: #tag : 'Model'
15 17 }
16 18
17 Removed: { #category : #accessing }
19 Added: { #category : 'accessing' }
18 20 MFTSQLite3Database class >> allExercises [
19 21
20 22 ^ allExercises
21 23 ]
22 24
23 Removed: { #category : #accessing }
25 Added: { #category : 'accessing' }
24 26 MFTSQLite3Database class >> allMuscleGroups [
25 27
26 28 ^ allMuscleGroups
27 29 ]
28 30
29 Removed: { #category : #accessing }
31 Added: { #category : 'accessing' }
30 32 MFTSQLite3Database class >> allMuscles [
31 33
32 34 ^ allMuscles
33 35 ]
34 36
35 Removed: { #category : #'as yet unclassified' }
37 Added: { #category : 'as yet unclassified' }
36 38 MFTSQLite3Database class >> defaultConnection [
37 39
38 40 ^ self newOnDefaultLocation connection
39 41 ]
40 42
41 Removed: { #category : #accessing }
43 Added: { #category : 'accessing' }
42 44 MFTSQLite3Database class >> defaultLocation [
43 45
44 46 ^ defaultLocation
45 47 ]
46 48
47 Removed: { #category : #'class initialization' }
49 Added: { #category : 'class initialization' }
48 50 MFTSQLite3Database class >> getAllExercises [
49 51
50 52 | connection allRows |
@@ -55,7 +57,7 @@
55 57 MFTExercise newFromDictionary: row asDictionary ])
56 58 ]
57 59
58 Removed: { #category : #'class initialization' }
60 Added: { #category : 'class initialization' }
59 61 MFTSQLite3Database class >> getAllMuscleGroups [
60 62
61 63 | connection allRows |
@@ -66,7 +68,7 @@
66 68 MFTMuscleGroup newFromDictionary: row asDictionary ])
67 69 ]
68 70
69 Removed: { #category : #'class initialization' }
71 Added: { #category : 'class initialization' }
70 72 MFTSQLite3Database class >> getAllMuscles [
71 73
72 74 | connection allRows |
@@ -77,7 +79,7 @@
77 79 MFTMuscle newFromDictionary: row asDictionary ])
78 80 ]
79 81
80 Removed: { #category : #accessing }
82 Added: { #category : 'accessing' }
81 83 MFTSQLite3Database class >> getAllSetsForUser: aMFTUser connection: openConnection [
82 84
83 85 | allSetRows sets |
@@ -90,7 +92,7 @@
90 92 ^ sets
91 93 ]
92 94
93 Removed: { #category : #accessing }
95 Added: { #category : 'accessing' }
94 96 MFTSQLite3Database class >> getAllWeightsForUser: aMFTUser connection: openConnection [
95 97
96 98 | allWeightRows weights |
@@ -102,7 +104,7 @@
102 104 ^ weights
103 105 ]
104 106
105 Removed: { #category : #accessing }
107 Added: { #category : 'accessing' }
106 108 MFTSQLite3Database class >> getAllWorkoutsForTestUser [
107 109
108 110 | connection workouts |
@@ -114,7 +116,7 @@
114 116 ^ workouts
115 117 ]
116 118
117 Removed: { #category : #accessing }
119 Added: { #category : 'accessing' }
118 120 MFTSQLite3Database class >> getAllWorkoutsForUser: aMFTUser connection: openConnection [
119 121
120 122 | allWorkoutRows workouts allSets |
@@ -139,7 +141,7 @@
139 141 ^ workouts
140 142 ]
141 143
142 Removed: { #category : #'as yet unclassified' }
144 Added: { #category : 'as yet unclassified' }
143 145 MFTSQLite3Database class >> getExistingUser: aMFTUser [
144 146
145 147 | connection existingUserDict |
@@ -160,7 +162,7 @@
160 162 ifEmpty: [ nil ]
161 163 ]
162 164
163 Removed: { #category : #'class initialization' }
165 Added: { #category : 'class initialization' }
164 166 MFTSQLite3Database class >> getTestUser [
165 167
166 168 | connection testUserDict |
@@ -173,7 +175,7 @@
173 175 ^ MFTUser newFromDictionary: testUserDict
174 176 ]
175 177
176 Removed: { #category : #'class initialization' }
178 Added: { #category : 'class initialization' }
177 179 MFTSQLite3Database class >> initialize [
178 180
179 181 defaultLocation := (Smalltalk imageDirectory / 'mft.sqlite3')
@@ -194,13 +196,13 @@
194 196 testUser := self getTestUser
195 197 ]
196 198
197 Removed: { #category : #'instance creation' }
199 Added: { #category : 'instance creation' }
198 200 MFTSQLite3Database class >> newOnDefaultLocation [
199 201
200 202 ^ self on: defaultLocation
201 203 ]
202 204
203 Removed: { #category : #'class initialization' }
205 Added: { #category : 'class initialization' }
204 206 MFTSQLite3Database class >> populatePlaceholderWeights [
205 207
206 208 | db |
@@ -212,7 +214,7 @@
212 214 db connection close
213 215 ]
214 216
215 Removed: { #category : #'class initialization' }
217 Added: { #category : 'class initialization' }
216 218 MFTSQLite3Database class >> populatePlaceholderWorkouts [
217 219
218 220 | db |
@@ -226,7 +228,7 @@
226 228 db connection close
227 229 ]
228 230
229 Removed: { #category : #'as yet unclassified' }
231 Added: { #category : 'as yet unclassified' }
230 232 MFTSQLite3Database class >> registerNewUser: aMFTUser [
231 233
232 234 aMFTUser username ifNotEmpty: [
@@ -242,7 +244,7 @@
242 244 close ]
243 245 ]
244 246
245 Removed: { #category : #setting }
247 Added: { #category : 'setting' }
246 248 MFTSQLite3Database class >> storeProspectEmail: anEmail [
247 249
248 250 self defaultConnection
@@ -253,13 +255,13 @@
253 255 close
254 256 ]
255 257
256 Removed: { #category : #accessing }
258 Added: { #category : 'accessing' }
257 259 MFTSQLite3Database class >> testUser [
258 260
259 261 ^ testUser
260 262 ]
261 263
262 Removed: { #category : #'as yet unclassified' }
264 Added: { #category : 'as yet unclassified' }
263 265 MFTSQLite3Database >> delete: anObject [
264 266 "Delete an object from the database, using the appropriate method."
265 267
@@ -276,7 +278,7 @@
276 278 self perform: appropriateMethod with: anObject
277 279 ]
278 280
279 Removed: { #category : #'as yet unclassified' }
281 Added: { #category : 'as yet unclassified' }
280 282 MFTSQLite3Database >> deleteSets: aMFTSetCollection [
281 283
282 284 aMFTSetCollection do: [ :set |
@@ -285,7 +287,7 @@
285 287 value: set workoutId ]
286 288 ]
287 289
288 Removed: { #category : #'as yet unclassified' }
290 Added: { #category : 'as yet unclassified' }
289 291 MFTSQLite3Database >> deleteWeight: aMFTWeight [
290 292
291 293 connection
@@ -297,7 +299,7 @@
297 299 aMFTWeight value }
298 300 ]
299 301
300 Removed: { #category : #'as yet unclassified' }
302 Added: { #category : 'as yet unclassified' }
301 303 MFTSQLite3Database >> deleteWorkout: aMFTWorkout [
302 304
303 305 self deleteSets: aMFTWorkout sets.
@@ -308,19 +310,19 @@
308 310 aMFTWorkout date yyyymmdd }
309 311 ]
310 312
311 Removed: { #category : #'as yet unclassified' }
313 Added: { #category : 'as yet unclassified' }
312 314 MFTSQLite3Database >> getAllUserWeights [
313 315
314 316 ^ self class getAllWeightsForUser: user connection: connection
315 317 ]
316 318
317 Removed: { #category : #'as yet unclassified' }
319 Added: { #category : 'as yet unclassified' }
318 320 MFTSQLite3Database >> getAllUserWorkouts [
319 321
320 322 ^ self class getAllWorkoutsForUser: user connection: connection
321 323 ]
322 324
323 Removed: { #category : #accessing }
325 Added: { #category : 'accessing' }
324 326 MFTSQLite3Database >> insert: anObject [
325 327 "Insert an object in the database, using the appropriate method."
326 328
@@ -338,7 +340,7 @@
338 340 self perform: appropriateMethod with: anObject
339 341 ]
340 342
341 Removed: { #category : #'as yet unclassified' }
343 Added: { #category : 'as yet unclassified' }
342 344 MFTSQLite3Database >> insertSet: aMFTSet forWorkout: aMFTWorkout [
343 345
344 346 connection
@@ -356,14 +358,14 @@
356 358 aMFTSet restAfter }
357 359 ]
358 360
359 Removed: { #category : #'as yet unclassified' }
361 Added: { #category : 'as yet unclassified' }
360 362 MFTSQLite3Database >> insertSets: aMFTSetCollection forWorkout: aMFTWorkout [
361 363
362 364 aMFTSetCollection do: [ :set |
363 365 self insertSet: set forWorkout: aMFTWorkout ]
364 366 ]
365 367
366 Removed: { #category : #'as yet unclassified' }
368 Added: { #category : 'as yet unclassified' }
367 369 MFTSQLite3Database >> insertWeight: aMFTWeight [
368 370
369 371 connection
@@ -375,7 +377,7 @@
375 377 aMFTWeight value }
376 378 ]
377 379
378 Removed: { #category : #'as yet unclassified' }
380 Added: { #category : 'as yet unclassified' }
379 381 MFTSQLite3Database >> insertWorkout: aMFTWorkout [
380 382
381 383 | workoutId |
@@ -401,7 +403,7 @@
401 403 connection commitTransaction
402 404 ]
403 405
404 Removed: { #category : #'as yet unclassified' }
406 Added: { #category : 'as yet unclassified' }
405 407 MFTSQLite3Database >> login: aMFTUser atDateAndTime: aDateAndTime [
406 408
407 409 self user: aMFTUser.
@@ -414,7 +416,7 @@
414 416 user id }
415 417 ]
416 418
417 Removed: { #category : #'as yet unclassified' }
419 Added: { #category : 'as yet unclassified' }
418 420 MFTSQLite3Database >> update: oldObject with: newObject [
419 421 "Update an object in the database, using the appropriate method."
420 422
@@ -432,7 +434,7 @@
432 434 self perform: appropriateMethod with: oldObject with: newObject
433 435 ]
434 436
435 Removed: { #category : #'as yet unclassified' }
437 Added: { #category : 'as yet unclassified' }
436 438 MFTSQLite3Database >> updateUserWith: newMFTUser [
437 439
438 440 connection
@@ -452,7 +454,7 @@
452 454 user id }
453 455 ]
454 456
455 Removed: { #category : #'as yet unclassified' }
457 Added: { #category : 'as yet unclassified' }
456 458 MFTSQLite3Database >> updateWeight: oldMFTWeight with: newMFTWeight [
457 459
458 460 connection
@@ -470,7 +472,7 @@
470 472 oldMFTWeight value }
471 473 ]
472 474
473 Removed: { #category : #'as yet unclassified' }
475 Added: { #category : 'as yet unclassified' }
474 476 MFTSQLite3Database >> updateWorkout: oldMFTWorkout with: newMFTWorkout [
475 477 "We first obtain the workoutId to later replace the associated workout's exercises."
476 478
@@ -505,13 +507,13 @@
505 507 self insertExercise: exercise forWorkoutId: workoutId ]
506 508 ]
507 509
508 Removed: { #category : #accessing }
510 Added: { #category : 'accessing' }
509 511 MFTSQLite3Database >> user [
510 512
511 513 ^ user
512 514 ]
513 515
514 Removed: { #category : #accessing }
516 Added: { #category : 'accessing' }
515 517 MFTSQLite3Database >> user: aMFTUser [
516 518
517 519 user := aMFTUser
src/MyFitnessTracker/MFTSandboxPage.class.st
index 06c2af7a..04f7cb6a 100644..100644
@@ -1,17 +1,19 @@
1 1 Class {
2 Removed: #name : #MFTSandboxPage,
3 Removed: #superclass : #MFTPage,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTSandboxPage',
3 Added: #superclass : 'MFTPage',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #initialization }
9 Added: { #category : 'initialization' }
8 10 MFTSandboxPage >> initialize [
9 11
10 12 super initialize.
11 13 title := 'sandbox'
12 14 ]
13 15
14 Removed: { #category : #rendering }
16 Added: { #category : 'rendering' }
15 17 MFTSandboxPage >> renderContentOn: html [
16 18
17 19 self renderPageOn: html with: [
src/MyFitnessTracker/MFTScreenComponent.class.st
index 94d8cfc1..d4d33d6a 100644..100644
@@ -1,13 +1,15 @@
1 1 Class {
2 Removed: #name : #MFTScreenComponent,
3 Removed: #superclass : #SBSComponent,
2 Added: #name : 'MFTScreenComponent',
3 Added: #superclass : 'SBSComponent',
4 4 #instVars : [
5 5 'pm'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Components'
7 Added: #category : 'MyFitnessTracker-Components',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Components'
8 10 }
9 11
10 Removed: { #category : #hooks }
12 Added: { #category : 'hooks' }
11 13 MFTScreenComponent >> children [
12 14
13 15 ^ {
@@ -17,14 +19,14 @@
17 19 pm footer }
18 20 ]
19 21
20 Removed: { #category : #initialization }
22 Added: { #category : 'initialization' }
21 23 MFTScreenComponent >> initialize [
22 24
23 25 super initialize.
24 26 pm := self session pageManager
25 27 ]
26 28
27 Removed: { #category : #rendering }
29 Added: { #category : 'rendering' }
28 30 MFTScreenComponent >> renderContentOn: html [
29 31
30 32 self session user isLoggedIn ifFalse: [ html render: pm header ].
src/MyFitnessTracker/MFTSecondaryMuscleGroupsDialog.class.st
index 4a21300e..f94607f8 100644..100644
@@ -1,20 +1,22 @@
1 1 Class {
2 Removed: #name : #MFTSecondaryMuscleGroupsDialog,
3 Removed: #superclass : #MFTDialog,
2 Added: #name : 'MFTSecondaryMuscleGroupsDialog',
3 Added: #superclass : 'MFTDialog',
4 4 #instVars : [
5 5 'secondaryMuscleGroups'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Dialog'
7 Added: #category : 'MyFitnessTracker-Dialog',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Dialog'
8 10 }
9 11
10 Removed: { #category : #initialization }
12 Added: { #category : 'initialization' }
11 13 MFTSecondaryMuscleGroupsDialog >> initialize [
12 14
13 15 super initialize.
14 16 secondaryMuscleGroups := OrderedCollection new
15 17 ]
16 18
17 Removed: { #category : #rendering }
19 Added: { #category : 'rendering' }
18 20 MFTSecondaryMuscleGroupsDialog >> renderContentOn: html [
19 21
20 22 | allMuscleGroups selectedMuscles |
@@ -34,7 +36,7 @@
34 36 groups ifNotEmpty: [ secondaryMuscleGroups := groups ] ] ]
35 37 ]
36 38
37 Removed: { #category : #rendering }
39 Added: { #category : 'rendering' }
38 40 MFTSecondaryMuscleGroupsDialog >> renderSubmitOn: html [
39 41
40 42 html buttonGroup: [
@@ -50,13 +52,13 @@
50 52 with: (completion ifNil: [ 'Cancel' ] ifNotNil: [ 'Skip' ]) ]
51 53 ]
52 54
53 Removed: { #category : #accessing }
55 Added: { #category : 'accessing' }
54 56 MFTSecondaryMuscleGroupsDialog >> secondaryMuscleGroups [
55 57
56 58 ^ secondaryMuscleGroups
57 59 ]
58 60
59 Removed: { #category : #accessing }
61 Added: { #category : 'accessing' }
60 62 MFTSecondaryMuscleGroupsDialog >> secondaryMuscleGroups: anObject [
61 63
62 64 secondaryMuscleGroups := anObject
src/MyFitnessTracker/MFTSession.class.st
index 3120ea13..e264d8e9 100644..100644
@@ -1,27 +1,29 @@
1 1 Class {
2 Removed: #name : #MFTSession,
3 Removed: #superclass : #WASession,
2 Added: #name : 'MFTSession',
3 Added: #superclass : 'WASession',
4 4 #instVars : [
5 5 'user',
6 6 'db',
7 7 'pageManager'
8 8 ],
9 Removed: #category : #'MyFitnessTracker-Session'
9 Added: #category : 'MyFitnessTracker-Session',
10 Added: #package : 'MyFitnessTracker',
11 Added: #tag : 'Session'
10 12 }
11 13
12 Removed: { #category : #accessing }
14 Added: { #category : 'accessing' }
13 15 MFTSession >> db [
14 16
15 17 ^ db
16 18 ]
17 19
18 Removed: { #category : #accessing }
20 Added: { #category : 'accessing' }
19 21 MFTSession >> db: anObject [
20 22
21 23 db := anObject
22 24 ]
23 25
24 Removed: { #category : #initialization }
26 Added: { #category : 'initialization' }
25 27 MFTSession >> initialize [
26 28 "A database connection is only created for sessions belonging to registered users."
27 29
@@ -30,14 +32,14 @@
30 32 pageManager := MFTPageManager new
31 33 ]
32 34
33 Removed: { #category : #'as yet unclassified' }
35 Added: { #category : 'as yet unclassified' }
34 36 MFTSession >> loadUserDataFromDb [
35 37
36 38 user workouts: db getAllUserWorkouts.
37 39 user weights: db getAllUserWeights
38 40 ]
39 41
40 Removed: { #category : #login }
42 Added: { #category : 'login' }
41 43 MFTSession >> login: aMFTUser [
42 44
43 45 | now |
@@ -54,7 +56,7 @@
54 56 pageManager loadUserPages
55 57 ]
56 58
57 Removed: { #category : #'parent/child' }
59 Added: { #category : 'parent/child' }
58 60 MFTSession >> logout [
59 61
60 62 db connection close.
@@ -62,32 +64,32 @@
62 64 pageManager loadPublicPages
63 65 ]
64 66
65 Removed: { #category : #accessing }
67 Added: { #category : 'accessing' }
66 68 MFTSession >> pageManager [
67 69
68 70 ^ pageManager
69 71 ]
70 72
71 Removed: { #category : #accessing }
73 Added: { #category : 'accessing' }
72 74 MFTSession >> pageManager: aMFTPageManager [
73 75
74 76 pageManager := aMFTPageManager
75 77 ]
76 78
77 Removed: { #category : #'parent/child' }
79 Added: { #category : 'parent/child' }
78 80 MFTSession >> unregistered [
79 81
80 82 super unregistered.
81 83 self logout
82 84 ]
83 85
84 Removed: { #category : #accessing }
86 Added: { #category : 'accessing' }
85 87 MFTSession >> user [
86 88
87 89 ^ user
88 90 ]
89 91
90 Removed: { #category : #accessing }
92 Added: { #category : 'accessing' }
91 93 MFTSession >> user: aMFTUser [
92 94
93 95 user := aMFTUser
src/MyFitnessTracker/MFTSet.class.st
index 3061e280..230c65cc 100644..100644
@@ -1,6 +1,6 @@
1 1 Class {
2 Removed: #name : #MFTSet,
3 Removed: #superclass : #Object,
2 Added: #name : 'MFTSet',
3 Added: #superclass : 'Object',
4 4 #instVars : [
5 5 'id',
6 6 'workoutId',
@@ -12,10 +12,12 @@
12 12 'rpe',
13 13 'restAfter'
14 14 ],
15 Removed: #category : #'MyFitnessTracker-Model'
15 Added: #category : 'MyFitnessTracker-Model',
16 Added: #package : 'MyFitnessTracker',
17 Added: #tag : 'Model'
16 18 }
17 19
18 Removed: { #category : #'instance creation' }
20 Added: { #category : 'instance creation' }
19 21 MFTSet class >> fromJson: aJsonString [
20 22
21 23 | dict |
@@ -27,7 +29,7 @@
27 29 yourself
28 30 ]
29 31
30 Removed: { #category : #'instance creation' }
32 Added: { #category : 'instance creation' }
31 33 MFTSet class >> newFromDictionary: aDictionary [
32 34
33 35 ^ self new
@@ -42,7 +44,7 @@
42 44 yourself
43 45 ]
44 46
45 Removed: { #category : #'as yet unclassified' }
47 Added: { #category : 'as yet unclassified' }
46 48 MFTSet class >> placeholderCollection [
47 49
48 50 | forWorkout1 forWorkout2 forWorkout3 |
@@ -164,7 +166,7 @@
164 166 forWorkout3 } flattened
165 167 ]
166 168
167 Removed: { #category : #accessing }
169 Added: { #category : 'accessing' }
168 170 MFTSet class >> reps: anInteger [
169 171
170 172 ^ self new
@@ -172,7 +174,7 @@
172 174 yourself
173 175 ]
174 176
175 Removed: { #category : #'as yet unclassified' }
177 Added: { #category : 'as yet unclassified' }
176 178 MFTSet class >> reps: anInteger load: anInteger2 [
177 179
178 180 ^ self new
@@ -181,7 +183,7 @@
181 183 yourself
182 184 ]
183 185
184 Removed: { #category : #'as yet unclassified' }
186 Added: { #category : 'as yet unclassified' }
185 187 MFTSet class >> reps: aValue load: aValue2 rpe: aValue3 [
186 188
187 189 ^ self new
@@ -191,7 +193,7 @@
191 193 yourself
192 194 ]
193 195
194 Removed: { #category : #'as yet unclassified' }
196 Added: { #category : 'as yet unclassified' }
195 197 MFTSet class >> reps: aValue load: aValue2 rpe: aValue3 restAfter: aValue4 [
196 198
197 199 ^ self new
@@ -202,7 +204,7 @@
202 204 yourself
203 205 ]
204 206
205 Removed: { #category : #'as yet unclassified' }
207 Added: { #category : 'as yet unclassified' }
206 208 MFTSet class >> reps: anInteger rpe: aPercentage [
207 209
208 210 ^ self new
@@ -211,7 +213,7 @@
211 213 yourself
212 214 ]
213 215
214 Removed: { #category : #accessing }
216 Added: { #category : 'accessing' }
215 217 MFTSet >> exercise [
216 218
217 219 ^ MFTSQLite3Database allExercises
@@ -219,146 +221,146 @@
219 221 ifNone: [ MFTExercise new ]
220 222 ]
221 223
222 Removed: { #category : #accessing }
224 Added: { #category : 'accessing' }
223 225 MFTSet >> exercise: aMFTExercise [
224 226
225 227 exerciseId := aMFTExercise id
226 228 ]
227 229
228 Removed: { #category : #accessing }
230 Added: { #category : 'accessing' }
229 231 MFTSet >> exerciseId [
230 232
231 233 ^ exerciseId
232 234 ]
233 235
234 Removed: { #category : #accessing }
236 Added: { #category : 'accessing' }
235 237 MFTSet >> exerciseId: anInteger [
236 238
237 239 exerciseId := anInteger
238 240 ]
239 241
240 Removed: { #category : #accessing }
242 Added: { #category : 'accessing' }
241 243 MFTSet >> groupId [
242 244
243 245 ^ groupId
244 246 ]
245 247
246 Removed: { #category : #accessing }
248 Added: { #category : 'accessing' }
247 249 MFTSet >> groupId: anInteger [
248 250
249 251 groupId := anInteger
250 252 ]
251 253
252 Removed: { #category : #testing }
254 Added: { #category : 'testing' }
253 255 MFTSet >> hasLoad [
254 256
255 257 ^ load isNotNil and: [ load asString isNotEmpty ]
256 258 ]
257 259
258 Removed: { #category : #'as yet unclassified' }
260 Added: { #category : 'as yet unclassified' }
259 261 MFTSet >> hasRestAfter [
260 262
261 263 ^ restAfter isNotNil and: [ restAfter asString isNotEmpty ]
262 264 ]
263 265
264 Removed: { #category : #'as yet unclassified' }
266 Added: { #category : 'as yet unclassified' }
265 267 MFTSet >> hasRpe [
266 268
267 269 ^ rpe isNotNil and: [ rpe asString isNotEmpty ]
268 270 ]
269 271
270 Removed: { #category : #'as yet unclassified' }
272 Added: { #category : 'as yet unclassified' }
271 273 MFTSet >> hasVolume [
272 274
273 275 ^ self volume ~~ 0
274 276 ]
275 277
276 Removed: { #category : #accessing }
278 Added: { #category : 'accessing' }
277 279 MFTSet >> id [
278 280
279 281 ^ id
280 282 ]
281 283
282 Removed: { #category : #accessing }
284 Added: { #category : 'accessing' }
283 285 MFTSet >> id: anObject [
284 286
285 287 id := anObject
286 288 ]
287 289
288 Removed: { #category : #accessing }
290 Added: { #category : 'accessing' }
289 291 MFTSet >> load [
290 292
291 293 ^ load
292 294 ]
293 295
294 Removed: { #category : #accessing }
296 Added: { #category : 'accessing' }
295 297 MFTSet >> load: anObject [
296 298
297 299 load := anObject
298 300 ]
299 301
300 Removed: { #category : #accessing }
302 Added: { #category : 'accessing' }
301 303 MFTSet >> number [
302 304
303 305 ^ number
304 306 ]
305 307
306 Removed: { #category : #accessing }
308 Added: { #category : 'accessing' }
307 309 MFTSet >> number: anInteger [
308 310
309 311 number := anInteger
310 312 ]
311 313
312 Removed: { #category : #accessing }
314 Added: { #category : 'accessing' }
313 315 MFTSet >> reps [
314 316
315 317 ^ reps
316 318 ]
317 319
318 Removed: { #category : #accessing }
320 Added: { #category : 'accessing' }
319 321 MFTSet >> reps: anObject [
320 322
321 323 reps := anObject
322 324 ]
323 325
324 Removed: { #category : #accessing }
326 Added: { #category : 'accessing' }
325 327 MFTSet >> restAfter [
326 328
327 329 ^ restAfter
328 330 ]
329 331
330 Removed: { #category : #accessing }
332 Added: { #category : 'accessing' }
331 333 MFTSet >> restAfter: anObject [
332 334
333 335 restAfter := anObject
334 336 ]
335 337
336 Removed: { #category : #accessing }
338 Added: { #category : 'accessing' }
337 339 MFTSet >> rpe [
338 340
339 341 ^ rpe
340 342 ]
341 343
342 Removed: { #category : #accessing }
344 Added: { #category : 'accessing' }
343 345 MFTSet >> rpe: anInteger [
344 346
345 347 rpe := anInteger
346 348 ]
347 349
348 Removed: { #category : #'as yet unclassified' }
350 Added: { #category : 'as yet unclassified' }
349 351 MFTSet >> volume [
350 352 "reps is never nil, as enforced by the database schema."
351 353
352 354 ^ load ifNotNil: [ reps * load ] ifNil: [ 0 ]
353 355 ]
354 356
355 Removed: { #category : #accessing }
357 Added: { #category : 'accessing' }
356 358 MFTSet >> workoutId [
357 359
358 360 ^ workoutId
359 361 ]
360 362
361 Removed: { #category : #accessing }
363 Added: { #category : 'accessing' }
362 364 MFTSet >> workoutId: anObject [
363 365
364 366 workoutId := anObject
src/MyFitnessTracker/MFTSetDialog.class.st
index 67829992..b2417a9a 100644..100644
@@ -1,13 +1,15 @@
1 1 Class {
2 Removed: #name : #MFTSetDialog,
3 Removed: #superclass : #MFTDialog,
2 Added: #name : 'MFTSetDialog',
3 Added: #superclass : 'MFTDialog',
4 4 #instVars : [
5 5 'set'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Dialog'
7 Added: #category : 'MyFitnessTracker-Dialog',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Dialog'
8 10 }
9 11
10 Removed: { #category : #actions }
12 Added: { #category : 'actions' }
11 13 MFTSetDialog class >> edit: aMFTSet [
12 14
13 15 ^ self new
@@ -16,7 +18,7 @@
16 18 yourself
17 19 ]
18 20
19 Removed: { #category : #actions }
21 Added: { #category : 'actions' }
20 22 MFTSetDialog class >> edit: aMFTSet withExercise: aMFTExercise [
21 23
22 24 ^ self new
@@ -25,7 +27,7 @@
25 27 yourself
26 28 ]
27 29
28 Removed: { #category : #'instance creation' }
30 Added: { #category : 'instance creation' }
29 31 MFTSetDialog class >> newForExercise: aMFTExercise [
30 32
31 33 ^ self new
@@ -34,14 +36,14 @@
34 36 yourself
35 37 ]
36 38
37 Removed: { #category : #initialization }
39 Added: { #category : 'initialization' }
38 40 MFTSetDialog >> initialize [
39 41
40 42 super initialize.
41 43 set := MFTSet new reps: 8
42 44 ]
43 45
44 Removed: { #category : #rendering }
46 Added: { #category : 'rendering' }
45 47 MFTSetDialog >> renderContentOn: html [
46 48
47 49 self renderDialogOn: html with: [
@@ -78,7 +80,7 @@
78 80 (value ifNotEmpty: [ value asNumber ] ifEmpty: [ nil ]) ] ] ] ] ]
79 81 ]
80 82
81 Removed: { #category : #delegation }
83 Added: { #category : 'delegation' }
82 84 MFTSetDialog >> renderSubmitOn: html [
83 85
84 86 html buttonGroup: [
@@ -94,13 +96,13 @@
94 96 with: (completion ifNil: [ 'Cancel' ] ifNotNil: [ 'Skip' ]) ]
95 97 ]
96 98
97 Removed: { #category : #accessing }
99 Added: { #category : 'accessing' }
98 100 MFTSetDialog >> set [
99 101
100 102 ^ set
101 103 ]
102 104
103 Removed: { #category : #accessing }
105 Added: { #category : 'accessing' }
104 106 MFTSetDialog >> set: anObject [
105 107
106 108 set := anObject
src/MyFitnessTracker/MFTSetGroup.class.st
index 090164c7..cba88296 100644..100644
@@ -1,25 +1,27 @@
1 1 Class {
2 Removed: #name : #MFTSetGroup,
3 Removed: #superclass : #Object,
2 Added: #name : 'MFTSetGroup',
3 Added: #superclass : 'Object',
4 4 #instVars : [
5 5 'sets'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Model'
7 Added: #category : 'MyFitnessTracker-Model',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Model'
8 10 }
9 11
10 Removed: { #category : #adding }
12 Added: { #category : 'adding' }
11 13 MFTSetGroup >> addSet: aMFTSet [
12 14
13 15 sets add: aMFTSet
14 16 ]
15 17
16 Removed: { #category : #adding }
18 Added: { #category : 'adding' }
17 19 MFTSetGroup >> addSets: aMFTSetCollection [
18 20
19 21 sets addAll: aMFTSetCollection
20 22 ]
21 23
22 Removed: { #category : #initialization }
24 Added: { #category : 'initialization' }
23 25 MFTSetGroup >> description [
24 26
25 27 self isSuperset ifTrue: [
@@ -39,98 +41,98 @@
39 41 ^ 'regular set'
40 42 ]
41 43
42 Removed: { #category : #'as yet unclassified' }
44 Added: { #category : 'as yet unclassified' }
43 45 MFTSetGroup >> duplicateSet: aMFTSet [
44 46
45 47 sets add: aMFTSet after: aMFTSet
46 48 ]
47 49
48 Removed: { #category : #testing }
50 Added: { #category : 'testing' }
49 51 MFTSetGroup >> hasLoad [
50 52
51 53 ^ sets anySatisfy: #hasLoad
52 54 ]
53 55
54 Removed: { #category : #testing }
56 Added: { #category : 'testing' }
55 57 MFTSetGroup >> hasRestAfter [
56 58
57 59 ^ sets anySatisfy: #hasRestAfter
58 60 ]
59 61
60 Removed: { #category : #testing }
62 Added: { #category : 'testing' }
61 63 MFTSetGroup >> hasRpe [
62 64
63 65 ^ sets anySatisfy: #hasRpe
64 66 ]
65 67
66 Removed: { #category : #testing }
68 Added: { #category : 'testing' }
67 69 MFTSetGroup >> hasVolume [
68 70
69 71 ^ sets anySatisfy: #hasVolume
70 72 ]
71 73
72 Removed: { #category : #initialization }
74 Added: { #category : 'initialization' }
73 75 MFTSetGroup >> initialize [
74 76
75 77 super initialize.
76 78 sets := OrderedCollection new
77 79 ]
78 80
79 Removed: { #category : #testing }
81 Added: { #category : 'testing' }
80 82 MFTSetGroup >> isGiantSet [
81 83
82 84 ^ self uniqueExercisesInSets >= 4
83 85 ]
84 86
85 Removed: { #category : #testing }
87 Added: { #category : 'testing' }
86 88 MFTSetGroup >> isIrregularSetGroup [
87 89
88 90 ^ self isRegularSetGroup not
89 91 ]
90 92
91 Removed: { #category : #testing }
93 Added: { #category : 'testing' }
92 94 MFTSetGroup >> isRegularSetGroup [
93 95
94 96 ^ self uniqueExercisesInSets = 1
95 97 ]
96 98
97 Removed: { #category : #testing }
99 Added: { #category : 'testing' }
98 100 MFTSetGroup >> isSuperset [
99 101
100 102 ^ self uniqueExercisesInSets = 2
101 103 ]
102 104
103 Removed: { #category : #testing }
105 Added: { #category : 'testing' }
104 106 MFTSetGroup >> isTriSet [
105 107
106 108 ^ self uniqueExercisesInSets = 3
107 109 ]
108 110
109 Removed: { #category : #adding }
111 Added: { #category : 'adding' }
110 112 MFTSetGroup >> removeSet: aMFTSet [
111 113
112 114 sets remove: aMFTSet
113 115 ]
114 116
115 Removed: { #category : #adding }
117 Added: { #category : 'adding' }
116 118 MFTSetGroup >> removeSets: aMFTSetCollection [
117 119
118 120 sets removeAll: aMFTSetCollection
119 121 ]
120 122
121 Removed: { #category : #accessing }
123 Added: { #category : 'accessing' }
122 124 MFTSetGroup >> sets [
123 125
124 126 ^ sets
125 127 ]
126 128
127 Removed: { #category : #accessing }
129 Added: { #category : 'accessing' }
128 130 MFTSetGroup >> sets: aMFTSetCollection [
129 131
130 132 sets := aMFTSetCollection
131 133 ]
132 134
133 Removed: { #category : #initialization }
135 Added: { #category : 'initialization' }
134 136 MFTSetGroup >> type [
135 137
136 138 self isSuperset ifTrue: [ ^ 'superset' ].
@@ -139,7 +141,7 @@
139 141 ^ 'regular set'
140 142 ]
141 143
142 Removed: { #category : #testing }
144 Added: { #category : 'testing' }
143 145 MFTSetGroup >> uniqueExercisesInSets [
144 146 "I answer the amount of unique exercises in all sets."
145 147
@@ -148,13 +150,13 @@
148 150 ^ uniqueExerciseIds size
149 151 ]
150 152
151 Removed: { #category : #'as yet unclassified' }
153 Added: { #category : 'as yet unclassified' }
152 154 MFTSetGroup >> updateSet: aMFTSet1 with: aMFTSet2 [
153 155
154 156 sets at: (sets indexOf: aMFTSet1) put: aMFTSet2
155 157 ]
156 158
157 Removed: { #category : #'as yet unclassified' }
159 Added: { #category : 'as yet unclassified' }
158 160 MFTSetGroup >> updateSets: aMFTSetCollection1 with: aMFTSetCollection2 [
159 161
160 162 aMFTSetCollection1
@@ -162,7 +164,7 @@
162 164 do: [ :oldSet :newSet | self updateSet: oldSet with: newSet ]
163 165 ]
164 166
165 Removed: { #category : #'as yet unclassified' }
167 Added: { #category : 'as yet unclassified' }
166 168 MFTSetGroup >> volume [
167 169
168 170 ^ (sets collect: #volume) sum
src/MyFitnessTracker/MFTSetGroupDialog.class.st
index c6a1b570..c9505127 100644..100644
@@ -1,15 +1,17 @@
1 1 Class {
2 Removed: #name : #MFTSetGroupDialog,
3 Removed: #superclass : #MFTDialog,
2 Added: #name : 'MFTSetGroupDialog',
3 Added: #superclass : 'MFTDialog',
4 4 #instVars : [
5 5 'allExercises',
6 6 'selectedExercises',
7 7 'setGroup'
8 8 ],
9 Removed: #category : #'MyFitnessTracker-Dialog'
9 Added: #category : 'MyFitnessTracker-Dialog',
10 Added: #package : 'MyFitnessTracker',
11 Added: #tag : 'Dialog'
10 12 }
11 13
12 Removed: { #category : #actions }
14 Added: { #category : 'actions' }
13 15 MFTSetGroupDialog class >> edit: aMFTSetGroup [
14 16
15 17 ^ self new
@@ -20,7 +22,7 @@
20 22 yourself
21 23 ]
22 24
23 Removed: { #category : #actions }
25 Added: { #category : 'actions' }
24 26 MFTSetGroupDialog class >> edit: aMFTSetGroup withExercises: aMFTExerciseCollection [
25 27
26 28 ^ self new
@@ -30,7 +32,7 @@
30 32 yourself
31 33 ]
32 34
33 Removed: { #category : #adding }
35 Added: { #category : 'adding' }
34 36 MFTSetGroupDialog >> addSet [
35 37
36 38 | set |
@@ -41,7 +43,7 @@
41 43 setGroup addSet: (set exercise: selectedExercises first)
42 44 ]
43 45
44 Removed: { #category : #adding }
46 Added: { #category : 'adding' }
45 47 MFTSetGroupDialog >> addSets: aMFTExerciseCollection [
46 48
47 49 | sets |
@@ -52,7 +54,7 @@
52 54 sets ifNotEmpty: [ setGroup addSets: sets ]
53 55 ]
54 56
55 Removed: { #category : #actions }
57 Added: { #category : 'actions' }
56 58 MFTSetGroupDialog >> editSet: aMFTSet [
57 59
58 60 | oldSet newSet |
@@ -64,7 +66,7 @@
64 66 newSet ifNotNil: [ setGroup updateSet: oldSet with: newSet ]
65 67 ]
66 68
67 Removed: { #category : #actions }
69 Added: { #category : 'actions' }
68 70 MFTSetGroupDialog >> editSets: aMFTSetCollection [
69 71
70 72 | oldSets newSets |
@@ -76,7 +78,7 @@
76 78 newSets ifNotEmpty: [ setGroup updateSets: oldSets with: newSets ]
77 79 ]
78 80
79 Removed: { #category : #initialization }
81 Added: { #category : 'initialization' }
80 82 MFTSetGroupDialog >> initialize [
81 83
82 84 super initialize.
@@ -86,7 +88,7 @@
86 88 selectedExercises := OrderedCollection with: allExercises first
87 89 ]
88 90
89 Removed: { #category : #rendering }
91 Added: { #category : 'rendering' }
90 92 MFTSetGroupDialog >> makeGiantSet [
91 93
92 94 self heading: 'Giant Sets'.
@@ -95,7 +97,7 @@
95 97 self populateSetsForExercises: selectedExercises
96 98 ]
97 99
98 Removed: { #category : #rendering }
100 Added: { #category : 'rendering' }
99 101 MFTSetGroupDialog >> makeRegularExercise [
100 102
101 103 self heading: 'Sets'.
@@ -103,7 +105,7 @@
103 105 self populateSetsForExercises: selectedExercises
104 106 ]
105 107
106 Removed: { #category : #rendering }
108 Added: { #category : 'rendering' }
107 109 MFTSetGroupDialog >> makeSuperset [
108 110
109 111 self heading: 'Supersets'.
@@ -113,7 +115,7 @@
113 115 self populateSetsForExercises: selectedExercises
114 116 ]
115 117
116 Removed: { #category : #rendering }
118 Added: { #category : 'rendering' }
117 119 MFTSetGroupDialog >> makeTriset [
118 120
119 121 self heading: 'Tri-sets'.
@@ -124,7 +126,7 @@
124 126 self populateSetsForExercises: selectedExercises
125 127 ]
126 128
127 Removed: { #category : #'as yet unclassified' }
129 Added: { #category : 'as yet unclassified' }
128 130 MFTSetGroupDialog >> populateSetsForExercises: aMFTExerciseCollection [
129 131
130 132 setGroup := MFTSetGroup new sets:
@@ -134,7 +136,7 @@
134 136 exercise: exercise ])
135 137 ]
136 138
137 Removed: { #category : #rendering }
139 Added: { #category : 'rendering' }
138 140 MFTSetGroupDialog >> renderConfigureSetGroupButtonsOn: html [
139 141
140 142 selectedExercises size = 1
@@ -167,7 +169,7 @@
167 169 with: 'Giant set' ] ]
168 170 ]
169 171
170 Removed: { #category : #rendering }
172 Added: { #category : 'rendering' }
171 173 MFTSetGroupDialog >> renderContentOn: html [
172 174
173 175 self renderDialogOn: html with: [
@@ -177,7 +179,7 @@
177 179 self renderConfigureSetGroupButtonsOn: html ]
178 180 ]
179 181
180 Removed: { #category : #rendering }
182 Added: { #category : 'rendering' }
181 183 MFTSetGroupDialog >> renderSelectExercisesOn: html [
182 184
183 185 | allSets |
@@ -196,7 +198,7 @@
196 198 labels: [ :each | each englishName ] ] ]
197 199 ]
198 200
199 Removed: { #category : #rendering }
201 Added: { #category : 'rendering' }
200 202 MFTSetGroupDialog >> renderSetGroupRowsOn: html [
201 203
202 204 setGroup sets doWithIndex: [ :set :i |
@@ -250,7 +252,7 @@
250 252 with: set restAfter ] ] ]
251 253 ]
252 254
253 Removed: { #category : #rendering }
255 Added: { #category : 'rendering' }
254 256 MFTSetGroupDialog >> renderSetGroupTableHeaderOn: html [
255 257
256 258 html tableHead: [
@@ -274,7 +276,7 @@
274 276 with: 'Rest After (s)' ] ]
275 277 ]
276 278
277 Removed: { #category : #rendering }
279 Added: { #category : 'rendering' }
278 280 MFTSetGroupDialog >> renderSetGroupTableOn: html [
279 281
280 282 html table
@@ -284,7 +286,7 @@
284 286 self renderSetGroupRowsOn: html ]
285 287 ]
286 288
287 Removed: { #category : #rendering }
289 Added: { #category : 'rendering' }
288 290 MFTSetGroupDialog >> renderSubmitOn: html [
289 291
290 292 html buttonGroup: [
@@ -300,31 +302,31 @@
300 302 with: (completion ifNil: [ 'Cancel' ] ifNotNil: [ 'Skip' ]) ]
301 303 ]
302 304
303 Removed: { #category : #accessing }
305 Added: { #category : 'accessing' }
304 306 MFTSetGroupDialog >> selectedExercises [
305 307
306 308 ^ selectedExercises
307 309 ]
308 310
309 Removed: { #category : #accessing }
311 Added: { #category : 'accessing' }
310 312 MFTSetGroupDialog >> selectedExercises: aMFTExerciseCollection [
311 313
312 314 selectedExercises := aMFTExerciseCollection
313 315 ]
314 316
315 Removed: { #category : #accessing }
317 Added: { #category : 'accessing' }
316 318 MFTSetGroupDialog >> setGroup [
317 319
318 320 ^ setGroup
319 321 ]
320 322
321 Removed: { #category : #accessing }
323 Added: { #category : 'accessing' }
322 324 MFTSetGroupDialog >> setGroup: anObject [
323 325
324 326 setGroup := anObject
325 327 ]
326 328
327 Removed: { #category : #'as yet unclassified' }
329 Added: { #category : 'as yet unclassified' }
328 330 MFTSetGroupDialog >> updateAllSelectedExercises [
329 331
330 332 | allSets |
src/MyFitnessTracker/MFTSetGroupsDialog.class.st
index fc0f6cad..dbe18c15 100644..100644
@@ -1,13 +1,15 @@
1 1 Class {
2 Removed: #name : #MFTSetGroupsDialog,
3 Removed: #superclass : #MFTDialog,
2 Added: #name : 'MFTSetGroupsDialog',
3 Added: #superclass : 'MFTDialog',
4 4 #instVars : [
5 5 'setGroups'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Dialog'
7 Added: #category : 'MyFitnessTracker-Dialog',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Dialog'
8 10 }
9 11
10 Removed: { #category : #adding }
12 Added: { #category : 'adding' }
11 13 MFTSetGroupsDialog >> addExercise [
12 14
13 15 | setGroup |
@@ -15,7 +17,7 @@
15 17 setGroup ifNotNil: [ setGroups add: setGroup ]
16 18 ]
17 19
18 Removed: { #category : #rendering }
20 Added: { #category : 'rendering' }
19 21 MFTSetGroupsDialog >> editSetGroup: aMFTSetGroup [
20 22
21 23 | oldSetGroup newSetGroup |
@@ -25,14 +27,14 @@
25 27 setGroups at: (setGroups indexOf: oldSetGroup) put: newSetGroup ]
26 28 ]
27 29
28 Removed: { #category : #initialization }
30 Added: { #category : 'initialization' }
29 31 MFTSetGroupsDialog >> initialize [
30 32
31 33 super initialize.
32 34 setGroups := OrderedCollection new
33 35 ]
34 36
35 Removed: { #category : #rendering }
37 Added: { #category : 'rendering' }
36 38 MFTSetGroupsDialog >> renderAddSetGroupButtonsOn: html [
37 39
38 40 html outlineButton
@@ -42,7 +44,7 @@
42 44 with: 'Add exercise'
43 45 ]
44 46
45 Removed: { #category : #rendering }
47 Added: { #category : 'rendering' }
46 48 MFTSetGroupsDialog >> renderContentOn: html [
47 49
48 50 self renderDialogOn: html with: [
@@ -50,25 +52,25 @@
50 52 self renderAddSetGroupButtonsOn: html ]
51 53 ]
52 54
53 Removed: { #category : #rendering }
55 Added: { #category : 'rendering' }
54 56 MFTSetGroupsDialog >> renderLoad [
55 57
56 58 ^ (setGroups flatCollect: #sets) anySatisfy: #hasLoad
57 59 ]
58 60
59 Removed: { #category : #rendering }
61 Added: { #category : 'rendering' }
60 62 MFTSetGroupsDialog >> renderRestAfter [
61 63
62 64 ^ (setGroups flatCollect: #sets) anySatisfy: #hasRestAfter
63 65 ]
64 66
65 Removed: { #category : #rendering }
67 Added: { #category : 'rendering' }
66 68 MFTSetGroupsDialog >> renderRpe [
67 69
68 70 ^ (setGroups flatCollect: #sets) anySatisfy: #hasRpe
69 71 ]
70 72
71 Removed: { #category : #rendering }
73 Added: { #category : 'rendering' }
72 74 MFTSetGroupsDialog >> renderSetGroupButtonsOn: html For: setGroup [
73 75
74 76 html buttonGroup: [
@@ -90,7 +92,7 @@
90 92 with: 'Duplicate' ]
91 93 ]
92 94
93 Removed: { #category : #rendering }
95 Added: { #category : 'rendering' }
94 96 MFTSetGroupsDialog >> renderSetGroupsRowsOn: html [
95 97
96 98 | renderLoad renderRpe renderRestAfter |
@@ -112,7 +114,7 @@
112 114 setGroup hasRestAfter ifTrue: [ html tableData: set restAfter ] ] ] ]
113 115 ]
114 116
115 Removed: { #category : #rendering }
117 Added: { #category : 'rendering' }
116 118 MFTSetGroupsDialog >> renderSetGroupsTableHeaderOn: html [
117 119
118 120 html tableHead: [
@@ -125,7 +127,7 @@
125 127 self renderRestAfter ifTrue: [ html tableHeading: 'Rest after (s) ' ] ]
126 128 ]
127 129
128 Removed: { #category : #rendering }
130 Added: { #category : 'rendering' }
129 131 MFTSetGroupsDialog >> renderSetsTableHeaderOn: html [
130 132
131 133 html tableHead: [
@@ -138,7 +140,7 @@
138 140 self renderRestAfter ifTrue: [ html tableHeading: 'Rest after (s) ' ] ]
139 141 ]
140 142
141 Removed: { #category : #rendering }
143 Added: { #category : 'rendering' }
142 144 MFTSetGroupsDialog >> renderSetsTableOn: html [
143 145
144 146 html table
@@ -148,7 +150,7 @@
148 150 self renderSetGroupsRowsOn: html ]
149 151 ]
150 152
151 Removed: { #category : #rendering }
153 Added: { #category : 'rendering' }
152 154 MFTSetGroupsDialog >> renderSubmitOn: html [
153 155
154 156 html buttonGroup: [
@@ -164,13 +166,13 @@
164 166 with: (completion ifNil: [ 'Cancel' ] ifNotNil: [ 'Skip' ]) ]
165 167 ]
166 168
167 Removed: { #category : #accessing }
169 Added: { #category : 'accessing' }
168 170 MFTSetGroupsDialog >> setGroups [
169 171
170 172 ^ setGroups
171 173 ]
172 174
173 Removed: { #category : #accessing }
175 Added: { #category : 'accessing' }
174 176 MFTSetGroupsDialog >> setGroups: anObject [
175 177
176 178 setGroups := anObject
src/MyFitnessTracker/MFTSetsDialog.class.st
index e4aa2136..bbef1b08 100644..100644
@@ -1,13 +1,15 @@
1 1 Class {
2 Removed: #name : #MFTSetsDialog,
3 Removed: #superclass : #MFTDialog,
2 Added: #name : 'MFTSetsDialog',
3 Added: #superclass : 'MFTDialog',
4 4 #instVars : [
5 5 'sets'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Dialog'
7 Added: #category : 'MyFitnessTracker-Dialog',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Dialog'
8 10 }
9 11
10 Removed: { #category : #actions }
12 Added: { #category : 'actions' }
11 13 MFTSetsDialog class >> edit: aMFTSetCollection [
12 14
13 15 ^ self new
@@ -16,7 +18,7 @@
16 18 yourself
17 19 ]
18 20
19 Removed: { #category : #actions }
21 Added: { #category : 'actions' }
20 22 MFTSetsDialog class >> edit: aMFTSetCollection withExercises: aMFTExerciseCollection [
21 23
22 24 ^ self new
@@ -27,7 +29,7 @@
27 29 yourself
28 30 ]
29 31
30 Removed: { #category : #actions }
32 Added: { #category : 'actions' }
31 33 MFTSetsDialog class >> newForExercises: aMFTExerciseCollection [
32 34
33 35 ^ self new
@@ -38,14 +40,14 @@
38 40 yourself
39 41 ]
40 42
41 Removed: { #category : #initialization }
43 Added: { #category : 'initialization' }
42 44 MFTSetsDialog >> initialize [
43 45
44 46 super initialize.
45 47 sets := OrderedCollection new
46 48 ]
47 49
48 Removed: { #category : #rendering }
50 Added: { #category : 'rendering' }
49 51 MFTSetsDialog >> renderContentOn: html [
50 52
51 53 self renderDialogOn: html with: [
@@ -83,7 +85,7 @@
83 85 value ifNotEmpty: [ set restAfter: value asNumber ] ] ] ] ] ] ]
84 86 ]
85 87
86 Removed: { #category : #delegation }
88 Added: { #category : 'delegation' }
87 89 MFTSetsDialog >> renderSubmitOn: html [
88 90
89 91 html buttonGroup: [
@@ -99,13 +101,13 @@
99 101 with: (completion ifNil: [ 'Cancel' ] ifNotNil: [ 'Skip' ]) ]
100 102 ]
101 103
102 Removed: { #category : #accessing }
104 Added: { #category : 'accessing' }
103 105 MFTSetsDialog >> sets [
104 106
105 107 ^ sets
106 108 ]
107 109
108 Removed: { #category : #accessing }
110 Added: { #category : 'accessing' }
109 111 MFTSetsDialog >> sets: anObject [
110 112
111 113 sets := anObject
src/MyFitnessTracker/MFTStringDialog.class.st
index 51903d33..5b0317ca 100644..100644
@@ -1,13 +1,15 @@
1 1 Class {
2 Removed: #name : #MFTStringDialog,
3 Removed: #superclass : #MFTDialog,
2 Added: #name : 'MFTStringDialog',
3 Added: #superclass : 'MFTDialog',
4 4 #instVars : [
5 5 'string'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Dialog'
7 Added: #category : 'MyFitnessTracker-Dialog',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Dialog'
8 10 }
9 11
10 Removed: { #category : #actions }
12 Added: { #category : 'actions' }
11 13 MFTStringDialog class >> edit: aString [
12 14
13 15 ^ self new
@@ -16,14 +18,14 @@
16 18 yourself
17 19 ]
18 20
19 Removed: { #category : #initialization }
21 Added: { #category : 'initialization' }
20 22 MFTStringDialog >> initialize [
21 23
22 24 super initialize.
23 25 string := String new
24 26 ]
25 27
26 Removed: { #category : #rendering }
28 Added: { #category : 'rendering' }
27 29 MFTStringDialog >> renderContentOn: html [
28 30
29 31 self renderDialogOn: html with: [
@@ -32,7 +34,7 @@
32 34 callback: [ :value | string := value ] ]
33 35 ]
34 36
35 Removed: { #category : #rendering }
37 Added: { #category : 'rendering' }
36 38 MFTStringDialog >> renderSubmitOn: html [
37 39
38 40 html buttonGroup: [
@@ -43,13 +45,13 @@
43 45 with: (completion ifNil: [ 'Submit' ] ifNotNil: [ 'Next' ]) ]
44 46 ]
45 47
46 Removed: { #category : #accessing }
48 Added: { #category : 'accessing' }
47 49 MFTStringDialog >> string [
48 50
49 51 ^ string
50 52 ]
51 53
52 Removed: { #category : #accessing }
54 Added: { #category : 'accessing' }
53 55 MFTStringDialog >> string: anObject [
54 56
55 57 string := anObject
src/MyFitnessTracker/MFTUser.class.st
index 8d75a29a..af67063a 100644..100644
@@ -1,6 +1,6 @@
1 1 Class {
2 Removed: #name : #MFTUser,
3 Removed: #superclass : #SBSComponent,
2 Added: #name : 'MFTUser',
3 Added: #superclass : 'SBSComponent',
4 4 #instVars : [
5 5 'id',
6 6 'username',
@@ -14,22 +14,24 @@
14 14 'workouts',
15 15 'weights'
16 16 ],
17 Removed: #category : #'MyFitnessTracker-Model'
17 Added: #category : 'MyFitnessTracker-Model',
18 Added: #package : 'MyFitnessTracker',
19 Added: #tag : 'Model'
18 20 }
19 21
20 Removed: { #category : #'as yet unclassified' }
22 Added: { #category : 'as yet unclassified' }
21 23 MFTUser class >> defaultReps [
22 24
23 25 ^ 8
24 26 ]
25 27
26 Removed: { #category : #'as yet unclassified' }
28 Added: { #category : 'as yet unclassified' }
27 29 MFTUser class >> defaultRpe [
28 30
29 31 ^ 6
30 32 ]
31 33
32 Removed: { #category : #'instance creation' }
34 Added: { #category : 'instance creation' }
33 35 MFTUser class >> newDefault [
34 36
35 37 ^ self new
@@ -42,7 +44,7 @@
42 44 weights: MFTWeight placeholderCollection
43 45 ]
44 46
45 Removed: { #category : #'instance creation' }
47 Added: { #category : 'instance creation' }
46 48 MFTUser class >> newFromDictionary: aDictionary [
47 49
48 50 ^ self new
@@ -58,19 +60,19 @@
58 60 yourself
59 61 ]
60 62
61 Removed: { #category : #accessing }
63 Added: { #category : 'accessing' }
62 64 MFTUser >> accountRegisterDateAndTime [
63 65
64 66 ^ accountRegisterDateAndTime
65 67 ]
66 68
67 Removed: { #category : #accessing }
69 Added: { #category : 'accessing' }
68 70 MFTUser >> accountRegisterDateAndTime: anObject [
69 71
70 72 accountRegisterDateAndTime := anObject
71 73 ]
72 74
73 Removed: { #category : #'as yet unclassified' }
75 Added: { #category : 'as yet unclassified' }
74 76 MFTUser >> dataDictionary [
75 77
76 78 ^ OrderedDictionary newFrom: {
@@ -81,31 +83,31 @@
81 83 ('last login date and time' -> lastLoginDateAndTime) }
82 84 ]
83 85
84 Removed: { #category : #accessing }
86 Added: { #category : 'accessing' }
85 87 MFTUser >> dateOfBirth [
86 88
87 89 ^ dateOfBirth ifNil: [ Date today ]
88 90 ]
89 91
90 Removed: { #category : #accessing }
92 Added: { #category : 'accessing' }
91 93 MFTUser >> dateOfBirth: aDate [
92 94
93 95 dateOfBirth := aDate
94 96 ]
95 97
96 Removed: { #category : #accessing }
98 Added: { #category : 'accessing' }
97 99 MFTUser >> id [
98 100
99 101 ^ id
100 102 ]
101 103
102 Removed: { #category : #accessing }
104 Added: { #category : 'accessing' }
103 105 MFTUser >> id: anObject [
104 106
105 107 id := anObject
106 108 ]
107 109
108 Removed: { #category : #initialization }
110 Added: { #category : 'initialization' }
109 111 MFTUser >> initialize [
110 112
111 113 super initialize.
@@ -120,73 +122,73 @@
120 122 weights := OrderedCollection new
121 123 ]
122 124
123 Removed: { #category : #accessing }
125 Added: { #category : 'accessing' }
124 126 MFTUser >> isLoggedIn [
125 127
126 128 ^ isLoggedIn
127 129 ]
128 130
129 Removed: { #category : #accessing }
131 Added: { #category : 'accessing' }
130 132 MFTUser >> isLoggedIn: aBoolean [
131 133
132 134 isLoggedIn := aBoolean
133 135 ]
134 136
135 Removed: { #category : #accessing }
137 Added: { #category : 'accessing' }
136 138 MFTUser >> lastLoginDateAndTime [
137 139
138 140 ^ lastLoginDateAndTime
139 141 ]
140 142
141 Removed: { #category : #accessing }
143 Added: { #category : 'accessing' }
142 144 MFTUser >> lastLoginDateAndTime: aDateAndTime [
143 145
144 146 lastLoginDateAndTime := aDateAndTime
145 147 ]
146 148
147 Removed: { #category : #accessing }
149 Added: { #category : 'accessing' }
148 150 MFTUser >> passwordHash [
149 151
150 152 ^ passwordHash
151 153 ]
152 154
153 Removed: { #category : #accessing }
155 Added: { #category : 'accessing' }
154 156 MFTUser >> passwordHash: aByteArray [
155 157
156 158 passwordHash := aByteArray
157 159 ]
158 160
159 Removed: { #category : #accessing }
161 Added: { #category : 'accessing' }
160 162 MFTUser >> passwordHashFromString: aString [
161 163
162 164 passwordHash := SHA256 new hashMessage: aString
163 165 ]
164 166
165 Removed: { #category : #accessing }
167 Added: { #category : 'accessing' }
166 168 MFTUser >> realFirstName [
167 169
168 170 ^ realFirstName
169 171 ]
170 172
171 Removed: { #category : #accessing }
173 Added: { #category : 'accessing' }
172 174 MFTUser >> realFirstName: aString [
173 175
174 176 realFirstName := aString
175 177 ]
176 178
177 Removed: { #category : #accessing }
179 Added: { #category : 'accessing' }
178 180 MFTUser >> realLastName [
179 181
180 182 ^ realLastName
181 183 ]
182 184
183 Removed: { #category : #accessing }
185 Added: { #category : 'accessing' }
184 186 MFTUser >> realLastName: aString [
185 187
186 188 realLastName := aString
187 189 ]
188 190
189 Removed: { #category : #rendering }
191 Added: { #category : 'rendering' }
190 192 MFTUser >> renderContentOn: html [
191 193
192 194 html table
@@ -209,19 +211,19 @@
209 211 html tableData: lastLoginDateAndTime ] ]
210 212 ]
211 213
212 Removed: { #category : #accessing }
214 Added: { #category : 'accessing' }
213 215 MFTUser >> username [
214 216
215 217 ^ username
216 218 ]
217 219
218 Removed: { #category : #accessing }
220 Added: { #category : 'accessing' }
219 221 MFTUser >> username: aString [
220 222
221 223 username := aString
222 224 ]
223 225
224 Removed: { #category : #accessing }
226 Added: { #category : 'accessing' }
225 227 MFTUser >> weights [
226 228
227 229 ^ self session user isLoggedIn
@@ -229,13 +231,13 @@
229 231 ifFalse: [ weights ]
230 232 ]
231 233
232 Removed: { #category : #accessing }
234 Added: { #category : 'accessing' }
233 235 MFTUser >> weights: aMFTWeightCollection [
234 236
235 237 weights := aMFTWeightCollection
236 238 ]
237 239
238 Removed: { #category : #accessing }
240 Added: { #category : 'accessing' }
239 241 MFTUser >> workouts [
240 242
241 243 ^ self session user isLoggedIn
@@ -243,7 +245,7 @@
243 245 ifFalse: [ workouts ]
244 246 ]
245 247
246 Removed: { #category : #accessing }
248 Added: { #category : 'accessing' }
247 249 MFTUser >> workouts: aMFTWorkoutCollection [
248 250
249 251 workouts := aMFTWorkoutCollection
src/MyFitnessTracker/MFTUserLandingPage.class.st
index 2bcb5128..99116f12 100644..100644
@@ -1,10 +1,12 @@
1 1 Class {
2 Removed: #name : #MFTUserLandingPage,
3 Removed: #superclass : #MFTLandingPage,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTUserLandingPage',
3 Added: #superclass : 'MFTLandingPage',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #'as yet unclassified' }
9 Added: { #category : 'as yet unclassified' }
8 10 MFTUserLandingPage >> defaultCards [
9 11
10 12 ^ {
@@ -12,7 +14,7 @@
12 14 MFTWorkoutsCard new }
13 15 ]
14 16
15 Removed: { #category : #initialization }
17 Added: { #category : 'initialization' }
16 18 MFTUserLandingPage >> initialize [
17 19
18 20 super initialize.
src/MyFitnessTracker/MFTUserTask.class.st
index 678e8f0e..1fe34e41 100644..100644
@@ -1,14 +1,16 @@
1 1 Class {
2 Removed: #name : #MFTUserTask,
3 Removed: #superclass : #WATask,
2 Added: #name : 'MFTUserTask',
3 Added: #superclass : 'WATask',
4 4 #instVars : [
5 5 'user',
6 6 'action'
7 7 ],
8 Removed: #category : #'MyFitnessTracker-Dialog'
8 Added: #category : 'MyFitnessTracker-Dialog',
9 Added: #package : 'MyFitnessTracker',
10 Added: #tag : 'Dialog'
9 11 }
10 12
11 Removed: { #category : #actions }
13 Added: { #category : 'actions' }
12 14 MFTUserTask class >> edit: aMFTUser [
13 15
14 16 ^ self new
@@ -17,19 +19,19 @@
17 19 yourself
18 20 ]
19 21
20 Removed: { #category : #accessing }
22 Added: { #category : 'accessing' }
21 23 MFTUserTask >> action [
22 24
23 25 ^ action
24 26 ]
25 27
26 Removed: { #category : #accessing }
28 Added: { #category : 'accessing' }
27 29 MFTUserTask >> action: anObject [
28 30
29 31 action := anObject
30 32 ]
31 33
32 Removed: { #category : #running }
34 Added: { #category : 'running' }
33 35 MFTUserTask >> go [
34 36
35 37 user username: (self call: (MFTStringDialog new
@@ -63,20 +65,20 @@
63 65 ifFalse: [ self answer: nil ]
64 66 ]
65 67
66 Removed: { #category : #initialization }
68 Added: { #category : 'initialization' }
67 69 MFTUserTask >> initialize [
68 70
69 71 super initialize.
70 72 user := MFTUser new
71 73 ]
72 74
73 Removed: { #category : #accessing }
75 Added: { #category : 'accessing' }
74 76 MFTUserTask >> user [
75 77
76 78 ^ user
77 79 ]
78 80
79 Removed: { #category : #accessing }
81 Added: { #category : 'accessing' }
80 82 MFTUserTask >> user: anObject [
81 83
82 84 user := anObject
src/MyFitnessTracker/MFTUtils.class.st
index 09bfb081..a436bf8c 100644..100644
@@ -1,13 +1,15 @@
1 1 Class {
2 Removed: #name : #MFTUtils,
3 Removed: #superclass : #Object,
2 Added: #name : 'MFTUtils',
3 Added: #superclass : 'Object',
4 4 #classInstVars : [
5 5 'version'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Utils'
7 Added: #category : 'MyFitnessTracker-Utils',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Utils'
8 10 }
9 11
10 Removed: { #category : #utilities }
12 Added: { #category : 'utilities' }
11 13 MFTUtils class >> createDeploymentImage: aVersion [
12 14 "TODO: simplify this whole process. Rsync already does a terrific job at compressing the image upon deployment."
13 15
@@ -39,14 +41,14 @@
39 41 SmalltalkImage current snapshot: true andQuit: true
40 42 ]
41 43
42 Removed: { #category : #'as yet unclassified' }
44 Added: { #category : 'as yet unclassified' }
43 45 MFTUtils class >> isDevelopmentImage [
44 46 "If the current MFT image has no version, it is a development version."
45 47
46 48 version ifNil: [ ^ true ] ifNotNil: [ ^ false ]
47 49 ]
48 50
49 Removed: { #category : #versions }
51 Added: { #category : 'versions' }
50 52 MFTUtils class >> version [
51 53
52 54 ^ version
src/MyFitnessTracker/MFTWeight.class.st
index 58777c83..e25d77ec 100644..100644
@@ -1,16 +1,18 @@
1 1 Class {
2 Removed: #name : #MFTWeight,
3 Removed: #superclass : #Object,
2 Added: #name : 'MFTWeight',
3 Added: #superclass : 'Object',
4 4 #instVars : [
5 5 'id',
6 6 'userId',
7 7 'date',
8 8 'value'
9 9 ],
10 Removed: #category : #'MyFitnessTracker-Model'
10 Added: #category : 'MyFitnessTracker-Model',
11 Added: #package : 'MyFitnessTracker',
12 Added: #tag : 'Model'
11 13 }
12 14
13 Removed: { #category : #accessing }
15 Added: { #category : 'accessing' }
14 16 MFTWeight class >> date: aDate [
15 17
16 18 ^ self new
@@ -18,7 +20,7 @@
18 20 yourself
19 21 ]
20 22
21 Removed: { #category : #accessing }
23 Added: { #category : 'accessing' }
22 24 MFTWeight class >> date: aDate value: aValue [
23 25
24 26 ^ self new
@@ -27,7 +29,7 @@
27 29 yourself
28 30 ]
29 31
30 Removed: { #category : #'instance creation' }
32 Added: { #category : 'instance creation' }
31 33 MFTWeight class >> newFromDictionary: aDictionary [
32 34
33 35 ^ self new
@@ -36,7 +38,7 @@
36 38 yourself
37 39 ]
38 40
39 Removed: { #category : #'as yet unclassified' }
41 Added: { #category : 'as yet unclassified' }
40 42 MFTWeight class >> placeholderCollection [
41 43
42 44 ^ OrderedCollection withAll: {
@@ -54,7 +56,7 @@
54 56 value: 93) }
55 57 ]
56 58
57 Removed: { #category : #accessing }
59 Added: { #category : 'accessing' }
58 60 MFTWeight class >> value: aValue [
59 61
60 62 ^ self new
@@ -62,56 +64,56 @@
62 64 yourself
63 65 ]
64 66
65 Removed: { #category : #accessing }
67 Added: { #category : 'accessing' }
66 68 MFTWeight >> date [
67 69
68 70 ^ date
69 71 ]
70 72
71 Removed: { #category : #accessing }
73 Added: { #category : 'accessing' }
72 74 MFTWeight >> date: aDate [
73 75
74 76 date := aDate
75 77 ]
76 78
77 Removed: { #category : #accessing }
79 Added: { #category : 'accessing' }
78 80 MFTWeight >> id [
79 81
80 82 ^ id
81 83 ]
82 84
83 Removed: { #category : #accessing }
85 Added: { #category : 'accessing' }
84 86 MFTWeight >> id: anObject [
85 87
86 88 id := anObject
87 89 ]
88 90
89 Removed: { #category : #initialization }
91 Added: { #category : 'initialization' }
90 92 MFTWeight >> initialize [
91 93
92 94 super initialize.
93 95 date := Date today
94 96 ]
95 97
96 Removed: { #category : #accessing }
98 Added: { #category : 'accessing' }
97 99 MFTWeight >> userId [
98 100
99 101 ^ userId
100 102 ]
101 103
102 Removed: { #category : #accessing }
104 Added: { #category : 'accessing' }
103 105 MFTWeight >> userId: anObject [
104 106
105 107 userId := anObject
106 108 ]
107 109
108 Removed: { #category : #evaluating }
110 Added: { #category : 'evaluating' }
109 111 MFTWeight >> value [
110 112
111 113 ^ value
112 114 ]
113 115
114 Removed: { #category : #accessing }
116 Added: { #category : 'accessing' }
115 117 MFTWeight >> value: aValue [
116 118
117 119 value := aValue asNumber
src/MyFitnessTracker/MFTWeightDialog.class.st
index ac22752d..cb258d73 100644..100644
@@ -1,13 +1,15 @@
1 1 Class {
2 Removed: #name : #MFTWeightDialog,
3 Removed: #superclass : #MFTDialog,
2 Added: #name : 'MFTWeightDialog',
3 Added: #superclass : 'MFTDialog',
4 4 #instVars : [
5 5 'weight'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Dialog'
7 Added: #category : 'MyFitnessTracker-Dialog',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Dialog'
8 10 }
9 11
10 Removed: { #category : #actions }
12 Added: { #category : 'actions' }
11 13 MFTWeightDialog class >> edit: aMFTWeight [
12 14
13 15 ^ self new
@@ -16,14 +18,14 @@
16 18 yourself
17 19 ]
18 20
19 Removed: { #category : #initialization }
21 Added: { #category : 'initialization' }
20 22 MFTWeightDialog >> initialize [
21 23
22 24 super initialize.
23 25 weight := MFTWeight new
24 26 ]
25 27
26 Removed: { #category : #rendering }
28 Added: { #category : 'rendering' }
27 29 MFTWeightDialog >> renderContentOn: html [
28 30
29 31 self renderDialogOn: html with: [
@@ -43,7 +45,7 @@
43 45 value ifNotEmpty: [ weight value: value asNumber ] ] ] ]
44 46 ]
45 47
46 Removed: { #category : #rendering }
48 Added: { #category : 'rendering' }
47 49 MFTWeightDialog >> renderSubmitOn: html [
48 50
49 51 html buttonGroup: [
@@ -60,13 +62,13 @@
60 62 with: (completion ifNil: [ 'Cancel' ] ifNotNil: [ 'Skip' ]) ]
61 63 ]
62 64
63 Removed: { #category : #accessing }
65 Added: { #category : 'accessing' }
64 66 MFTWeightDialog >> weight [
65 67
66 68 ^ weight
67 69 ]
68 70
69 Removed: { #category : #accessing }
71 Added: { #category : 'accessing' }
70 72 MFTWeightDialog >> weight: aMFTWeight [
71 73
72 74 weight := aMFTWeight
src/MyFitnessTracker/MFTWeightVsTimeGraph.class.st
index 4c9be599..41a5aa2d 100644..100644
@@ -1,10 +1,12 @@
1 1 Class {
2 Removed: #name : #MFTWeightVsTimeGraph,
3 Removed: #superclass : #MFTGraph,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTWeightVsTimeGraph',
3 Added: #superclass : 'MFTGraph',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #rendering }
9 Added: { #category : 'rendering' }
8 10 MFTWeightVsTimeGraph >> renderContentOn: html [
9 11
10 12 labels := self session user weights collect: [ :weight |
src/MyFitnessTracker/MFTWeightsCard.class.st
index bac817e5..edbff5b6 100644..100644
@@ -1,10 +1,12 @@
1 1 Class {
2 Removed: #name : #MFTWeightsCard,
3 Removed: #superclass : #MFTCard,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTWeightsCard',
3 Added: #superclass : 'MFTCard',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #adding }
9 Added: { #category : 'adding' }
8 10 MFTWeightsCard >> addWeight [
9 11
10 12 | newWeight |
@@ -19,7 +21,7 @@
19 21 ifFalse: [ self session user weights add: newWeight ]
20 22 ]
21 23
22 Removed: { #category : #rendering }
24 Added: { #category : 'rendering' }
23 25 MFTWeightsCard >> renderContentOn: html [
24 26
25 27 self renderCardOn: html with: [
@@ -44,7 +46,7 @@
44 46 html render: MFTWeightVsTimeGraph new ] ]
45 47 ]
46 48
47 Removed: { #category : #'as yet unclassified' }
49 Added: { #category : 'as yet unclassified' }
48 50 MFTWeightsCard >> viewAnalytics [
49 51
50 52 self session pageManager activePage call:
src/MyFitnessTracker/MFTWeightsListPage.class.st
index c4453acc..b40ab9fa 100644..100644
@@ -1,13 +1,15 @@
1 1 Class {
2 Removed: #name : #MFTWeightsListPage,
3 Removed: #superclass : #MFTPage,
2 Added: #name : 'MFTWeightsListPage',
3 Added: #superclass : 'MFTPage',
4 4 #instVars : [
5 5 'weights'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Components'
7 Added: #category : 'MyFitnessTracker-Components',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Components'
8 10 }
9 11
10 Removed: { #category : #adding }
12 Added: { #category : 'adding' }
11 13 MFTWeightsListPage >> addWeight [
12 14
13 15 | newWeight |
@@ -22,7 +24,7 @@
22 24 ifFalse: [ weights add: newWeight ]
23 25 ]
24 26
25 Removed: { #category : #accessing }
27 Added: { #category : 'accessing' }
26 28 MFTWeightsListPage >> editWeight: oldWeight [
27 29
28 30 | newWeight |
@@ -38,7 +40,7 @@
38 40 add: newWeight ]
39 41 ]
40 42
41 Removed: { #category : #initialization }
43 Added: { #category : 'initialization' }
42 44 MFTWeightsListPage >> initialize [
43 45
44 46 super initialize.
@@ -46,7 +48,7 @@
46 48 weights := OrderedCollection new
47 49 ]
48 50
49 Removed: { #category : #'as yet unclassified' }
51 Added: { #category : 'as yet unclassified' }
50 52 MFTWeightsListPage >> randomWittyCTA [
51 53
52 54 | listOfStrings randomString |
@@ -56,7 +58,7 @@
56 58 ^ randomString
57 59 ]
58 60
59 Removed: { #category : #accessing }
61 Added: { #category : 'accessing' }
60 62 MFTWeightsListPage >> removeWeight: aMFTWeight [
61 63
62 64 self session user isLoggedIn
@@ -64,7 +66,7 @@
64 66 ifFalse: [ weights remove: aMFTWeight ]
65 67 ]
66 68
67 Removed: { #category : #rendering }
69 Added: { #category : 'rendering' }
68 70 MFTWeightsListPage >> renderActionsButtonGroupOn: html [
69 71
70 72 html form: [
@@ -79,7 +81,7 @@
79 81 with: 'View progress' ] ]
80 82 ]
81 83
82 Removed: { #category : #rendering }
84 Added: { #category : 'rendering' }
83 85 MFTWeightsListPage >> renderContentOn: html [
84 86
85 87 weights := self session user weights sort: [ :a :b | a date > b date ].
@@ -90,7 +92,7 @@
90 92 weights ifNotEmpty: [ self renderWeightsAsTableOn: html ] ]
91 93 ]
92 94
93 Removed: { #category : #rendering }
95 Added: { #category : 'rendering' }
94 96 MFTWeightsListPage >> renderWeightActionsButtonGroupOn: html for: aMFTWeight [
95 97
96 98 html form: [
@@ -109,7 +111,7 @@
109 111 with: 'Delete' ] ]
110 112 ]
111 113
112 Removed: { #category : #rendering }
114 Added: { #category : 'rendering' }
113 115 MFTWeightsListPage >> renderWeightsAsTableOn: html [
114 116
115 117 html table
@@ -132,7 +134,7 @@
132 134 with: weight value ] ] ]
133 135 ]
134 136
135 Removed: { #category : #adding }
137 Added: { #category : 'adding' }
136 138 MFTWeightsListPage >> viewAnalytics [
137 139
138 140 self call: (MFTAnalyticsPage for: #weights)
src/MyFitnessTracker/MFTWidget.class.st
index 8886e47b..5ea873b0 100644..100644
@@ -1,26 +1,28 @@
1 1 Class {
2 Removed: #name : #MFTWidget,
3 Removed: #superclass : #SBSComponent,
2 Added: #name : 'MFTWidget',
3 Added: #superclass : 'SBSComponent',
4 4 #instVars : [
5 5 'title'
6 6 ],
7 Removed: #category : #'MyFitnessTracker-Components'
7 Added: #category : 'MyFitnessTracker-Components',
8 Added: #package : 'MyFitnessTracker',
9 Added: #tag : 'Components'
8 10 }
9 11
10 Removed: { #category : #accessing }
12 Added: { #category : 'accessing' }
11 13 MFTWidget >> defaultDescription [
12 14
13 15 ^ 'I am a ' , self class name
14 16 ]
15 17
16 Removed: { #category : #initialization }
18 Added: { #category : 'initialization' }
17 19 MFTWidget >> initialize [
18 20
19 21 super initialize.
20 22 title := String new
21 23 ]
22 24
23 Removed: { #category : #rendering }
25 Added: { #category : 'rendering' }
24 26 MFTWidget >> renderContentOn: html [
25 27
26 28 html div: [
@@ -31,13 +33,13 @@
31 33 html paragraph: self defaultDescription ]
32 34 ]
33 35
34 Removed: { #category : #accessing }
36 Added: { #category : 'accessing' }
35 37 MFTWidget >> title [
36 38
37 39 ^ title
38 40 ]
39 41
40 Removed: { #category : #accessing }
42 Added: { #category : 'accessing' }
41 43 MFTWidget >> title: aString [
42 44
43 45 title := aString
src/MyFitnessTracker/MFTWorkout.class.st
index 5943c632..459e5d7e 100644..100644
@@ -1,6 +1,6 @@
1 1 Class {
2 Removed: #name : #MFTWorkout,
3 Removed: #superclass : #SBSComponent,
2 Added: #name : 'MFTWorkout',
3 Added: #superclass : 'SBSComponent',
4 4 #instVars : [
5 5 'id',
6 6 'userId',
@@ -9,10 +9,12 @@
9 9 'secondaryMuscleGroupIds',
10 10 'setGroups'
11 11 ],
12 Removed: #category : #'MyFitnessTracker-Model'
12 Added: #category : 'MyFitnessTracker-Model',
13 Added: #package : 'MyFitnessTracker',
14 Added: #tag : 'Model'
13 15 }
14 16
15 Removed: { #category : #'instance creation' }
17 Added: { #category : 'instance creation' }
16 18 MFTWorkout class >> newFromDictionary: aDictionary [
17 19
18 20 ^ self new
@@ -23,7 +25,7 @@
23 25 yourself
24 26 ]
25 27
26 Removed: { #category : #'as yet unclassified' }
28 Added: { #category : 'as yet unclassified' }
27 29 MFTWorkout class >> placeholderCollection [
28 30
29 31 | placeholderSets workout1 workout2 workout3 |
@@ -55,47 +57,47 @@
55 57 workout3 }
56 58 ]
57 59
58 Removed: { #category : #adding }
60 Added: { #category : 'adding' }
59 61 MFTWorkout >> addSetGroup: aMFTSetGroup [
60 62
61 63 setGroups add: aMFTSetGroup
62 64 ]
63 65
64 Removed: { #category : #'as yet unclassified' }
66 Added: { #category : 'as yet unclassified' }
65 67 MFTWorkout >> allSetGroupsAreRegular [
66 68
67 69 ^ self anySetGroupIsIrregular not
68 70 ]
69 71
70 Removed: { #category : #'as yet unclassified' }
72 Added: { #category : 'as yet unclassified' }
71 73 MFTWorkout >> anySetGroupIsIrregular [
72 74
73 75 ^ setGroups anySatisfy: [ :group | group isRegularSetGroup not ]
74 76 ]
75 77
76 Removed: { #category : #'as yet unclassified' }
78 Added: { #category : 'as yet unclassified' }
77 79 MFTWorkout >> anySetHasLoad [
78 80
79 81 ^ self sets anySatisfy: #hasLoad
80 82 ]
81 83
82 Removed: { #category : #'as yet unclassified' }
84 Added: { #category : 'as yet unclassified' }
83 85 MFTWorkout >> anySetHasVolume [
84 86
85 87 ^ self sets anySatisfy: #hasVolume
86 88 ]
87 89
88 Removed: { #category : #accessing }
90 Added: { #category : 'accessing' }
89 91 MFTWorkout >> date [
90 92 ^ date
91 93 ]
92 94
93 Removed: { #category : #accessing }
95 Added: { #category : 'accessing' }
94 96 MFTWorkout >> date: aDate [
95 97 date := aDate
96 98 ]
97 99
98 Removed: { #category : #'as yet unclassified' }
100 Added: { #category : 'as yet unclassified' }
99 101 MFTWorkout >> guessPrimaryMuscle [
100 102 "TODO: guess the workout's primary muscle based on the most represented primary muscle in the workout's exercises."
101 103
@@ -106,19 +108,19 @@
106 108 (groupedByMuscle at: muscle) size ]
107 109 ]
108 110
109 Removed: { #category : #accessing }
111 Added: { #category : 'accessing' }
110 112 MFTWorkout >> id [
111 113
112 114 ^ id
113 115 ]
114 116
115 Removed: { #category : #accessing }
117 Added: { #category : 'accessing' }
116 118 MFTWorkout >> id: anObject [
117 119
118 120 id := anObject
119 121 ]
120 122
121 Removed: { #category : #initialization }
123 Added: { #category : 'initialization' }
122 124 MFTWorkout >> initialize [
123 125
124 126 super initialize.
@@ -127,7 +129,7 @@
127 129 secondaryMuscleGroupIds := OrderedCollection new
128 130 ]
129 131
130 Removed: { #category : #accessing }
132 Added: { #category : 'accessing' }
131 133 MFTWorkout >> primaryMuscleGroup [
132 134
133 135 ^ MFTSQLite3Database allMuscleGroups
@@ -135,19 +137,19 @@
135 137 ifNone: [ nil ]
136 138 ]
137 139
138 Removed: { #category : #accessing }
140 Added: { #category : 'accessing' }
139 141 MFTWorkout >> primaryMuscleGroupId [
140 142
141 143 ^ primaryMuscleGroupId
142 144 ]
143 145
144 Removed: { #category : #accessing }
146 Added: { #category : 'accessing' }
145 147 MFTWorkout >> primaryMuscleGroupId: anInteger [
146 148
147 149 primaryMuscleGroupId := anInteger
148 150 ]
149 151
150 Removed: { #category : #rendering }
152 Added: { #category : 'rendering' }
151 153 MFTWorkout >> renderContentOn: html [
152 154
153 155 html definitionList: [
@@ -166,7 +168,7 @@
166 168 setGroups ifNotEmpty: [ self renderSetGroupsTableOn: html ]
167 169 ]
168 170
169 Removed: { #category : #rendering }
171 Added: { #category : 'rendering' }
170 172 MFTWorkout >> renderSetGroupRowsOn: html [
171 173
172 174 | renderSetGroupsType renderLoad renderVolume |
@@ -206,7 +208,7 @@
206 208 with: set volume ] ] ] ] ]
207 209 ]
208 210
209 Removed: { #category : #rendering }
211 Added: { #category : 'rendering' }
210 212 MFTWorkout >> renderSetGroupsTableFooterOn: html [
211 213
212 214 | totalReps |
@@ -224,7 +226,7 @@
224 226 with: self volume ] ]
225 227 ]
226 228
227 Removed: { #category : #rendering }
229 Added: { #category : 'rendering' }
228 230 MFTWorkout >> renderSetGroupsTableHeaderOn: html [
229 231
230 232 html tableHead: [
@@ -243,7 +245,7 @@
243 245 with: 'Volume' ] ]
244 246 ]
245 247
246 Removed: { #category : #rendering }
248 Added: { #category : 'rendering' }
247 249 MFTWorkout >> renderSetGroupsTableOn: html [
248 250
249 251 html table
@@ -254,44 +256,44 @@
254 256 self renderSetGroupsTableFooterOn: html ]
255 257 ]
256 258
257 Removed: { #category : #accessing }
259 Added: { #category : 'accessing' }
258 260 MFTWorkout >> secondaryMuscleGroupIds [
259 261
260 262 ^ secondaryMuscleGroupIds
261 263 ]
262 264
263 Removed: { #category : #accessing }
265 Added: { #category : 'accessing' }
264 266 MFTWorkout >> secondaryMuscleGroupIds: anIntegerCollection [
265 267
266 268 secondaryMuscleGroupIds := anIntegerCollection
267 269 ]
268 270
269 Removed: { #category : #'as yet unclassified' }
271 Added: { #category : 'as yet unclassified' }
270 272 MFTWorkout >> secondaryMuscleGroups [
271 273
272 274 ^ MFTSQLite3Database allMuscleGroups select: [ :group |
273 275 secondaryMuscleGroupIds includes: group id ]
274 276 ]
275 277
276 Removed: { #category : #accessing }
278 Added: { #category : 'accessing' }
277 279 MFTWorkout >> setGroups [
278 280
279 281 ^ setGroups
280 282 ]
281 283
282 Removed: { #category : #accessing }
284 Added: { #category : 'accessing' }
283 285 MFTWorkout >> setGroups: aMFTSetGroupCollection [
284 286
285 287 setGroups := aMFTSetGroupCollection
286 288 ]
287 289
288 Removed: { #category : #accessing }
290 Added: { #category : 'accessing' }
289 291 MFTWorkout >> sets [
290 292
291 293 ^ setGroups flatCollect: #sets
292 294 ]
293 295
294 Removed: { #category : #accessing }
296 Added: { #category : 'accessing' }
295 297 MFTWorkout >> sets: aMFTSetCollection [
296 298
297 299 | groups |
@@ -302,19 +304,19 @@
302 304 self setGroups: groups
303 305 ]
304 306
305 Removed: { #category : #accessing }
307 Added: { #category : 'accessing' }
306 308 MFTWorkout >> userId [
307 309
308 310 ^ userId
309 311 ]
310 312
311 Removed: { #category : #accessing }
313 Added: { #category : 'accessing' }
312 314 MFTWorkout >> userId: anObject [
313 315
314 316 userId := anObject
315 317 ]
316 318
317 Removed: { #category : #'as yet unclassified' }
319 Added: { #category : 'as yet unclassified' }
318 320 MFTWorkout >> volume [
319 321
320 322 ^ (setGroups collect: #volume) sum
src/MyFitnessTracker/MFTWorkoutTask.class.st
index cba55ca7..eae193c4 100644..100644
@@ -1,14 +1,16 @@
1 1 Class {
2 Removed: #name : #MFTWorkoutTask,
3 Removed: #superclass : #WATask,
2 Added: #name : 'MFTWorkoutTask',
3 Added: #superclass : 'WATask',
4 4 #instVars : [
5 5 'workout',
6 6 'action'
7 7 ],
8 Removed: #category : #'MyFitnessTracker-Dialog'
8 Added: #category : 'MyFitnessTracker-Dialog',
9 Added: #package : 'MyFitnessTracker',
10 Added: #tag : 'Dialog'
9 11 }
10 12
11 Removed: { #category : #actions }
13 Added: { #category : 'actions' }
12 14 MFTWorkoutTask class >> edit: aMFTWorkout [
13 15
14 16 ^ self new
@@ -17,19 +19,19 @@
17 19 yourself
18 20 ]
19 21
20 Removed: { #category : #accessing }
22 Added: { #category : 'accessing' }
21 23 MFTWorkoutTask >> action [
22 24
23 25 ^ action
24 26 ]
25 27
26 Removed: { #category : #accessing }
28 Added: { #category : 'accessing' }
27 29 MFTWorkoutTask >> action: anObject [
28 30
29 31 action := anObject
30 32 ]
31 33
32 Removed: { #category : #running }
34 Added: { #category : 'running' }
33 35 MFTWorkoutTask >> go [
34 36
35 37 | primaryMuscleGroup secondaryMuscleGroups |
@@ -68,7 +70,7 @@
68 70 ifFalse: [ self answer: nil ]
69 71 ]
70 72
71 Removed: { #category : #initialization }
73 Added: { #category : 'initialization' }
72 74 MFTWorkoutTask >> initialize [
73 75
74 76 super initialize.
@@ -76,7 +78,7 @@
76 78 action := #add
77 79 ]
78 80
79 Removed: { #category : #'as yet unclassified' }
81 Added: { #category : 'as yet unclassified' }
80 82 MFTWorkoutTask >> updateSetsAttributes [
81 83
82 84 workout setGroups doWithIndex: [ :setGroup :i |
@@ -86,13 +88,13 @@
86 88 number: j ] ]
87 89 ]
88 90
89 Removed: { #category : #accessing }
91 Added: { #category : 'accessing' }
90 92 MFTWorkoutTask >> workout [
91 93
92 94 ^ workout
93 95 ]
94 96
95 Removed: { #category : #accessing }
97 Added: { #category : 'accessing' }
96 98 MFTWorkoutTask >> workout: anObject [
97 99
98 100 workout := anObject
src/MyFitnessTracker/MFTWorkoutVolumePerWeekGraph.class.st
index a69eed2d..3f0cf3ad 100644..100644
@@ -1,10 +1,12 @@
1 1 Class {
2 Removed: #name : #MFTWorkoutVolumePerWeekGraph,
3 Removed: #superclass : #MFTGraph,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTWorkoutVolumePerWeekGraph',
3 Added: #superclass : 'MFTGraph',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #'as yet unclassified' }
9 Added: { #category : 'as yet unclassified' }
8 10 MFTWorkoutVolumePerWeekGraph >> crunchTheNumbers [
9 11 "TODO: not working at all!"
10 12
@@ -21,14 +23,14 @@
21 23 , '},' ]
22 24 ]
23 25
24 Removed: { #category : #initialization }
26 Added: { #category : 'initialization' }
25 27 MFTWorkoutVolumePerWeekGraph >> initialize [
26 28
27 29 super initialize.
28 30 self crunchTheNumbers
29 31 ]
30 32
31 Removed: { #category : #rendering }
33 Added: { #category : 'rendering' }
32 34 MFTWorkoutVolumePerWeekGraph >> renderContentOn: html [
33 35
34 36 html canvas id: 'workoutVolumePerWeekChart'.
src/MyFitnessTracker/MFTWorkoutVolumeVsTimeGraph.class.st
index e6845607..78f6f573 100644..100644
@@ -1,10 +1,12 @@
1 1 Class {
2 Removed: #name : #MFTWorkoutVolumeVsTimeGraph,
3 Removed: #superclass : #MFTGraph,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTWorkoutVolumeVsTimeGraph',
3 Added: #superclass : 'MFTGraph',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #rendering }
9 Added: { #category : 'rendering' }
8 10 MFTWorkoutVolumeVsTimeGraph >> renderContentOn: html [
9 11
10 12 | workouts |
src/MyFitnessTracker/MFTWorkoutsCard.class.st
index d17728a8..e4722050 100644..100644
@@ -1,10 +1,12 @@
1 1 Class {
2 Removed: #name : #MFTWorkoutsCard,
3 Removed: #superclass : #MFTCard,
4 Removed: #category : #'MyFitnessTracker-Components'
2 Added: #name : 'MFTWorkoutsCard',
3 Added: #superclass : 'MFTCard',
4 Added: #category : 'MyFitnessTracker-Components',
5 Added: #package : 'MyFitnessTracker',
6 Added: #tag : 'Components'
5 7 }
6 8
7 Removed: { #category : #adding }
9 Added: { #category : 'adding' }
8 10 MFTWorkoutsCard >> addWorkout [
9 11
10 12 | newWorkout |
@@ -17,7 +19,7 @@
17 19 ifFalse: [ self session user workouts add: newWorkout ]
18 20 ]
19 21
20 Removed: { #category : #rendering }
22 Added: { #category : 'rendering' }
21 23 MFTWorkoutsCard >> renderContentOn: html [
22 24
23 25 self renderCardOn: html with: [
@@ -43,7 +45,7 @@
43 45 html render: MFTRepsDistributionGraph new ] ]
44 46 ]
45 47
46 Removed: { #category : #adding }
48 Added: { #category : 'adding' }
47 49 MFTWorkoutsCard >> viewAnalytics [
48 50
49 51 self session pageManager activePage call:
src/MyFitnessTracker/MFTWorkoutsListPage.class.st
index 4dfb50dc..aeaed5b3 100644..100644
@@ -22,15 +22,17 @@
22 22 Implementation Points
23 23 "
24 24 Class {
25 Removed: #name : #MFTWorkoutsListPage,
26 Removed: #superclass : #MFTPage,
25 Added: #name : 'MFTWorkoutsListPage',
26 Added: #superclass : 'MFTPage',
27 27 #instVars : [
28 28 'workouts'
29 29 ],
30 Removed: #category : #'MyFitnessTracker-Components'
30 Added: #category : 'MyFitnessTracker-Components',
31 Added: #package : 'MyFitnessTracker',
32 Added: #tag : 'Components'
31 33 }
32 34
33 Removed: { #category : #adding }
35 Added: { #category : 'adding' }
34 36 MFTWorkoutsListPage >> addWorkout [
35 37
36 38 | newWorkout |
@@ -42,13 +44,13 @@
42 44 ifFalse: [ workouts add: newWorkout ]
43 45 ]
44 46
45 Removed: { #category : #hooks }
47 Added: { #category : 'hooks' }
46 48 MFTWorkoutsListPage >> children [
47 49
48 50 ^ self session user workouts
49 51 ]
50 52
51 Removed: { #category : #accessing }
53 Added: { #category : 'accessing' }
52 54 MFTWorkoutsListPage >> confirmDelete: workout [
53 55
54 56 (self call: (MFTConfirmDialog delete: workout)) ifFalse: [ ^ self ].
@@ -57,7 +59,7 @@
57 59 ifFalse: [ workouts remove: workout ]
58 60 ]
59 61
60 Removed: { #category : #'as yet unclassified' }
62 Added: { #category : 'as yet unclassified' }
61 63 MFTWorkoutsListPage >> editWorkout: oldWorkout [
62 64
63 65 | newWorkout |
@@ -72,7 +74,7 @@
72 74 add: newWorkout ]
73 75 ]
74 76
75 Removed: { #category : #initialization }
77 Added: { #category : 'initialization' }
76 78 MFTWorkoutsListPage >> initialize [
77 79
78 80 super initialize.
@@ -80,7 +82,7 @@
80 82 workouts := OrderedCollection new
81 83 ]
82 84
83 Removed: { #category : #'as yet unclassified' }
85 Added: { #category : 'as yet unclassified' }
84 86 MFTWorkoutsListPage >> randomWittyCTA [
85 87
86 88 | listOfStrings randomString |
@@ -90,7 +92,7 @@
90 92 ^ randomString
91 93 ]
92 94
93 Removed: { #category : #rendering }
95 Added: { #category : 'rendering' }
94 96 MFTWorkoutsListPage >> renderActionsButtonGroupOn: html [
95 97
96 98 html form: [
@@ -105,7 +107,7 @@
105 107 with: 'View progress' ] ]
106 108 ]
107 109
108 Removed: { #category : #rendering }
110 Added: { #category : 'rendering' }
109 111 MFTWorkoutsListPage >> renderContentOn: html [
110 112
111 113 workouts := self session user workouts sort: [ :a :b |
@@ -117,7 +119,7 @@
117 119 workouts ifNotEmpty: [ self renderWorkoutsAsAccordionOn: html ] ]
118 120 ]
119 121
120 Removed: { #category : #rendering }
122 Added: { #category : 'rendering' }
121 123 MFTWorkoutsListPage >> renderWorkoutActionsButtonGroup: html for: workout [
122 124
123 125 html form: [
@@ -132,7 +134,7 @@
132 134 with: 'Delete' ] ]
133 135 ]
134 136
135 Removed: { #category : #rendering }
137 Added: { #category : 'rendering' }
136 138 MFTWorkoutsListPage >> renderWorkoutsAsAccordionOn: html [
137 139
138 140 html accordion
@@ -163,7 +165,7 @@
163 165 self renderWorkoutActionsButtonGroup: html for: workout ] ] ] ] ]
164 166 ]
165 167
166 Removed: { #category : #adding }
168 Added: { #category : 'adding' }
167 169 MFTWorkoutsListPage >> viewAnalytics [
168 170
169 171 self call: (MFTAnalyticsPage for: #workouts)
src/MyFitnessTracker/package.st
index 854c0e17..dda91b0f 100644..100644
@@ -1,1 +1,1 @@
1 Removed: Package { #name : #MyFitnessTracker }
1 Added: Package { #name : 'MyFitnessTracker' }