summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2022-10-23 15:43:03 -0400
committerAndrew Cady <d@jerkface.net>2022-10-23 15:43:03 -0400
commitf87db080eb36141247d50175a24331cc3f663902 (patch)
tree4a2a61646ccf31eb70dfff6bc1f4f0ba3c4df45e
parentd465c82d56327b30b8bb5510ec95aa530f9663e8 (diff)
header shows selected week
-rwxr-xr-xrepgoal.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/repgoal.hs b/repgoal.hs
index 8492ce8..94982f1 100755
--- a/repgoal.hs
+++ b/repgoal.hs
@@ -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
165drawUI :: St -> [Widget ()] 165drawUI :: St -> [Widget ()]
166drawUI st = [vCenter $ vBox [hCenter oneRepMaxTable, withVScrollBarHandles $ withVScrollBars OnRight $ viewport () Vertical $ hCenter lastSetTable]] 166drawUI 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,