From 13a85f42183b7373296fa85319d33f1359feaea9 Mon Sep 17 00:00:00 2001
From: Steven Le Rouzic
Date: Tue, 16 Apr 2024 23:08:59 +0200
Subject: Timer token show & reset
---
view/timers_list_templ.go | 43 ++++++++++++++++++++++++++++---------------
1 file changed, 28 insertions(+), 15 deletions(-)
(limited to 'view/timers_list_templ.go')
diff --git a/view/timers_list_templ.go b/view/timers_list_templ.go
index 60ce8ac..b2dd78b 100644
--- a/view/timers_list_templ.go
+++ b/view/timers_list_templ.go
@@ -63,7 +63,20 @@ func timer(t model.Timer) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"closest .timer-row\">Delete
")
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"closest .timer-row\" hx-confirm=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var5 string
+ templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprint("Are you sure you want to delete timer \"", t.Name, "\"?"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view\timers_list.templ`, Line: 16, Col: 86}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">Delete")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -82,21 +95,21 @@ func TimerCreateForm(timerName string, err string) templ.Component {
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Var5 := templ.GetChildren(ctx)
- if templ_7745c5c3_Var5 == nil {
- templ_7745c5c3_Var5 = templ.NopComponent
+ templ_7745c5c3_Var6 := templ.GetChildren(ctx)
+ if templ_7745c5c3_Var6 == nil {
+ templ_7745c5c3_Var6 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("