init:初始化仓库,并基本完成

This commit is contained in:
Hmtsai 2024-06-26 10:01:05 +08:00
commit 5a52a8d952
4 changed files with 292 additions and 0 deletions

62
home.html Normal file
View File

@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="zh-CN" class="mdui-theme-auto">
<head>
<title>Home</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no"/>
<meta name="renderer" content="webkit"/>
<link rel="stylesheet" href="https://unpkg.com/mdui@2/mdui.css">
<script src="https://unpkg.com/mdui@2/mdui.global.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<mdui-top-app-bar style="position: relative;">
<mdui-button-icon id="open-drawer" icon="menu"></mdui-button-icon>
<mdui-top-app-bar-title>Posts</mdui-top-app-bar-title>
<div style="flex-grow: 1"></div>
</mdui-top-app-bar>
<mdui-navigation-drawer close-on-overlay-click modal close-on-esc id="navi-drawer">
<mdui-list>
{% for forum in forums %}
<mdui-list-item
headline="{{ forum.name }}"
end-icon="arrow-right"
href="{{ forum.url }}">
</mdui-list-item>
{% endfor %}
</mdui-list>
</mdui-navigation-drawer>
<script>
const navigationDrawer = document.querySelector("#navi-drawer");
const openButton = document.querySelector("#open-drawer")
openButton.addEventListener("click", () => navigationDrawer.open = true);
</script>
<mdui-list>
{% for forum in forums %}
<mdui-list-item
headline="{{ forum.name }}"
description="{{ forum.description | safe }}"
end-icon="arrow-right"
href="{{ forum.url }}">
</mdui-list-item>
{% endfor %}
</mdui-list>
</body>
</html>

92
posts.html Normal file
View File

@ -0,0 +1,92 @@
<!DOCTYPE html>
<html lang="zh-CN" class="mdui-theme-auto">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no"/>
<meta name="renderer" content="webkit"/>
<link rel="stylesheet" href="https://unpkg.com/mdui@2/mdui.css">
<script src="https://unpkg.com/mdui@2/mdui.global.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<title>Posts -- from {{ posts.from_topic }}</title>
</head>
<body>
<mdui-top-app-bar style="position: relative;">
<mdui-button-icon id="open-drawer" icon="menu"></mdui-button-icon>
<mdui-top-app-bar-title>Posts</mdui-top-app-bar-title>
<div style="flex-grow: 1"></div>
</mdui-top-app-bar>
<mdui-navigation-drawer close-on-overlay-click modal close-on-esc id="navi-drawer">
<mdui-list>
{% for forum in forums %}
<mdui-list-item
headline="{{ forum.name }}"
end-icon="arrow-right"
href="{{ forum.url }}">
</mdui-list-item>
{% endfor %}
</mdui-list>
</mdui-navigation-drawer>
<script>
const navigationDrawer = document.querySelector("#navi-drawer");
const openButton = document.querySelector("#open-drawer")
openButton.addEventListener("click", () => navigationDrawer.open = true);
</script>
<mdui-button variant="text" href="{{ posts.from_url }}">Back</mdui-button>
<mdui-list>
{% for posts in posts.posts %}
<mdui-list-item>
<div slot="custom">
<span>{{ posts.id }}楼 作者:
<a
href="{{% if posts.posterurl != "" %}}{{ posts.posterurl }}{{% endif %}}">
{{ posts.postername }}
</a>
</span>
<div class="mdui-prose">
{{ posts.text | safe }}
</div>
</div>
</mdui-list-item>
{% endfor %}
</mdui-list>
<div style="width:100%;">
<span style="display:block;text-align:center">{{ page.now }} / {{ page.count }}页</span>
<div style="display:flex">
<mdui-button href="{{ page.first_url }}" icon="first-page">第一页</mdui-button>
{% if page.prev_url != "" %}
<mdui-button href="{{ page.prev_url }}" icon="arrow-back">上一页</mdui-button>
{% endif %}
<div style="flex-grow:1"></div>
{% if page.next_url != "" %}
<mdui-button href="{{ page.next_url }}" end-icon="arrow-forward">下一页</mdui-button>
{% endif %}
<mdui-button href="{{ page.end_url }}" end-icon="last-page">最后一页</mdui-button>
</div>
</div>
</body>
</html>

