From 58c287322ecae60ddf725134c36a190ec266761a Mon Sep 17 00:00:00 2001 From: Trim21 Date: Wed, 21 Aug 2024 04:41:04 +0800 Subject: [PATCH] imporve header --- server/__init__.py | 16 ++++++++++++++-- server/templates/component/header.html | 19 ++++++++++++++++--- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/server/__init__.py b/server/__init__.py index a46b300..9130079 100644 --- a/server/__init__.py +++ b/server/__init__.py @@ -103,7 +103,13 @@ async def show_user_contrib(user_id: int, request: Request) -> Template: user_id, ) return Template( - "list.html.jinja2", context={"rows": rows, "auth": request.auth, "user_id": user_id} + "list.html.jinja2", + context={ + "rows": rows, + "auth": request.auth, + "user_id": user_id, + "title": f"{user_id} 的历史贡献", + }, ) @@ -114,7 +120,13 @@ async def show_user_review(user_id: int, request: Request) -> Template: user_id, ) return Template( - "list.html.jinja2", context={"rows": rows, "auth": request.auth, "user_id": user_id} + "list.html.jinja2", + context={ + "rows": rows, + "auth": request.auth, + "user_id": user_id, + "title": f"{user_id} 的历史审核", + }, ) diff --git a/server/templates/component/header.html b/server/templates/component/header.html index 38579e1..52e4479 100644 --- a/server/templates/component/header.html +++ b/server/templates/component/header.html @@ -1,4 +1,17 @@ -
-

返回首页

-
+
+ + +
+ {% if title is defined %} +

{{ title }}

+ {% endif %} +
+ +
+ +