| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package views
- import (
- "fmt"
- "code.osinet.fr/fgm/jamtrack/internal/query"
- )
- // Dashboard renders the practice-list ranking table.
- templ Dashboard(ranks []query.SongRank, locationID string) {
- @Layout("Practice List") {
- <div class="level">
- <div class="level-left">
- <h1 class="title">Practice List</h1>
- </div>
- <div class="level-right">
- <a class="button is-primary" href="/jams/new">+ New Jam</a>
- </div>
- </div>
- if len(ranks) == 0 {
- <p class="has-text-grey">No songs logged yet. <a href="/jams/new">Add a jam</a> to get started.</p>
- } else {
- <table class="table is-fullwidth is-striped is-hoverable">
- <thead>
- <tr>
- <th>Artist</th>
- <th>Title</th>
- <th class="has-text-right">Played</th>
- <th class="has-text-right">Proposed</th>
- </tr>
- </thead>
- <tbody>
- for _, r := range ranks {
- <tr>
- <td>{ r.Artist }</td>
- <td>{ r.Title }</td>
- <td class="has-text-right">{ fmt.Sprint(r.PlayedCount) }</td>
- <td class="has-text-right">{ fmt.Sprint(r.ProposedCount) }</td>
- </tr>
- }
- </tbody>
- </table>
- }
- }
- }
|