82
topics.html Normal file
View File

@ -0,0 +1,82 @@
<!DOCTYPE html>
<html lang="zh-CN" class="mdui-theme-auto">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no"/>
<meta name="renderer" content="webkit"/>
<link rel="stylesheet" href="https://unpkg.com/mdui@2/mdui.css">
<script src="https://unpkg.com/mdui@2/mdui.global.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<title>Topics -- from {{ topics.form_forum }}</title>
</head>
<body>
<mdui-top-app-bar style="position: relative;">
<mdui-button-icon id="open-drawer" icon="menu"></mdui-button-icon>
<mdui-top-app-bar-title>Posts</mdui-top-app-bar-title>
<div style="flex-grow: 1"></div>
</mdui-top-app-bar>
<mdui-navigation-drawer close-on-overlay-click modal close-on-esc id="navi-drawer">
<mdui-list>
{% for forum in forums %}
<mdui-list-item
headline="{{ forum.name }}"
end-icon="arrow-right"
href="{{ forum.url }}">
</mdui-list-item>
{% endfor %}
</mdui-list>
</mdui-navigation-drawer>
<script>
const navigationDrawer = document.querySelector("#navi-drawer");
const openButton = document.querySelector("#open-drawer")
openButton.addEventListener("click", () => navigationDrawer.open = true);
</script>
<mdui-button variant="text" href="{{ topics.from_url }}">Back</mdui-button>
<mdui-list>
{% for topic in topics.topics %}
<mdui-list-item>
<div slot="custom">
<h3>{{ topic.id }}<a href="{{ topic.url }}">{{ topic.name }}</a></h3>
<span>Time: {{ topic.time }}</span>
</div>
</mdui-list-item>
{% endfor %}
</mdui-list>
<div style="width:100%;">
<span style="display:block;text-align:center">{{ page.now }} / {{ page.count }}页</span>
<div style="display:flex">
<mdui-button href="{{ page.first_url }}" icon="first-page">第一页</mdui-button>
{% if page.prev_url != "" %}
<mdui-button href="{{ page.prev_url }}" icon="arrow-back">上一页</mdui-button>
{% endif %}
<div style="flex-grow:1"></div>
{% if page.next_url != "" %}
<mdui-button href="{{ page.next_url }}" end-icon="arrow-forward">下一页</mdui-button>
{% endif %}
<mdui-button href="{{ page.end_url }}" end-icon="last-page">最后一页</mdui-button>
</div>
</div>
</body>
</html>

56
user.html Normal file
View File

@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang="zh-CN" class="mdui-theme-auto">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no"/>
<meta name="renderer" content="webkit"/>
<link rel="stylesheet" href="https://unpkg.com/mdui@2/mdui.css">
<script src="https://unpkg.com/mdui@2/mdui.global.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<title>User -- {{ user.name }}</title>
</head>
<body>
<mdui-top-app-bar style="position: relative;">
<mdui-button-icon id="open-drawer" icon="menu"></mdui-button-icon>
<mdui-top-app-bar-title>Posts</mdui-top-app-bar-title>
<div style="flex-grow: 1"></div>
</mdui-top-app-bar>
<mdui-navigation-drawer close-on-overlay-click modal close-on-esc id="navi-drawer">
<mdui-list>
{% for forum in forums %}
<mdui-list-item
headline="{{ forum.name }}"
end-icon="arrow-right"
href="{{ forum.url }}">
</mdui-list-item>
{% endfor %}
</mdui-list>
</mdui-navigation-drawer>
<script>
const navigationDrawer = document.querySelector("#navi-drawer");
const openButton = document.querySelector("#open-drawer")
openButton.addEventListener("click", () => navigationDrawer.open = true);
</script>
<mdui-button variant="text" href="{{ topics.from_url }}">Back</mdui-button><ol>
<h3>{{ user.name }}</h3>
<div class="mdui-prose">
{{ user.description | safe }}
Register time: {{ user.reg_time }}
</div>
</body>
</html>