navbar_editor.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {{ define "patch_navbar_editor" }}
  2. <form hx-encoding='multipart/form-data' hx-patch='/admin/navbar'
  3. _='on htmx:xhr:progress(loaded, total) set #progress.value to (loaded/total)*100'>
  4. {{ end }}
  5. {{ define "post_navbar_editor" }}
  6. <form hx-encoding='multipart/form-data' hx-post='/admin/navbar'
  7. _='on htmx:xhr:progress(loaded, total) set #progress.value to (loaded/total)*100'>
  8. {{ end }}
  9. {{ define "navbar_editor" }}
  10. <!DOCTYPE html>
  11. <html lang="en">
  12. <div class="container-fluid p-2 position-relative"
  13. style="width: 80vw; max-width: 80%; background-color: rgb(22, 22, 22);">
  14. <div class="container">
  15. <div class="row">
  16. <div class="col-sm"></div>
  17. <div class="container position-relative">
  18. <a style="color: white; height: fit-content; font-size: xx-large; font-weight: bold; font-family: monospace;">Editing/Making navbar item</a>
  19. <div class="col m-5">
  20. {{ if $.Post }}
  21. {{ template "post_navbar_editor" }}
  22. {{ else }}
  23. {{ template "patch_navbar_editor" }}
  24. {{ end }}
  25. <div class="row"
  26. style="background-color: rgb(22, 22, 22); color: white; height: fit-content; font-size: larger; font-family: monospace;">
  27. <a>Redirect to:</a>
  28. <textarea name="redirect"
  29. style="background-color: rgb(73, 73, 73); color: white;">{{ .Redirect }}</textarea>
  30. </div>
  31. <div class="row container p-2 m-2">
  32. <a>Add PNG:</a>
  33. <input type='file' name='file'>
  34. </div>
  35. <button type="submit">Send</button><div id="response"></div>
  36. </form>
  37. </div>
  38. </div>
  39. <div class="col-sm"></div>
  40. </div>
  41. </div>
  42. </div>
  43. </html>
  44. {{ end }}