Example #1
0
File: menu.go Project: qmdx/GoCMS
//首页
func (c Menu) Index(menu *models.Menu) revel.Result {
	title := "菜单管理--GoCMS管理系统"

	menus := menu.GetMenuHtml()

	c.Render(title, menus)
	return c.RenderTemplate("Setting/Menu/Index.html")
}
Example #2
0
//首页
func (c Menu) Index(menu *models.Menu) revel.Result {
	title := "菜单管理--GoCMS管理系统"

	if UserID, ok := c.Session["UserID"]; ok {

		UserID, err := strconv.ParseInt(UserID, 10, 64)
		if err != nil {
			revel.WARN.Println(err)
		}
		admin := new(models.Admin)
		admin_info := admin.GetById(UserID)

		menus := menu.GetMenuHtml(admin_info)

		c.Render(title, menus)
	} else {
		c.Render(title)
	}

	return c.RenderTemplate("Setting/Menu/Index.html")
}