mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 00:27:44 +01:00
29 lines
784 B
Go
29 lines
784 B
Go
|
package ng
|
||
|
|
||
|
import (
|
||
|
"path/filepath"
|
||
|
|
||
|
"github.com/astaxie/beego"
|
||
|
)
|
||
|
|
||
|
type BaseController struct {
|
||
|
beego.Controller
|
||
|
}
|
||
|
|
||
|
const (
|
||
|
viewPath = "sections"
|
||
|
prefixNg = "ng"
|
||
|
)
|
||
|
|
||
|
func (bc *BaseController) Forward(title, templateName string) {
|
||
|
bc.Layout = filepath.Join(prefixNg, "layout.htm")
|
||
|
bc.TplName = filepath.Join(prefixNg, templateName)
|
||
|
bc.Data["Title"] = title
|
||
|
bc.LayoutSections = make(map[string]string)
|
||
|
bc.LayoutSections["HeaderInclude"] = filepath.Join(prefixNg, viewPath, "headerInclude.htm")
|
||
|
bc.LayoutSections["FooterInclude"] = filepath.Join(prefixNg, viewPath, "footerInclude.htm")
|
||
|
bc.LayoutSections["HeaderContent"] = filepath.Join(prefixNg, viewPath, "headerContent.htm")
|
||
|
bc.LayoutSections["FooterContent"] = filepath.Join(prefixNg, viewPath, "footerContent.htm")
|
||
|
|
||
|
}
|