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"