theme v1
This commit is contained in:
@@ -40,6 +40,7 @@ import (
|
||||
"github.com/tamakyi/TamaBox/internal/shared"
|
||||
"github.com/tamakyi/TamaBox/internal/storage"
|
||||
templatepkg "github.com/tamakyi/TamaBox/internal/template"
|
||||
"github.com/tamakyi/TamaBox/internal/theme"
|
||||
)
|
||||
|
||||
func Pager(ctx context.Context) {
|
||||
@@ -76,6 +77,10 @@ func Pager(ctx context.Context) {
|
||||
ctx.Data["LangCode"] = lang
|
||||
}
|
||||
|
||||
// 主题只作用于箱主相关页面(提问箱主页 / 单题页 / 密码页 / 分享卡路由),
|
||||
// 与背景图、颜色同属箱主个性化配置;/user 后台保持中性外观。
|
||||
// 空串 = 不加载主题 css(站点默认就是基础外观时省掉一次请求)。
|
||||
ctx.Data["ThemeSlug"] = theme.Resolve(pageUser.Theme)
|
||||
// 页面密码检查
|
||||
if pageUser.PagePassword != "" && !(ctx.IsLogged && ctx.User.ID == pageUser.ID) {
|
||||
passKey := fmt.Sprintf("page_pass_%d", pageUser.ID)
|
||||
|
||||
Reference in New Issue
Block a user