Skip to content

Commit

Permalink
add theme
Browse files Browse the repository at this point in the history
  • Loading branch information
ego008 committed Jun 16, 2022
1 parent 8eca772 commit 7d276df
Show file tree
Hide file tree
Showing 60 changed files with 2,552 additions and 2,136 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions controller/admin_comment_edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/valyala/fasthttp"
"goyoubbs/model"
"goyoubbs/util"
"goyoubbs/views/ybs"
"strconv"
)

Expand Down Expand Up @@ -32,7 +33,7 @@ func (h *BaseHandler) AdminCommentEditPage(ctx *fasthttp.RequestCtx) {

comment := model.CommentGetById(db, tidI, cidI)

evn := &model.AdminCommentEdit{}
evn := &ybs.AdminCommentEdit{}
evn.CurrentUser = curUser
evn.SiteCf = scf
evn.Title = "评论修改"
Expand Down Expand Up @@ -62,7 +63,7 @@ func (h *BaseHandler) AdminCommentEditPage(ctx *fasthttp.RequestCtx) {
evn.HasTopicReview = model.CheckHasTopic2Review(h.App.Db)
evn.HasReplyReview = model.CheckHasComment2Review(h.App.Db)

model.WritePageTemplate(ctx, evn)
ybs.WritePageTemplate(ctx, evn)
ctx.SetContentType("text/html; charset=utf-8")

}
7 changes: 4 additions & 3 deletions controller/admin_comment_review.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/valyala/fasthttp"
"goyoubbs/model"
"goyoubbs/util"
"goyoubbs/views/ybs"
"strconv"
"strings"
)
Expand All @@ -19,7 +20,7 @@ func (h *BaseHandler) AdminCommentReviewPage(ctx *fasthttp.RequestCtx) {
scf := h.App.Cf.Site
db := h.App.Db

evn := &model.AdminCommentEdit{}
evn := &ybs.AdminCommentEdit{}
evn.CurrentUser = curUser
evn.SiteCf = scf
evn.Title = "待审核评论"
Expand Down Expand Up @@ -71,11 +72,11 @@ func (h *BaseHandler) AdminCommentReviewPage(ctx *fasthttp.RequestCtx) {
evn.HasTopicReview = model.CheckHasTopic2Review(h.App.Db)
evn.HasReplyReview = model.CheckHasComment2Review(h.App.Db)

model.WritePageTemplate(ctx, evn)
ybs.WritePageTemplate(ctx, evn)
ctx.SetContentType("text/html; charset=utf-8")
}

// 管理员编辑与审核公用
//AdminCommentReviewPost 管理员编辑与审核公用
func (h *BaseHandler) AdminCommentReviewPost(ctx *fasthttp.RequestCtx) {
ctx.SetContentType("application/json; charset=UTF-8")

Expand Down
5 changes: 3 additions & 2 deletions controller/admin_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/ego008/sdb"
"github.com/valyala/fasthttp"
"goyoubbs/model"
"goyoubbs/views/ybs"
"strconv"
)

Expand All @@ -16,7 +17,7 @@ func (h *BaseHandler) AdminLinkPage(ctx *fasthttp.RequestCtx) {

scf := h.App.Cf.Site

evn := &model.AdminLink{}
evn := &ybs.AdminLink{}
evn.CurrentUser = curUser
evn.SiteCf = scf
evn.Title = "链接管理"
Expand All @@ -42,7 +43,7 @@ func (h *BaseHandler) AdminLinkPage(ctx *fasthttp.RequestCtx) {
evn.HasTopicReview = model.CheckHasTopic2Review(h.App.Db)
evn.HasReplyReview = model.CheckHasComment2Review(h.App.Db)

model.WritePageTemplate(ctx, evn)
ybs.WritePageTemplate(ctx, evn)
ctx.SetContentType("text/html; charset=utf-8")
}

Expand Down
5 changes: 3 additions & 2 deletions controller/admin_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/ego008/sdb"
"github.com/valyala/fasthttp"
"goyoubbs/model"
"goyoubbs/views/ybs"
"strconv"
)

Expand All @@ -16,7 +17,7 @@ func (h *BaseHandler) AdminNodePage(ctx *fasthttp.RequestCtx) {

scf := h.App.Cf.Site

evn := &model.AdminNode{}
evn := &ybs.AdminNode{}
evn.CurrentUser = curUser
evn.SiteCf = scf
evn.Title = "分区管理"
Expand All @@ -42,7 +43,7 @@ func (h *BaseHandler) AdminNodePage(ctx *fasthttp.RequestCtx) {
evn.HasTopicReview = model.CheckHasTopic2Review(h.App.Db)
evn.HasReplyReview = model.CheckHasComment2Review(h.App.Db)

model.WritePageTemplate(ctx, evn)
ybs.WritePageTemplate(ctx, evn)
ctx.SetContentType("text/html; charset=utf-8")

//_ = h.Render(ctx, evn, "admin/layout.html", "admin/node.html")
Expand Down
5 changes: 3 additions & 2 deletions controller/admin_site_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/gorilla/securecookie"
"github.com/valyala/fasthttp"
"goyoubbs/model"
"goyoubbs/views/ybs"
"strconv"
"strings"
"time"
Expand All @@ -20,7 +21,7 @@ func (h *BaseHandler) AdminSiteConfigPage(ctx *fasthttp.RequestCtx) {

scf := h.App.Cf.Site

evn := &model.AdminSiteConfig{}
evn := &ybs.AdminSiteConfig{}
evn.CurrentUser = curUser
evn.SiteCf = scf
evn.Title = "网站设置"
Expand All @@ -37,7 +38,7 @@ func (h *BaseHandler) AdminSiteConfigPage(ctx *fasthttp.RequestCtx) {
evn.HasTopicReview = model.CheckHasTopic2Review(h.App.Db)
evn.HasReplyReview = model.CheckHasComment2Review(h.App.Db)

model.WritePageTemplate(ctx, evn)
ybs.WritePageTemplate(ctx, evn)
ctx.SetContentType("text/html; charset=utf-8")
}

Expand Down
5 changes: 3 additions & 2 deletions controller/admin_site_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/ego008/sdb"
"github.com/valyala/fasthttp"
"goyoubbs/model"
"goyoubbs/views/ybs"
"log"
"strings"
)
Expand All @@ -17,7 +18,7 @@ func (h *BaseHandler) AdminSiteRouterPage(ctx *fasthttp.RequestCtx) {

scf := h.App.Cf.Site

evn := &model.AdminSiteRouter{}
evn := &ybs.AdminSiteRouter{}
evn.CurrentUser = curUser
evn.SiteCf = scf
evn.Title = "自定义路由"
Expand Down Expand Up @@ -61,7 +62,7 @@ func (h *BaseHandler) AdminSiteRouterPage(ctx *fasthttp.RequestCtx) {
evn.HasTopicReview = model.CheckHasTopic2Review(h.App.Db)
evn.HasReplyReview = model.CheckHasComment2Review(h.App.Db)

model.WritePageTemplate(ctx, evn)
ybs.WritePageTemplate(ctx, evn)
ctx.SetContentType("text/html; charset=utf-8")
}

Expand Down
5 changes: 3 additions & 2 deletions controller/admin_topic_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/valyala/fasthttp"
"goyoubbs/model"
"goyoubbs/util"
"goyoubbs/views/ybs"
"log"
"strconv"
"strings"
Expand All @@ -22,7 +23,7 @@ func (h *BaseHandler) AdminTopicAddPage(ctx *fasthttp.RequestCtx) {
db := h.App.Db
scf := h.App.Cf.Site

evn := &model.AdminTopicAdd{}
evn := &ybs.AdminTopicAdd{}
evn.CurrentUser = curUser
evn.SiteCf = scf
evn.Title = "发表文章"
Expand All @@ -44,7 +45,7 @@ func (h *BaseHandler) AdminTopicAddPage(ctx *fasthttp.RequestCtx) {
evn.HasReplyReview = model.CheckHasComment2Review(db)
}

model.WritePageTemplate(ctx, evn)
ybs.WritePageTemplate(ctx, evn)
ctx.SetContentType("text/html; charset=utf-8")

//_ = h.Render(ctx, evn, "admin/layout.html", "admin/topic_add.html")
Expand Down
5 changes: 3 additions & 2 deletions controller/admin_topic_edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/ego008/sdb"
"github.com/valyala/fasthttp"
"goyoubbs/model"
"goyoubbs/views/ybs"
"strconv"
)

Expand All @@ -16,7 +17,7 @@ func (h *BaseHandler) AdminTopicEditPage(ctx *fasthttp.RequestCtx) {

scf := h.App.Cf.Site

evn := &model.AdminTopicAdd{}
evn := &ybs.AdminTopicAdd{}
evn.CurrentUser = curUser
evn.SiteCf = scf
evn.Title = "编辑帖子"
Expand Down Expand Up @@ -77,7 +78,7 @@ func (h *BaseHandler) AdminTopicEditPage(ctx *fasthttp.RequestCtx) {
evn.HasTopicReview = model.CheckHasTopic2Review(h.App.Db)
evn.HasReplyReview = model.CheckHasComment2Review(h.App.Db)

model.WritePageTemplate(ctx, evn)
ybs.WritePageTemplate(ctx, evn)
ctx.SetContentType("text/html; charset=utf-8")

//_ = h.Render(ctx, evn, "admin/layout.html", "admin/topic_add.html")
Expand Down
7 changes: 3 additions & 4 deletions controller/admin_topic_review.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/ego008/sdb"
"github.com/valyala/fasthttp"
"goyoubbs/model"
"goyoubbs/views/ybs"
"strconv"
)

Expand All @@ -16,7 +17,7 @@ func (h *BaseHandler) AdminTopicReviewPage(ctx *fasthttp.RequestCtx) {

scf := h.App.Cf.Site

evn := &model.AdminTopicAdd{}
evn := &ybs.AdminTopicAdd{}
evn.CurrentUser = curUser
evn.SiteCf = scf
evn.Title = "待审核帖子"
Expand Down Expand Up @@ -77,8 +78,6 @@ func (h *BaseHandler) AdminTopicReviewPage(ctx *fasthttp.RequestCtx) {
evn.HasTopicReview = model.CheckHasTopic2Review(h.App.Db)
evn.HasReplyReview = model.CheckHasComment2Review(h.App.Db)

model.WritePageTemplate(ctx, evn)
ybs.WritePageTemplate(ctx, evn)
ctx.SetContentType("text/html; charset=utf-8")

//_ = h.Render(ctx, evn, "admin/layout.html", "admin/topic_add.html")
}
5 changes: 3 additions & 2 deletions controller/admin_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/valyala/fasthttp"
"goyoubbs/model"
"goyoubbs/util"
"goyoubbs/views/ybs"
"strconv"
"strings"
)
Expand All @@ -18,7 +19,7 @@ func (h *BaseHandler) AdminUserPage(ctx *fasthttp.RequestCtx) {

scf := h.App.Cf.Site

evn := &model.AdminUser{}
evn := &ybs.AdminUser{}
evn.CurrentUser = curUser
evn.SiteCf = scf
evn.Title = "用户管理"
Expand Down Expand Up @@ -71,7 +72,7 @@ func (h *BaseHandler) AdminUserPage(ctx *fasthttp.RequestCtx) {
evn.HasTopicReview = model.CheckHasTopic2Review(h.App.Db)
evn.HasReplyReview = model.CheckHasComment2Review(h.App.Db)

model.WritePageTemplate(ctx, evn)
ybs.WritePageTemplate(ctx, evn)
ctx.SetContentType("text/html; charset=utf-8")
}

Expand Down
5 changes: 3 additions & 2 deletions controller/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/ego008/sdb"
"github.com/valyala/fasthttp"
"goyoubbs/model"
"goyoubbs/views/ybs"
"strconv"
)

Expand Down Expand Up @@ -46,7 +47,7 @@ func (h *BaseHandler) HomePage(ctx *fasthttp.RequestCtx) {
topicPageInfo := model.GetTopicList(db, cmd, "topic_update", key, score, scf.PageShowNum)
//topicPageInfo := model.GetTopicListSortById(db, cmd, "topic_update", key, score, scf.PageShowNum)

evn := &model.HomePage{}
evn := &ybs.HomePage{}
evn.SiteCf = scf
evn.Title = scf.Name
evn.CurrentUser = curUser
Expand All @@ -68,7 +69,7 @@ func (h *BaseHandler) HomePage(ctx *fasthttp.RequestCtx) {
}
}

model.WritePageTemplate(ctx, evn)
ybs.WritePageTemplate(ctx, evn)
ctx.SetContentType("text/html; charset=utf-8")

//_ = h.Render(ctx, evn, "default/layout.html", "default/sidebar.html", "default/home.html")
Expand Down
5 changes: 3 additions & 2 deletions controller/member_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/valyala/fasthttp"
"goyoubbs/model"
"goyoubbs/util"
"goyoubbs/views/ybs"
"net/url"
"strconv"
"strings"
Expand Down Expand Up @@ -98,7 +99,7 @@ func (h *BaseHandler) MemberPage(ctx *fasthttp.RequestCtx) {
tbName := "user_" + lstType + ":" + strconv.FormatUint(user.ID, 10)
topicPageInfo := model.GetTopicList(db, cmd, tbName, key, score, scf.PageShowNum)

evn := &model.MemberPage{}
evn := &ybs.MemberPage{}
evn.SiteCf = scf
evn.Title = "会员: " + user.Name + " 最近" + titleText + " - " + scf.Name
evn.CurrentUser = curUser
Expand Down Expand Up @@ -132,7 +133,7 @@ func (h *BaseHandler) MemberPage(ctx *fasthttp.RequestCtx) {
}
}

model.WritePageTemplate(ctx, evn)
ybs.WritePageTemplate(ctx, evn)
ctx.SetContentType("text/html; charset=utf-8")

}
7 changes: 3 additions & 4 deletions controller/my_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package controller
import (
"github.com/valyala/fasthttp"
"goyoubbs/model"
"goyoubbs/views/ybs"
)

func (h *BaseHandler) MyMsgPage(ctx *fasthttp.RequestCtx) {
Expand All @@ -15,7 +16,7 @@ func (h *BaseHandler) MyMsgPage(ctx *fasthttp.RequestCtx) {
db := h.App.Db
scf := h.App.Cf.Site

evn := &model.MyMsg{}
evn := &ybs.MyMsg{}
evn.CurrentUser = curUser
evn.SiteCf = scf
evn.Title = "未读信息"
Expand All @@ -29,8 +30,6 @@ func (h *BaseHandler) MyMsgPage(ctx *fasthttp.RequestCtx) {
evn.HasReplyReview = model.CheckHasComment2Review(db)
}

model.WritePageTemplate(ctx, evn)
ybs.WritePageTemplate(ctx, evn)
ctx.SetContentType("text/html; charset=utf-8")

//_ = h.Render(ctx, evn, "admin/layout.html", "admin/my_msg.html")
}
7 changes: 3 additions & 4 deletions controller/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/ego008/sdb"
"github.com/valyala/fasthttp"
"goyoubbs/model"
"goyoubbs/views/ybs"
"strconv"
)

Expand Down Expand Up @@ -62,7 +63,7 @@ func (h *BaseHandler) NodePage(ctx *fasthttp.RequestCtx) {

//log.Println(topicPageInfo)

evn := &model.NodePage{}
evn := &ybs.NodePage{}
evn.SiteCf = scf
evn.Title = "Category: " + node.Name + " - " + scf.Name
evn.CurrentUser = curUser
Expand All @@ -82,8 +83,6 @@ func (h *BaseHandler) NodePage(ctx *fasthttp.RequestCtx) {
}
}

model.WritePageTemplate(ctx, evn)
ybs.WritePageTemplate(ctx, evn)
ctx.SetContentType("text/html; charset=utf-8")

//_ = h.Render(ctx, evn, "default/layout.html", "default/sidebar.html", "default/node.html")
}
Loading

0 comments on commit 7d276df

Please sign in to comment.