Class { #name : 'MFTPlanPage', #superclass : 'MFTPage', #category : 'MyFitnessTracker-Web-Components', #package : 'MyFitnessTracker-Web', #tag : 'Components' } { #category : 'rendering' } MFTPlanPage >> renderContentOn: html [ self renderCurrentRoutineInfoOn: html; renderMyRoutinesOn: html; renderMyWorkoutsOn: html ] { #category : 'rendering' } MFTPlanPage >> renderCurrentRoutineInfoOn: html [ | routine | routine := self session user trainee currentRoutine. html heading: 'Current routine'. html definitionList: [ html definitionTerm: 'Routine title'; definitionData: [ html anchor callback: [ self call: (MFTRoutineViewerPage forRoutine: routine) ]; with: routine canonicalName ]. html definitionTerm: 'Workouts'; definitionData: routine workouts size. html definitionTerm: 'Avg. sets per week'; definitionData: (routine averageSetsDuring: 1 week). html definitionTerm: 'Rest between workouts'; definitionData: '48 hours' ] ] { #category : 'rendering' } MFTPlanPage >> renderMyRoutinesOn: html [ html heading: 'My routines'. html anchor callback: [ | routine | routine := self call: MFTRoutineCreationTask new. routine ifNotNil: [ self session user trainee currentRoutine: routine ] ]; with: 'Create new routine' ] { #category : 'rendering' } MFTPlanPage >> renderMyWorkoutsOn: html [ html heading: 'My workouts'. html anchor callback: [ | workoutPrescription | workoutPrescription := self call: MFTWorkoutPrescriptionTask new. workoutPrescription ifNotNil: [ self session user trainee currentRoutine addWorkout: workoutPrescription ] ]; with: 'Create new workout'. self session user trainee workoutPrescriptions do: [ ] ] { #category : 'accessing' } MFTPlanPage >> title [ ^ 'Plan for ' , self session user trainee canonicalName ]