[Pharo] Personal fitness tracker web app.
Updated MFTArticle subclasses, following the great SQLite3 update.
Changed files
src/MyFitnessTracker/MFTArticle.class.st
@@ -9,6 +9,13 @@
9
9
#tag : 'Components'
10
10
}
11
11
12
Added:
{ #category : 'rendering' }
13
Added:
MFTArticle >> renderArticleOn: html with: aBlock [
14
Added:
15
Added:
html heading: title capitalized.
16
Added:
html render: aBlock
17
Added:
]
18
Added:
12
19
{ #category : 'accessing' }
13
20
MFTArticle >> title [
14
21
src/MyFitnessTracker/MFTAthletesArticle.class.st
@@ -13,13 +13,14 @@
13
13
MFTAthletesArticle >> initialize [
14
14
15
15
super initialize.
16
Removed:
title := 'Athletes'.
17
Removed:
athletes := { MFTMikeMentzer new}
16
Added:
title := 'athletes'.
17
Added:
athletes := { MFTMikeMentzer new }
18
18
]
19
19
20
20
{ #category : 'rendering' }
21
21
MFTAthletesArticle >> renderContentOn: html [
22
22
23
Removed:
html heading: title.
24
Removed:
athletes do: [ :athlete | athlete renderContentOn: html ]
23
Added:
self
24
Added:
renderArticleOn: html
25
Added:
with: [ athletes do: [ :athlete | athlete renderContentOn: html ] ]
25
26
]
src/MyFitnessTracker/MFTLearnPage.class.st
@@ -25,26 +25,11 @@
25
25
MFTLearnPage >> renderContentOn: html [
26
26
27
27
self renderPageOn: html with: [
28
Removed:
html breadcrumb: [
29
Removed:
html breadcrumbItem: [
30
Removed:
html anchor
31
Removed:
callback: [ self session pageManager setActivePageAt: #learn ];
32
Removed:
with: 'Home' ].
33
Removed:
html breadcrumbItem: [
34
Removed:
html anchor
35
Removed:
url: '#';
36
Removed:
with: activeArticle title ].
37
Removed:
html breadcrumbItem
38
Removed:
beActive;
39
Removed:
with: 'Data' ].
40
Removed:
html div
41
Removed:
class: 'table-of-contents';
42
Removed:
with: [
43
Removed:
html navigation flexColumn with: [
44
Removed:
articles do: [ :article |
45
Removed:
html navigationLink
46
Removed:
beActiveIf: [ activeArticle = article ];
47
Removed:
callback: [ activeArticle := article ];
48
Removed:
with: article title ] ] ].
28
Added:
html navigation flexColumn with: [
29
Added:
articles do: [ :article |
30
Added:
html navigationLink
31
Added:
beActiveIf: [ activeArticle = article ];
32
Added:
callback: [ activeArticle := article ];
33
Added:
with: article title capitalized ] ].
49
34
html render: activeArticle ]
50
35
]
src/MyFitnessTracker/MFTMusclesArticle.class.st
@@ -18,20 +18,14 @@
18
18
{ #category : 'initialization' }
19
19
MFTMusclesArticle >> initialize [
20
20
21
Removed:
| methods instances |
22
21
super initialize.
23
Removed:
title := 'Muscles'.
24
Removed:
methods := MFTMuscleGroup class methodDictionary values select: [
25
Removed:
:method | method protocolName = 'muscle group' ].
26
Removed:
instances := methods collect: [ :method |
27
Removed:
MFTMuscleGroup perform: method selector ].
28
Removed:
muscleGroups := instances sorted: [ :a :b |
29
Removed:
a englishName < b englishName ]
22
Added:
title := 'muscles'
30
23
]
31
24
32
25
{ #category : 'rendering' }
33
26
MFTMusclesArticle >> renderContentOn: html [
34
27
35
Removed:
html heading: title.
36
Removed:
muscleGroups do: [ :muscleGroup | html render: muscleGroup ]
28
Added:
self renderArticleOn: html with: [
29
Added:
MFTSQLite3Database allMuscleGroups do: [ :muscleGroup |
30
Added:
html render: muscleGroup ] ]
37
31
]