more refactors
This commit is contained in:
@@ -9,7 +9,7 @@ import "fmt"
|
||||
import "time"
|
||||
import "github.com/uptrace/bun"
|
||||
|
||||
templ SeasonsPage(seasons *db.SeasonList) {
|
||||
templ SeasonsPage(seasons *db.List[db.Season]) {
|
||||
@layout.Global("Seasons") {
|
||||
<div class="max-w-screen-2xl mx-auto px-2">
|
||||
@SeasonsList(seasons)
|
||||
@@ -17,7 +17,7 @@ templ SeasonsPage(seasons *db.SeasonList) {
|
||||
}
|
||||
}
|
||||
|
||||
templ SeasonsList(seasons *db.SeasonList) {
|
||||
templ SeasonsList(seasons *db.List[db.Season]) {
|
||||
{{
|
||||
sortOpts := []db.OrderOpts{
|
||||
{
|
||||
@@ -69,14 +69,14 @@ templ SeasonsList(seasons *db.SeasonList) {
|
||||
@sort.Dropdown(seasons.PageOpts, sortOpts)
|
||||
</div>
|
||||
<!-- Results section -->
|
||||
if len(seasons.Seasons) == 0 {
|
||||
if len(seasons.Items) == 0 {
|
||||
<div class="bg-mantle border border-surface1 rounded-lg p-8 text-center">
|
||||
<p class="text-subtext0 text-lg">No seasons found</p>
|
||||
</div>
|
||||
} else {
|
||||
<!-- Card grid -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
for _, s := range seasons.Seasons {
|
||||
for _, s := range seasons.Items {
|
||||
<a
|
||||
class="bg-mantle border border-surface1 rounded-lg p-6 hover:bg-surface0 transition-colors"
|
||||
href={ fmt.Sprintf("/seasons/%s", s.ShortName) }
|
||||
|
||||
Reference in New Issue
Block a user