func (context *AddArticleController) Get() {
	context.Data["title"] = "添加文章"
	context.Data["IsLogin"] = models.Check_Cookie(context.Ctx)

	context.TplNames = "html_add.html"

}
Exemple #2
0
func (Context *LoginController) Get() {
	Context.Data["title"] = "登錄"

	Context.Data["Is_Login"] = false

	Context.Data["Is_Login"] = models.Check_Cookie(Context.Ctx)

	Context.TplNames = "html_login.html"

}
func (context *ArticleController) Get() {
	context.Data["title"] = "文章目录"
	context.Data["IsLogin"] = false
	context.Data["Is_Login"] = models.Check_Cookie(context.Ctx)
	var err error
	context.Data["Article"], err = models.Get_Article_list(true)
	if err != nil {
		beego.Error(err)
	}
	context.TplNames = "html_article.html"
}
func (content *StreamController) Get() {
	content.Data["title"] = "活动"
	content.Data["Is_Login"] = models.Check_Cookie(content.Ctx)
	var err error
	Stream, err := models.GetStream()

	content.Data["Stream"] = Stream
	if err != nil {
		content.Ctx.WriteString(fmt.Sprint(err))
	}

	content.TplNames = "html_stream.html"
}
Exemple #5
0
func (context *ArticleViewController) Get() {
	arti_id := context.Input().Get("arti_id")
	article, err := models.Get_Article(arti_id)
	if err != nil {
		beego.Error(err)
	}
	article.Arti_Content = strings.Replace(article.Arti_Content, "\n", "<br />", -1)

	context.Data["Article"] = article

	// var err error

	// article, err := models.Get_Article()
	//context.Data["Article"] = article
	// if err != nil {
	// 	beego.Error(err)
	// }
	context.Data["title"] = article.Arti_Title
	context.Data["IsLogin"] = false
	context.Data["IsLogin"] = models.Check_Cookie(context.Ctx)

	context.TplNames = "html_view.html"
}