mobile finder

This commit is contained in:
cyber-dream 2023-07-23 01:00:51 +03:00
parent 9f60c185ad
commit d1c5e8ea15

View File

@ -5,6 +5,7 @@ import (
"personalwebsite/apps/appCtx"
"personalwebsite/errormessage"
mobile "github.com/floresj/go-contrib-mobile"
"github.com/gin-gonic/gin"
)
@ -18,7 +19,15 @@ func (f *FinderApplication) PublicRoutes(routes *gin.RouterGroup) {
})
return
}
ctx.HTML(http.StatusOK, "finder/app.tmpl", f.Render(appCtx))
d := mobile.GetDevice(ctx)
switch {
case d.Mobile():
ctx.HTML(http.StatusOK, "templates/finder/mobile-app.tmpl", gin.H{
// "autostart": autostart,
})
default:
ctx.HTML(http.StatusOK, "finder/app.tmpl", f.Render(appCtx))
}
})
routes.GET("renderMobileDesktop", func(ctx *gin.Context) {
@ -66,7 +75,13 @@ func (f *FinderApplication) PrivateRoutes(routes *gin.RouterGroup) {
})
return
}
ctx.HTML(http.StatusOK, "finder/admin-app.tmpl", f.Render(appCtx))
d := mobile.GetDevice(ctx)
switch {
case d.Mobile():
ctx.HTML(http.StatusOK, "finder/mobile-app.tmpl", f.Render(appCtx))
default:
ctx.HTML(http.StatusOK, "finder/admin-app.tmpl", f.Render(appCtx))
}
})
routes.GET("renderMobileDesktop", func(ctx *gin.Context) {