revert
This commit is contained in:
parent
df90b00ee2
commit
7262c221d4
1 changed files with 10 additions and 9 deletions
|
|
@ -67,12 +67,11 @@ func CompleteAllIcon(list []*ent.Task) *h.Element {
|
|||
return item.CompletedAt == nil
|
||||
}))
|
||||
|
||||
return h.Button(
|
||||
h.TextF("Complete %s tasks", notCompletedCount),
|
||||
h.PostPartialWithQs(CompleteAll,
|
||||
h.NewQs("complete",
|
||||
h.Ternary(notCompletedCount > 0, "true", "false"),
|
||||
)),
|
||||
return h.Div(
|
||||
h.ClassX("absolute top-0 left-0 p-4 rotate-90 text-2xl cursor-pointer", map[string]bool{
|
||||
"text-slate-400": notCompletedCount > 0,
|
||||
}), h.Text("❯"),
|
||||
h.PostPartialWithQs(CompleteAll, h.NewQs("complete", h.Ternary(notCompletedCount > 0, "true", "false"))),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -269,10 +268,12 @@ func ToggleCompleted(ctx *h.RequestContext) *h.Partial {
|
|||
|
||||
func CompleteAll(ctx *h.RequestContext) *h.Partial {
|
||||
service := tasks.NewService(ctx.ServiceLocator())
|
||||
|
||||
service.SetAllCompleted(ctx.QueryParam("complete") == "true")
|
||||
return h.SwapPartial(ctx,
|
||||
Card(ctx),
|
||||
)
|
||||
|
||||
list, _ := service.List()
|
||||
|
||||
return h.NewPartial(h.OobSwap(ctx, CardBody(list, getActiveTab(ctx))))
|
||||
}
|
||||
|
||||
func ClearCompleted(ctx *h.RequestContext) *h.Partial {
|
||||
|
|
|
|||
Loading…
Reference in a new issue