User weight tracking component.

Commit
05bd3a0bacc2733f9becfe65a8f3fc07cf032c51
Author
Marius Peter <marius.peter@tutanota.com>
Author date
Committer
Marius Peter <marius.peter@tutanota.com>
Committer date
Changed files
src/MyFitnessTracker/MFTWeightsListComponent.class.st
index d6095f28..00000000 100644..000000
@@ -1,50 +0,0 @@
1 Removed: Class {
2 Removed: #name : #MFTWeightsListComponent,
3 Removed: #superclass : #MFTScreenComponent,
4 Removed: #instVars : [
5 Removed: 'weights'
6 Removed: ],
7 Removed: #category : #'MyFitnessTracker-Components'
8 Removed: }
9 Removed:
10 Removed: { #category : #rendering }
11 Removed: MFTWeightsListComponent class >> placeholder [
12 Removed:
13 Removed: ^ self new
14 Removed: weights: {
15 Removed: (MFTWeight value: 90).
16 Removed: (MFTWeight value: 100).
17 Removed: (MFTWeight value: 102).
18 Removed: (MFTWeight date: (Date fromString: '01/01/2024') value: 105) };
19 Removed: yourself
20 Removed: ]
21 Removed:
22 Removed: { #category : #initialization }
23 Removed: MFTWeightsListComponent >> initialize [
24 Removed:
25 Removed: super initialize.
26 Removed: weights := OrderedCollection new
27 Removed: ]
28 Removed:
29 Removed: { #category : #rendering }
30 Removed: MFTWeightsListComponent >> renderContentOn: html [
31 Removed:
32 Removed: html tbsContainer
33 Removed: class: 'weights-list';
34 Removed: with: [
35 Removed: html heading
36 Removed: level: 2;
37 Removed: with: 'Weight'.
38 Removed: html tbsTable: [
39 Removed: weights do: [ :each |
40 Removed: html tableRow: [
41 Removed: html
42 Removed: tableData: each date ddmmyyyy;
43 Removed: tableData: each value ] ] ] ]
44 Removed: ]
45 Removed:
46 Removed: { #category : #accessing }
47 Removed: MFTWeightsListComponent >> weights: aWeight [
48 Removed:
49 Removed: weights := aWeight
50 Removed: ]
src/MyFitnessTracker/MFTWeightsListTab.class.st
index 00000000..d8efa724 000000..100644
@@ -0,0 +1,58 @@
1 Added: Class {
2 Added: #name : #MFTWeightsListTab,
3 Added: #superclass : #MFTTab,
4 Added: #instVars : [
5 Added: 'weights'
6 Added: ],
7 Added: #category : #'MyFitnessTracker-Components'
8 Added: }
9 Added:
10 Added: { #category : #rendering }
11 Added: MFTWeightsListTab class >> placeholder [
12 Added:
13 Added: ^ self new
14 Added: weights: {
15 Added: (MFTWeight value: 90).
16 Added: (MFTWeight value: 100).
17 Added: (MFTWeight value: 102).
18 Added: (MFTWeight date: (Date fromString: '01/01/2024') value: 105) };
19 Added: yourself
20 Added: ]
21 Added:
22 Added: { #category : #initialization }
23 Added: MFTWeightsListTab >> initialize [
24 Added:
25 Added: super initialize.
26 Added: title := 'Weight'.
27 Added: weights := OrderedCollection new
28 Added: ]
29 Added:
30 Added: { #category : #rendering }
31 Added: MFTWeightsListTab >> renderContentOn: html [
32 Added:
33 Added: html container with: [
34 Added: html table
35 Added: class: 'table table-striped';
36 Added: with: [
37 Added: weights do: [ :each |
38 Added: html tableRow: [
39 Added: html
40 Added: tableData: each date ddmmyyyy;
41 Added: tableData: each value ] ] ].
42 Added: html form: [
43 Added: html buttonGroup: [
44 Added: html formButton
45 Added: bePrimary;
46 Added: callback: [ "Edit the weight" ];
47 Added: with: 'Edit'.
48 Added: html formButton
49 Added: beDanger;
50 Added: callback: [ nil ];
51 Added: with: 'Delete' ] ] ]
52 Added: ]
53 Added:
54 Added: { #category : #accessing }
55 Added: MFTWeightsListTab >> weights: aWeight [
56 Added:
57 Added: weights := aWeight
58 Added: ]