diff options
author | William Carroll <wpcarro@gmail.com> | 2020-08-02T14·15+0100 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2020-08-02T14·15+0100 |
commit | fe609bbe5804be229a7e5c0d276654fb3e45179b (patch) | |
tree | e939713105443914e045974c89e8f3cdf0c3294c /client/src/Manager.elm | |
parent | 81c3db20d4775a115f148ed64c5bc1e54c5a3b65 (diff) |
Support CRUDing records on Admin page
TL;DR: - Prefer the more precise verbiage, "Accounts", to "Users" - Add username field to Trip instead of relying on session.username - Ensure that decodeRole can JD.fail for invalid inputs
Diffstat (limited to 'client/src/Manager.elm')
-rw-r--r-- | client/src/Manager.elm | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/client/src/Manager.elm b/client/src/Manager.elm index 7cf5dc3107c3..67cf9414374f 100644 --- a/client/src/Manager.elm +++ b/client/src/Manager.elm @@ -14,11 +14,8 @@ import Utils render : State.Model -> Html State.Msg render model = - case model.session of - Nothing -> - text "You are unauthorized to view this page." - - Just session -> + Common.withSession model + (\session -> div [ class ([ "container" @@ -30,10 +27,11 @@ render model = ] [ h1 [] [ UI.header 2 ("Welcome back, " ++ session.username ++ "!") - , UI.simpleButton + , UI.textButton { label = "Logout" , handleClick = State.AttemptLogout } , Common.allErrors model ] ] + ) |