locations.templ 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. package views
  2. import (
  3. "fmt"
  4. "github.com/pocketbase/pocketbase/core"
  5. "code.osinet.fr/fgm/jamtrack/internal/query"
  6. )
  7. // LocationList renders the locations management page with an inline add form.
  8. templ LocationList(locations []*core.Record) {
  9. @Layout("Locations") {
  10. <div class="level">
  11. <div class="level-left">
  12. <h1 class="title">Locations</h1>
  13. </div>
  14. </div>
  15. <div class="columns">
  16. <div class="column is-half">
  17. if len(locations) == 0 {
  18. <p class="has-text-grey mb-4">No locations yet.</p>
  19. } else {
  20. <table class="table is-fullwidth is-striped mb-4">
  21. <thead>
  22. <tr><th>Name</th><th>Notes</th></tr>
  23. </thead>
  24. <tbody>
  25. for _, loc := range locations {
  26. <tr>
  27. <td><a href={ templ.SafeURL("/locations/" + loc.Id) }>{ loc.GetString("name") }</a></td>
  28. <td>{ loc.GetString("notes") }</td>
  29. </tr>
  30. }
  31. </tbody>
  32. </table>
  33. }
  34. <form method="POST" action="/locations">
  35. <div class="field has-addons">
  36. <div class="control is-expanded">
  37. <input class="input" type="text" name="name" placeholder="Location name" required/>
  38. </div>
  39. <div class="control">
  40. <button class="button is-primary" type="submit">Add</button>
  41. </div>
  42. </div>
  43. <div class="field">
  44. <div class="control">
  45. <input class="input" type="text" name="notes" placeholder="Notes (optional)"/>
  46. </div>
  47. </div>
  48. </form>
  49. </div>
  50. </div>
  51. }
  52. }
  53. // LocationDetail renders a single location's jam history and per-location ranking.
  54. templ LocationDetail(loc *core.Record, jams []*core.Record, ranks []query.SongRank) {
  55. @Layout(loc.GetString("name")) {
  56. <h1 class="title">{ loc.GetString("name") }</h1>
  57. if loc.GetString("notes") != "" {
  58. <p class="subtitle is-6 has-text-grey">{ loc.GetString("notes") }</p>
  59. }
  60. <div class="columns">
  61. <div class="column">
  62. <h2 class="subtitle">Jams at this location</h2>
  63. if len(jams) == 0 {
  64. <p class="has-text-grey">No jams logged here yet.</p>
  65. } else {
  66. <table class="table is-fullwidth is-striped">
  67. <thead><tr><th>Date</th></tr></thead>
  68. <tbody>
  69. for _, j := range jams {
  70. <tr>
  71. <td><a href={ templ.SafeURL("/jams/" + j.Id) }>{ dateOnly(j.GetString("date")) }</a></td>
  72. </tr>
  73. }
  74. </tbody>
  75. </table>
  76. }
  77. </div>
  78. <div class="column">
  79. <h2 class="subtitle">Practice ranking</h2>
  80. if len(ranks) == 0 {
  81. <p class="has-text-grey">No songs played here yet.</p>
  82. } else {
  83. <table class="table is-fullwidth is-striped">
  84. <thead>
  85. <tr><th>Artist</th><th>Title</th><th class="has-text-right">Played</th></tr>
  86. </thead>
  87. <tbody>
  88. for _, r := range ranks {
  89. <tr>
  90. <td>{ r.Artist }</td>
  91. <td>{ r.Title }</td>
  92. <td class="has-text-right">{ fmt.Sprint(r.PlayedCount) }</td>
  93. </tr>
  94. }
  95. </tbody>
  96. </table>
  97. }
  98. </div>
  99. </div>
  100. }
  101. }
PANIC: session(release): write data/sessions/2/f/2f521ea44690d244: no space left on device

PANIC

session(release): write data/sessions/2/f/2f521ea44690d244: no space left on device
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/session@v1.0.3/session.go:204 (0xb13e07)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/context.go:80 (0x967b75)
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/inject@v0.0.0-20200308113650-138e5925c53b/inject.go:157 (0x9512ee)
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/inject@v0.0.0-20200308113650-138e5925c53b/inject.go:135 (0x951205)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/context.go:124 (0x967cc4)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/context.go:114 (0x967bf6)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/recovery.go:161 (0x15baec4)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/logger.go:40 (0x96b257)
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/inject@v0.0.0-20200308113650-138e5925c53b/inject.go:157 (0x9512ee)
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/inject@v0.0.0-20200308113650-138e5925c53b/inject.go:135 (0x951205)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/context.go:124 (0x967cc4)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/router.go:187 (0x972959)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/router.go:304 (0x973a01)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/macaron.go:218 (0x96c572)
/my/cache/.heroku/go/go1.26.3/go/src/net/http/server.go:3311 (0x85a5cd)
/my/cache/.heroku/go/go1.26.3/go/src/net/http/server.go:2073 (0x837f6f)
/my/cache/.heroku/go/go1.26.3/go/src/runtime/asm_amd64.s:1771 (0x493380)