Esempio n. 1
0
func (c Category) Index(category *models.Category) revel.Result {
	title := "栏目管理--GoCMS管理系统"

	UserID := utils.GetSession("UserID", c.Session)

	if len(UserID) > 0 {

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

		categorys := category.GetCateGoryHtml(admin_info)

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

	return c.RenderTemplate("Content/Category/Index.html")
}