完成paint的展示页面,并且完成图片上传功能

This commit is contained in:
2026-07-08 15:36:48 +08:00
parent 8ab1908e27
commit 690b4e2ed3
4 changed files with 57 additions and 27 deletions

View File

@@ -42,4 +42,4 @@ def paint_home():
for class_data in db_cursor.execute(class_sql).fetchall(): for class_data in db_cursor.execute(class_sql).fetchall():
for tags_data in db_cursor.execute(tags_sql).fetchall(): for tags_data in db_cursor.execute(tags_sql).fetchall():
return render_template('paint/home.html', data = data, tags_data = tags_data[0], class_data = class_data[0], img_url = img_url) return render_template('paint/home.html', data = data[::-1], tags_data = tags_data[0], class_data = class_data[0], img_url = img_url)

View File

@@ -9,7 +9,7 @@
{% endblock %} {% endblock %}
</div> </div>
{% block move %} {% block move %}
{# 这里存放更多模板的数据 #} {# 这里存放更多模板的数据 #}
{% endblock %} {% endblock %}
{% include 'blog/include/footer.html' %} {% include 'blog/include/footer.html' %}
</body> </body>

View File

@@ -0,0 +1,13 @@
<html>
<head>
<title>{% block title %}{% endblock %} | ww3</title>
{% block style %}
{# 这里存放style模板的数据 #}
{% endblock %}
</head>
<body>
{% block content %}
{# 这里存放写入模板的数据 #}
{% endblock %}
</body>
</html>

View File

@@ -1,16 +1,14 @@
{# 引入base #} {# 引入base #}
{% extends 'blog/extension/base.html' %} {% extends 'paint/extension/base.html' %}
{% include 'blog/include/head.html' %}
{# 引入标题 #} {# 引入标题 #}
{% block title %}paint{% endblock %} {% block title %}paint{% endblock %}
{% include 'blog/include/head.html' %}
{% block content %} {% block content %}
<head> {% block style %}
<style> <style>
hr { hr {
background-color: black; background-color: black;
@@ -22,32 +20,51 @@
width: 500px; width: 500px;
height: auto; height: auto;
background-color: rgb(169, 198, 252); background-color: rgb(169, 198, 252);
}
a {
text-decoration: none;
}
#url_ {
margin: 0 5px 0 0;
color: black;
font-weight: bold;
}
body {
background-color: rgb(92, 92, 92);
} }
</style> </style>
</head> {% endblock %}
<body> <body>
<div> <div>
{% include 'blog/include/navbar2.html' %} {% include 'blog/include/navbar2.html' %}
</div> </div>
<a href="/blog/">返回主页</a>
<h2>这里是关于本人的绘画学习及其临摹的记录和展示页面</h2>
<hr>
<a href="https://ww3.tw/blog/folders/paint/old">旧作列表</a>
<br> <br>
{% for data in data %} <div style="height: 100%;">
<div style="background-color: #93B9FFA4;">
<a href="/blog/">返回主页</a>
<h2>这里是关于本人的绘画学习及其临摹的记录和展示页面</h2>
<hr>
<a href="https://ww3.tw/blog/folders/paint/old">旧作列表</a>
<br>
<br>
{% for data in data %}
<img src="{{img_url}}{{data['date']}}/{{data['name']}}.jpg" alt="{{data['name']}}" width="15%">
{{data['name']}}__
{{data['date']}}
{% endfor %}
<br>
<br>
</div>
<!-- tags: __{{tags_data}}
<br> <br>
<img src="{{img_url}}{{data['date']}}/{{data['name']}}.jpg" alt="{{data['name']}}" width="15%">
<br> <br>
{{data['name']}}__ class: __{{class_data}} -->
{{data['date']}} <br>
{% endfor %} <br>
<br> {% include 'blog/include/footer.html' %}
<br> </div>
<!-- tags: __{{tags_data}}
<br>
<br>
class: __{{class_data}} -->
</body> </body>
<br>
{% endblock %} {% endblock %}