diff --git a/apps/finder/routes.go b/apps/finder/routes.go index 2da8522..92abba0 100644 --- a/apps/finder/routes.go +++ b/apps/finder/routes.go @@ -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) {