summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2022-10-23 16:47:06 -0400
committerAndrew Cady <d@jerkface.net>2022-10-23 16:47:06 -0400
commit5f536504393b216f1ee59ac38991c88e59dd511e (patch)
tree1fdc5c7f74aeda6e3c8913d1b381b430816593a5
parente1637fca91750197d93f47614919f60227c61fa4 (diff)
add done/rest columns
-rwxr-xr-xrepgoal.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/repgoal.hs b/repgoal.hs
index 96cc534..31cfdcf 100755
--- a/repgoal.hs
+++ b/repgoal.hs
@@ -170,7 +170,7 @@ drawUI :: St -> [Widget ()]
170drawUI st = [vCenter $ vBox [hCenter oneRepMaxTable, header, withVScrollBarHandles $ withVScrollBars OnRight $ viewport () Vertical $ hCenter lastSetTable]] 170drawUI st = [vCenter $ vBox [hCenter oneRepMaxTable, header, withVScrollBarHandles $ withVScrollBars OnRight $ viewport () Vertical $ hCenter lastSetTable]]
171 where 171 where
172 lifts' = filter ((flip Set.member $ view routines st & NonEmpty.head) . liftName) (view lifts st) 172 lifts' = filter ((flip Set.member $ view routines st & NonEmpty.head) . liftName) (view lifts st)
173 lastSetTable = renderTable $ table $ map (padLeftRight 1 . str) ["Lift", "Set", "Goal"] : concatMap (toLiftRows (view week st)) lifts' 173 lastSetTable = renderTable $ table $ map (padLeftRight 1 . str) ["Lift", "Set", "Goal", "Done", "Rest"] : concatMap (toLiftRows (view week st)) lifts'
174 header = str $ "Week " ++ case (view week st) of Week1 -> "1"; Week2 -> "2"; Week3 -> "3" 174 header = str $ "Week " ++ case (view week st) of Week1 -> "1"; Week2 -> "2"; Week3 -> "3"
175 oneRepMaxTable = renderTable $ table $ map (padLeftRight 1 . str) ["Lift", "Achieved Best", "Computed 1RM"] : map toRow lifts' 175 oneRepMaxTable = renderTable $ table $ map (padLeftRight 1 . str) ["Lift", "Achieved Best", "Computed 1RM"] : map toRow lifts'
176 toRow LiftRecord{..} = 176 toRow LiftRecord{..} =
@@ -198,9 +198,9 @@ drawUI st = [vCenter $ vBox [hCenter oneRepMaxTable, header, withVScrollBarHandl
198 -- txt $ if position == FirstInList then liftName else " ", 198 -- txt $ if position == FirstInList then liftName else " ",
199 txt $ case position of FirstInList -> liftName; LastInList -> " \n "; _ -> " ", 199 txt $ case position of FirstInList -> liftName; LastInList -> " \n "; _ -> " ",
200 str $ printf "%2d%s @ %d%s" targetReps (if position == LastInList then "+" else "" :: Text) targetWeight (if position == LastInList then "\n " else "" :: String), 200 str $ printf "%2d%s @ %d%s" targetReps (if position == LastInList then "+" else "" :: Text) targetWeight (if position == LastInList then "\n " else "" :: String),
201 str $ if position /= LastInList then " " else showGoal repGoal ++ "\n" ++ showGoal (repGoal + 1) 201 str $ if position /= LastInList then " " else showGoal repGoal ++ "\n" ++ showGoal (repGoal + 1),
202 -- str $ if position /= LastInList then " " else showGoal repGoal, 202 txt $ if position /= LastInList then " " else " \n ",
203 -- str $ if position /= LastInList then " " else showGoal (repGoal + 1) 203 txt $ if position /= LastInList then " " else " \n "
204 ] 204 ]
205 205
206ceilingN :: Integer -> Rational -> Integer 206ceilingN :: Integer -> Rational -> Integer