Class { #name : 'MFTRoutineViewerPage', #superclass : 'MFTPage', #instVars : [ 'routine' ], #category : 'MyFitnessTracker-Web-Components', #package : 'MyFitnessTracker-Web', #tag : 'Components' } { #category : 'as yet unclassified' } MFTRoutineViewerPage class >> forRoutine: aMFTRoutine [ ^ self new routine: aMFTRoutine; yourself ] { #category : 'rendering' } MFTRoutineViewerPage >> renderActionButtonsOn: html [ html div class: 'grid'; style: 'margin-bottom: 2rem'; with: [ html anchor class: 'outline'; attributeAt: 'role' put: 'button'; callback: [ self answer ]; with: 'Return'. html anchor class: 'secondary outline'; attributeAt: 'role' put: 'button'; callback: [ routine := (self call: (MFTRoutineCreationTask forRoutine: routine)) ifNil: [ routine ] ]; with: 'Edit' ] ] { #category : 'rendering' } MFTRoutineViewerPage >> renderContentOn: html [ self renderActionButtonsOn: html. html heading level: 1; with: routine title. routine workouts do: [ :workoutPrescription | html details attributeAt: 'name' put: 'workoutPrescriptions'; with: [ html summary: workoutPrescription title. html render: (MFTWorkoutPrescriptionTable forPrescription: workoutPrescription) ]. html horizontalRule ] ] { #category : 'accessing' } MFTRoutineViewerPage >> routine: aMFTRoutine [ routine := aMFTRoutine ] { #category : 'accessing' } MFTRoutineViewerPage >> title [ ^ routine canonicalName ]