From bf4de722a79a49e6b1782681843d99d08c40cb8d Mon Sep 17 00:00:00 2001 From: shuai Date: Tue, 29 Oct 2024 15:39:37 +0800 Subject: [PATCH] feat: update template files --- ui/template/header.html | 10 ++- ui/template/homepage.html | 104 ++++++++++++++++--------------- ui/template/question-detail.html | 40 +++++------- ui/template/question.html | 46 +++++++------- ui/template/sort-btns.html | 19 ++++++ ui/template/tag-detail.html | 87 ++++++++++++-------------- ui/template/tags.html | 88 ++++++++++++++------------ 7 files changed, 206 insertions(+), 188 deletions(-) create mode 100644 ui/template/sort-btns.html diff --git a/ui/template/header.html b/ui/template/header.html index 0243a43d..5c4977d9 100644 --- a/ui/template/header.html +++ b/ui/template/header.html @@ -189,9 +189,13 @@ -
- {{template "sidenav" . }} - {{end}} +
+
+
+ {{template "sidenav" . }} + {{end}} +
+
diff --git a/ui/template/homepage.html b/ui/template/homepage.html index ad5b0209..2f68200d 100644 --- a/ui/template/homepage.html +++ b/ui/template/homepage.html @@ -19,59 +19,61 @@ --> {{template "header" . }} -
-
-
-
- -
-
- {{.userinfo.DisplayName}} +
+
+
+
+
+
+ + {{.userinfo.Username}} + +
+ -
@{{.userinfo.Username}}
-
-
- {{.userinfo.Rank}} {{translator $.language "ui.personal.x_reputation"}} -
-
- {{.userinfo.AnswerCount}} {{translator $.language "ui.personal.x_answers"}} -
-
- {{.userinfo.QuestionCount}} {{translator $.language "ui.personal.x_questions"}} -
-
- {{if .userinfo.Website }} - - {{else}} - {{end}} -
-
-
-
-
- -
-
-
- -
-
-
{{translator $.language "ui.personal.about_me"}}
- {{if .bio }} -
{{.bio}}
- {{else}} -
{{translator $.language "ui.personal.about_me_empty"}}
- {{end}} -
-
-
- -
-
+
+
@{{.userinfo.Username}}
+
+
+ {{.userinfo.Rank}} {{translator $.language "ui.personal.x_reputation"}} +
+
+ {{.userinfo.AnswerCount}} {{translator $.language "ui.personal.x_answers"}} +
+
+ {{.userinfo.QuestionCount}} {{translator $.language "ui.personal.x_questions"}} +
+
+ {{if .userinfo.Website }} + + {{else}} + {{end}} +
+
+
+
+
+
+
+
+
{{translator $.language "ui.personal.about_me"}}
+ {{if .bio }} +
{{.bio}}
+ {{else}} +
{{translator $.language "ui.personal.about_me_empty"}}
+ {{end}} +
+
+
+ +
+
+
+
{{template "footer" .}} diff --git a/ui/template/question-detail.html b/ui/template/question-detail.html index d0e6933d..fcf98c3d 100644 --- a/ui/template/question-detail.html +++ b/ui/template/question-detail.html @@ -19,9 +19,9 @@ --> {{template "header" . }} -
-
-
+
+
+

{{if $.useTitle }} @@ -46,14 +46,16 @@ -
- {{formatLinkNofollow .detail.HTML}} -
+
+
+ {{formatLinkNofollow .detail.HTML}} +
+
-
-
+ -
-
-
{{template "footer" .}} diff --git a/ui/template/question.html b/ui/template/question.html index 058645e5..ca7f1301 100644 --- a/ui/template/question.html +++ b/ui/template/question.html @@ -19,18 +19,19 @@ --> {{template "header" . }} -
-
-
+
+
+
{{translator $.language "ui.question.all_questions"}}
+ {{template "sort-btns" .}}
-
+
{{range .data}} -
+ -
+
{{range .questionList}} -
+
{{if $.useTitle }} - {{.Title}} + {{.Title}} {{else}} {{.Title}} {{end}}
-
-
-
- {{.Operator.DisplayName}}{{.Operator.Rank}} +
+
+
+ {{.Operator.DisplayName}}{{.Operator.Rank}}
• -
-
- {{.VoteCount}} - {{.AnswerCount}} - {{.ViewCount}} +
+
+ + {{.VoteCount}} +
+
+ + {{.AnswerCount}} +
+ + + {{.ViewCount}} +
-
+
{{range .Tags }} - + {{.SlugName}} {{end}} @@ -99,10 +86,14 @@
{{end}}
-
+
+ {{template "page" .}} +
-
{{template "page" .}}
+
+ {{template "hot-question" .}} +
{{template "footer" .}} diff --git a/ui/template/tags.html b/ui/template/tags.html index 292fd477..8821dd7b 100644 --- a/ui/template/tags.html +++ b/ui/template/tags.html @@ -19,48 +19,58 @@ --> {{template "header" . }} -
-
-
-
-
-
-

{{translator $.language "ui.page_title.tags"}}

-
-
-
- {{ range .data.List }} -
-
-
- {{.SlugName}} -

{{formatLinkNofollow .ParsedText}} -

-
- {{.QuestionCount}} - {{translator $.language "ui.tags.tag_label"}} -
-
-
-
- {{ end }} - -
-
- {{template "page" .}} +
+
+ +
+
+ {{ range .data.List }} +
+
+
+ {{.SlugName}} +
{{formatLinkNofollow .ParsedText}} +
+
+ {{.QuestionCount}} + {{translator $.language "ui.tags.tag_label"}} +
+
+
+
+ {{ end }} + +
+
+ {{template "page" .}} +
+
+
- - {{template "footer" .}}