WIP on htmx 4 integration (#60)
This commit is contained in:
@@ -138,8 +138,8 @@ let userList (model: WebLogUser list) app =
|
||||
if app.IsAdministrator || (app.IsWebLogAdmin && not (user.AccessLevel = Administrator)) then
|
||||
let userUrl = relUrl app $"admin/settings/user/{user.Id}"
|
||||
small [] [
|
||||
a [ _href $"{userUrl}/edit"; _hxTarget $"#user_{user.Id}"
|
||||
_hxSwap $"{HxSwap.InnerHtml} show:#user_{user.Id}:top" ] [
|
||||
a [ _href $"{userUrl}/edit"; _hxBoost; _hxTarget $"#user_{user.Id}"
|
||||
_hxSwap $"{HxSwap.InnerHtml} show:top showTarget:#user_{user.Id}" ] [
|
||||
raw "Edit"
|
||||
]
|
||||
if app.UserId.Value <> user.Id then
|
||||
@@ -168,7 +168,7 @@ let userList (model: WebLogUser list) app =
|
||||
]
|
||||
]
|
||||
div [ _id "user_panel" ] [
|
||||
a [ _href (relUrl app "admin/settings/user/new/edit"); _class "btn btn-primary btn-sm mb-3"
|
||||
a [ _href (relUrl app "admin/settings/user/new/edit"); _hxBoost; _class "btn btn-primary btn-sm mb-3"
|
||||
_hxTarget "#user_new" ] [
|
||||
raw "Add a New User"
|
||||
]
|
||||
@@ -187,7 +187,8 @@ let userList (model: WebLogUser list) app =
|
||||
div [ _class "row mwl-table-detail"; _id "user_new" ] []
|
||||
]
|
||||
List.map userDetail model
|
||||
|> div [ _class "container g-0"; _hxTarget "#user_panel"; _hxSwap $"{HxSwap.OuterHtml} show:window:top" ]
|
||||
|> div [ _class "container g-0"; hxInherited (_hxTarget "#user_panel")
|
||||
hxInherited (_hxSwap $"{HxSwap.OuterHtml} show:top showTarget:window") ]
|
||||
]
|
||||
]
|
||||
|> List.singleton
|
||||
@@ -197,7 +198,7 @@ let userList (model: WebLogUser list) app =
|
||||
let myInfo (model: EditMyInfoModel) (user: WebLogUser) app = [
|
||||
h2 [ _class "my-3" ] [ txt app.PageTitle ]
|
||||
article [] [
|
||||
form [ _action (relUrl app "admin/my-info"); _method "post" ] [
|
||||
form [ _action (relUrl app "admin/my-info"); _method "post"; _hxBoost ] [
|
||||
antiCsrf app
|
||||
div [ _class "d-flex flex-row flex-wrap justify-content-around" ] [
|
||||
div [ _class "text-center mb-3 lh-sm" ] [
|
||||
|
||||
Reference in New Issue
Block a user