From a55cfe8205d5cb2fb0948c173f23ad71d6614d13 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Sat, 27 Apr 2024 23:55:31 +0200 Subject: Rename everything to locker/lock --- view/lock.templ | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 view/lock.templ (limited to 'view/lock.templ') diff --git a/view/lock.templ b/view/lock.templ new file mode 100644 index 0000000..4dd0516 --- /dev/null +++ b/view/lock.templ @@ -0,0 +1,80 @@ +package view + +import ( + "fmt" + "stevenlr.com/locker/model" +) + +templ LockTokenForm(lock model.Lock) { +

+ + +

+} + +func renderTimeString(value int, unit string) string { + s := "" + if value > 1 { s = "s" } + return fmt.Sprint(value, " ", unit, s) +} + +templ timeButton(id model.UUID, value int, unit string) { + + +} + +templ LockInfo(lock model.Lock) { +

Lock "{ lock.Name }"

+

Start time: { lock.StartTime.AsUTCString() }

+

End time: { lock.EndTime.AsUTCString() }

+

+ Total time: + +

+

+ Remaining time: + +

+} + +templ LockView(lock model.Lock) { +

Back to list

+
+ @LockInfo(lock) +
+ if !lock.IsFinished() { +

Add time

+

+ @timeButton(lock.Id, 15, "minute") + @timeButton(lock.Id, 30, "minute") + @timeButton(lock.Id, 1, "hour") + @timeButton(lock.Id, 2, "hour") + @timeButton(lock.Id, 6, "hour") + @timeButton(lock.Id, 12, "hour") + @timeButton(lock.Id, 1, "day") + @timeButton(lock.Id, 1, "week") + @timeButton(lock.Id, 4, "week") +

+ } +

API token

+ @LockTokenForm(lock) +} + -- cgit