123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- package e21_presents
- import (
- "github.com/qor5/admin/presets"
- "github.com/qor5/ui/vuetify"
- "github.com/qor5/web"
- h "github.com/theplant/htmlgo"
- )
- type music struct{}
- type video struct{}
- type book struct{}
- func PresetsOrderMenu(b *presets.Builder) {
- b.Model(&music{}).Listing().PageFunc(func(ctx *web.EventContext) (r web.PageResponse, err error) {
- r.Body = vuetify.VContainer(
- h.Div(
- h.H1("music"),
- ).Class("text-center mt-8"),
- )
- return
- })
- b.Model(&video{}).Listing().PageFunc(func(ctx *web.EventContext) (r web.PageResponse, err error) {
- r.Body = vuetify.VContainer(
- h.Div(
- h.H1("video"),
- ).Class("text-center mt-8"),
- )
- return
- })
- b.Model(&book{}).Listing().PageFunc(func(ctx *web.EventContext) (r web.PageResponse, err error) {
- r.Body = vuetify.VContainer(
- h.Div(
- h.H1("book"),
- ).Class("text-center mt-8"),
- )
- return
- })
- // @snippet_begin(MenuOrderSample)
- b.URIPrefix(PresetsMenuOrderPath).
- MenuOrder(
- "books",
- "videos",
- "musics",
- )
- // @snippet_end
- }
- func PresetsGroupMenu(b *presets.Builder) {
- b.URIPrefix(PresetsMenuGroupPath)
- b.Model(&music{}).Listing().PageFunc(func(ctx *web.EventContext) (r web.PageResponse, err error) {
- r.Body = vuetify.VContainer(
- h.Div(
- h.H1("music"),
- ).Class("text-center mt-8"),
- )
- return
- })
- b.Model(&video{}).Listing().PageFunc(func(ctx *web.EventContext) (r web.PageResponse, err error) {
- r.Body = vuetify.VContainer(
- h.Div(
- h.H1("video"),
- ).Class("text-center mt-8"),
- )
- return
- })
- // @snippet_begin(MenuGroupSample)
- mb := b.Model(&book{}).MenuIcon("book")
- mb.Listing().PageFunc(func(ctx *web.EventContext) (r web.PageResponse, err error) {
- r.Body = vuetify.VContainer(
- h.Div(
- h.H1("book"),
- ).Class("text-center mt-8"),
- )
- return
- })
- b.MenuOrder(
- "books",
- b.MenuGroup("Media").SubItems(
- "videos",
- "musics",
- ).Icon("perm_media"),
- )
- // @snippet_end
- }
- const PresetsMenuOrderPath = "/samples/menu_order"
- const PresetsMenuGroupPath = "/samples/menu_group"
|