github.com/pojntfx/hydrapp/hydrapp@v0.0.0-20240516002902-d08759d6ca9f/pkg/generators/index_vanillajs_forms.html.tpl (about) 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8" /> 5 <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 6 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 7 <meta name="color-scheme" content="light dark"> 8 <title>{{ .AppName }}</title> 9 </head> 10 <body> 11 <h1>{{ .AppName }}</h1> 12 13 <h2>Create a new task</h2> 14 15 <form action="/create" method="post"> 16 <label for="title">Title</label> 17 <br /> 18 <input type="text" name="title" id="title" required /> 19 <br /> 20 21 <label for="body">Body</label> 22 <br /> 23 <textarea type="text" name="body" id="body" required></textarea> 24 <br /> 25 26 <input type="submit" value="Create task" /> 27 </form> 28 29 <h2>All tasks</h2> 30 31 {{"{{"}} if gt (len .Todos) 0 {{"}}"}} 32 <ul> 33 {{"{{"}} range $id, $todo := .Todos {{"}}"}} 34 <li> 35 <h3>{{"{{"}} $todo.Title {{"}}"}}</h3> 36 <p>{{"{{"}} $todo.Body {{"}}"}}</p> 37 38 <form action="/delete?id={{"{{"}} $id {{"}}"}}" method="post"> 39 <input type="submit" value="Delete task" /> 40 </form> 41 </li> 42 {{"{{"}} 43 end 44 {{"}}"}} 45 </ul> 46 {{"{{"}} else {{"}}"}} 47 <span>No tasks yet.</span> 48 {{"{{"}} end {{"}}"}} 49 50 <footer> 51 <p> 52 <code> 53 Rendered by Go {{"{{"}} .GoVersion {{"}}"}} {{"{{"}} .GoOS {{"}}"}}/{{"{{"}} .GoArch {{"}}"}} at 54 {{"{{"}} 55 .RenderTime {{"}}"}} 56 </code> 57 </p> 58 </footer> 59 </body> 60 </html>