diff options
Diffstat (limited to 'repgoal.hs')
-rwxr-xr-x | repgoal.hs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -163,9 +163,10 @@ annotatePosition (x:xs) = (FirstInList, x) : annotateRest xs | |||
163 | annotateRest (x:xs) = (MiddleInList, x) : annotateRest xs | 163 | annotateRest (x:xs) = (MiddleInList, x) : annotateRest xs |
164 | 164 | ||
165 | drawUI :: St -> [Widget ()] | 165 | drawUI :: St -> [Widget ()] |
166 | drawUI st = [vCenter $ vBox [hCenter oneRepMaxTable, withVScrollBarHandles $ withVScrollBars OnRight $ viewport () Vertical $ hCenter lastSetTable]] | 166 | drawUI st = [vCenter $ vBox [hCenter oneRepMaxTable, header, withVScrollBarHandles $ withVScrollBars OnRight $ viewport () Vertical $ hCenter lastSetTable]] |
167 | where | 167 | where |
168 | lastSetTable = renderTable $ table $ map (padLeftRight 1 . str) ["Lift", "Set", "Goal"] : concatMap (toLiftRows (view week st)) (view lifts st) | 168 | lastSetTable = renderTable $ table $ map (padLeftRight 1 . str) ["Lift", "Set", "Goal"] : concatMap (toLiftRows (view week st)) (view lifts st) |
169 | header = str $ "Week " ++ case (view week st) of Week1 -> "1"; Week2 -> "2"; Week3 -> "3" | ||
169 | oneRepMaxTable = renderTable $ table $ map (padLeftRight 1 . str) ["Lift", "Achieved Best", "Computed 1RM"] : map toRow (view lifts st) | 170 | oneRepMaxTable = renderTable $ table $ map (padLeftRight 1 . str) ["Lift", "Achieved Best", "Computed 1RM"] : map toRow (view lifts st) |
170 | toRow LiftRecord{..} = | 171 | toRow LiftRecord{..} = |
171 | let best@Achieved{..} = bestPerformance stats | 172 | let best@Achieved{..} = bestPerformance stats |
@@ -191,7 +192,6 @@ drawUI st = [vCenter $ vBox [hCenter oneRepMaxTable, withVScrollBarHandles $ wit | |||
191 | [ | 192 | [ |
192 | -- txt $ if position == FirstInList then liftName else " ", | 193 | -- txt $ if position == FirstInList then liftName else " ", |
193 | txt $ case position of FirstInList -> liftName; LastInList -> " \n "; _ -> " ", | 194 | txt $ case position of FirstInList -> liftName; LastInList -> " \n "; _ -> " ", |
194 | -- txt $ case week of Week1 -> "1"; Week2 -> "2"; Week3 -> "3", | ||
195 | str $ printf "%2d%s @ %d%s" targetReps (if position == LastInList then "+" else "" :: Text) targetWeight (if position == LastInList then "\n " else "" :: String), | 195 | str $ printf "%2d%s @ %d%s" targetReps (if position == LastInList then "+" else "" :: Text) targetWeight (if position == LastInList then "\n " else "" :: String), |
196 | str $ if position /= LastInList then " " else showGoal repGoal ++ "\n" ++ showGoal (repGoal + 1) | 196 | str $ if position /= LastInList then " " else showGoal repGoal ++ "\n" ++ showGoal (repGoal + 1) |
197 | -- str $ if position /= LastInList then " " else showGoal repGoal, | 197 | -- str $ if position /= LastInList then " " else showGoal repGoal, |