WIP on htmx 4; user messages now work (#60)
This commit is contained in:
@@ -13,7 +13,7 @@ let edit (model: EditUserModel) app =
|
||||
div [ _class "col-12" ] [
|
||||
h5 [ _class "my-3" ] [ txt app.PageTitle ]
|
||||
form [ _hxPost (relUrl app "admin/settings/user/save"); _method "post"; _class "container"
|
||||
_hxTarget "#user_panel"; _hxSwap $"{HxSwap.OuterHtml} show:window:top" ] [
|
||||
_hxTarget "#user_panel"; _hxSwap $"{HxSwap.OuterHtml} show:top showTarget:window" ] [
|
||||
antiCsrf app
|
||||
input [ _type "hidden"; _name "Id"; _value model.Id ]
|
||||
div [ _class "row" ] [
|
||||
@@ -97,7 +97,7 @@ let edit (model: EditUserModel) app =
|
||||
let logOn (model: LogOnModel) (app: AppViewContext) = [
|
||||
h2 [ _class "my-3" ] [ rawText "Log On to "; encodedText app.WebLog.Name ]
|
||||
article [ _class "py-3" ] [
|
||||
form [ _action (relUrl app "user/log-on"); _method "post"; _class "container"; _hxPushUrl "true" ] [
|
||||
form [ _action (relUrl app "user/log-on"); _method "post"; _hxBoost; _class "container" ] [
|
||||
antiCsrf app
|
||||
if Option.isSome model.ReturnTo then input [ _type "hidden"; _name "ReturnTo"; _value model.ReturnTo.Value ]
|
||||
div [ _class "row" ] [
|
||||
|
||||
@@ -70,8 +70,8 @@ let categoryList includeNew app = [
|
||||
a [ _href (relUrl app $"category/{cat.Slug}"); _target "_blank" ] [
|
||||
raw $"View { cat.PostCount} Post"; if cat.PostCount <> 1 then raw "s"
|
||||
]; actionSpacer
|
||||
a [ _href $"{catUrl}/edit"; _hxTarget $"#cat_{cat.Id}"
|
||||
_hxSwap $"{HxSwap.InnerHtml} show:#cat_{cat.Id}:top" ] [
|
||||
a [ _href $"{catUrl}/edit"; _hxBoost; _hxTarget $"#cat_{cat.Id}"
|
||||
_hxSwap $"{HxSwap.InnerHtml} show:top showTarget:#cat_{cat.Id}" ] [
|
||||
raw "Edit"
|
||||
]; actionSpacer
|
||||
a [ _href catUrl; _hxDelete catUrl; _hxTarget "body"; _class "text-danger"
|
||||
@@ -85,11 +85,13 @@ let categoryList includeNew app = [
|
||||
]
|
||||
]
|
||||
let loadNew =
|
||||
span [ _hxGet (relUrl app "admin/category/new/edit"); _hxTrigger HxTrigger.Load; _hxSwap HxSwap.OuterHtml ] []
|
||||
span [ _hxGet (relUrl app "admin/category/new/edit"); _hxTrigger HxTrigger.Load; _hxSwap HxSwap.OuterHtml
|
||||
_hxTarget "this" ] []
|
||||
|
||||
h2 [ _class "my-3" ] [ raw app.PageTitle ]
|
||||
article [] [
|
||||
a [ _href (relUrl app "admin/category/new/edit"); _class "btn btn-primary btn-sm mb-3"; _hxTarget "#cat_new" ] [
|
||||
a [ _href (relUrl app "admin/category/new/edit"); _hxBoost; _class "btn btn-primary btn-sm mb-3"
|
||||
_hxTarget "#cat_new" ] [
|
||||
raw "Add a New Category"
|
||||
]
|
||||
div [ _id "catList"; _class "container" ] [
|
||||
@@ -118,7 +120,7 @@ let categoryList includeNew app = [
|
||||
/// The main dashboard
|
||||
let dashboard (model: DashboardModel) app = [
|
||||
h2 [ _class "my-3" ] [ txt app.WebLog.Name; raw " • Dashboard" ]
|
||||
article [ _class "container" ] [
|
||||
article [ _class "container"; hxInherited _hxBoost ] [
|
||||
div [ _class "row" ] [
|
||||
section [ _class "col-lg-5 offset-lg-1 col-xl-4 offset-xl-2 pb-3" ] [
|
||||
div [ _class "card" ] [
|
||||
@@ -193,7 +195,7 @@ let dashboard (model: DashboardModel) app = [
|
||||
let feedEdit (model: EditCustomFeedModel) (ratings: MetaItem list) (mediums: MetaItem list) app = [
|
||||
h2 [ _class "my-3" ] [ raw app.PageTitle ]
|
||||
article [] [
|
||||
form [ _action (relUrl app "admin/settings/rss/save"); _method "post"; _class "container" ] [
|
||||
form [ _action (relUrl app "admin/settings/rss/save"); _method "post"; _hxBoost; _class "container" ] [
|
||||
antiCsrf app
|
||||
input [ _type "hidden"; _name "Id"; _value model.Id ]
|
||||
div [ _class "row pb-3" ] [
|
||||
|
||||
Reference in New Issue
Block a user