implemented editAwayStandings
This commit is contained in:
parent
49963277be
commit
9c7c295a4b
|
@ -22,7 +22,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
module Mtlstats.Actions.EditStandings
|
module Mtlstats.Actions.EditStandings
|
||||||
( editStandings
|
( editStandings
|
||||||
, editHomeStandings
|
, editHomeStandings
|
||||||
, editRoadStandings
|
, editAwayStandings
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Lens.Micro ((.~))
|
import Lens.Micro ((.~))
|
||||||
|
@ -38,5 +38,5 @@ editHomeStandings :: ProgState -> ProgState
|
||||||
editHomeStandings = progMode .~ EditStandings ESMHome
|
editHomeStandings = progMode .~ EditStandings ESMHome
|
||||||
|
|
||||||
-- | Edits the road standings
|
-- | Edits the road standings
|
||||||
editRoadStandings :: ProgState -> ProgState
|
editAwayStandings :: ProgState -> ProgState
|
||||||
editRoadStandings = undefined
|
editAwayStandings = progMode .~ EditStandings ESMAway
|
||||||
|
|
|
@ -36,10 +36,14 @@ editStandingsC :: EditStandingsMode -> Controller
|
||||||
editStandingsC = \case
|
editStandingsC = \case
|
||||||
ESMMenu -> menuControllerWith header editStandingsMenu
|
ESMMenu -> menuControllerWith header editStandingsMenu
|
||||||
ESMHome -> editHomeStandingsC
|
ESMHome -> editHomeStandingsC
|
||||||
|
ESMAway -> editAwayStandingsC
|
||||||
|
|
||||||
editHomeStandingsC :: Controller
|
editHomeStandingsC :: Controller
|
||||||
editHomeStandingsC = undefined
|
editHomeStandingsC = undefined
|
||||||
|
|
||||||
|
editAwayStandingsC :: Controller
|
||||||
|
editAwayStandingsC = undefined
|
||||||
|
|
||||||
header :: ProgState -> C.Update ()
|
header :: ProgState -> C.Update ()
|
||||||
header = do
|
header = do
|
||||||
db <- (^.database)
|
db <- (^.database)
|
||||||
|
|
|
@ -32,7 +32,7 @@ editStandingsMenu = Menu "*** EDIT STANDINGS ***" ()
|
||||||
[ MenuItem '1' "Edit home standings" $
|
[ MenuItem '1' "Edit home standings" $
|
||||||
modify editHomeStandings
|
modify editHomeStandings
|
||||||
, MenuItem '2' "Edit road standings" $
|
, MenuItem '2' "Edit road standings" $
|
||||||
modify editRoadStandings
|
modify editAwayStandings
|
||||||
, MenuItem 'R' "Return to main menu" $
|
, MenuItem 'R' "Return to main menu" $
|
||||||
modify backHome
|
modify backHome
|
||||||
]
|
]
|
||||||
|
|
|
@ -397,6 +397,7 @@ data EditGoalieMode
|
||||||
data EditStandingsMode
|
data EditStandingsMode
|
||||||
= ESMMenu
|
= ESMMenu
|
||||||
| ESMHome
|
| ESMHome
|
||||||
|
| ESMAway
|
||||||
deriving (Eq, Show)
|
deriving (Eq, Show)
|
||||||
|
|
||||||
-- | Represents the database
|
-- | Represents the database
|
||||||
|
|
|
@ -47,4 +47,5 @@ spec = describe "EditStandings" $ mapM_
|
||||||
-- label, function, expected mode
|
-- label, function, expected mode
|
||||||
[ ( "editStandings", editStandings, ESMMenu )
|
[ ( "editStandings", editStandings, ESMMenu )
|
||||||
, ( "editHomeStandings", editHomeStandings, ESMHome )
|
, ( "editHomeStandings", editHomeStandings, ESMHome )
|
||||||
|
, ( "editAwayStandings", editAwayStandings, ESMAway )
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user