package devicedetails
import "github.com/tigorlazuardi/redmage/views"
import "github.com/tigorlazuardi/redmage/views/components"
import "fmt"
import "github.com/tigorlazuardi/redmage/models"
templ View(c *views.Context, data Data) {
@components.Doctype() {
if data.Device == nil {
@components.Head(c, components.HeadTitle("Redmage - Device Not Found"))
} else {
@components.Head(c, components.HeadTitle(fmt.Sprintf("Redmage - %s", data.Device.Name)))
}
@components.Body(c) {
@Content(c, data)
}
}
}
templ Content(c *views.Context, data Data) {
{ data.Device.Name }
@filter(data)
for _, group := range data.splitImages() {
{ group.Subreddit }
@imageList(group.Images)
}
}
}