Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
思寒
hogwarts-testing-platform-bjzm3
Commits
e641d336
Commit
e641d336
authored
6 months ago
by
seveniruby
Browse files
Options
Download
Email Patches
Plain Diff
template 继承
parent
bd5f9cfc
main
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
src/hogwarts_testing_platform/service/demo.py
+2
-2
src/hogwarts_testing_platform/service/demo.py
src/hogwarts_testing_platform/site/server.py
+2
-2
src/hogwarts_testing_platform/site/server.py
src/hogwarts_testing_platform/templates/base.html
+158
-0
src/hogwarts_testing_platform/templates/base.html
src/hogwarts_testing_platform/templates/child.html
+14
-0
src/hogwarts_testing_platform/templates/child.html
src/hogwarts_testing_platform/templates/login.html
+36
-0
src/hogwarts_testing_platform/templates/login.html
src/hogwarts_testing_platform/templates/testcase_create.html
+16
-0
src/hogwarts_testing_platform/templates/testcase_create.html
with
228 additions
and
4 deletions
+228
-4
src/hogwarts_testing_platform/service/demo.py
+
2
-
2
View file @
e641d336
...
...
@@ -3,5 +3,5 @@ from flask.views import MethodView
class
DemoView
(
MethodView
):
def
get
(
self
):
return
render_template
(
'child.html.jinja'
)
def
get
(
self
,
path
):
return
render_template
(
path
)
This diff is collapsed.
Click to expand it.
src/hogwarts_testing_platform/site/server.py
+
2
-
2
View file @
e641d336
...
...
@@ -97,8 +97,8 @@ class Server:
# 数据的新增
self
.
get_app
().
add_url_rule
(
rule
=
f
'
{
path
}
'
,
view_func
=
view_func
,
methods
=
[
'POST'
])
# 方便调试,注册一个demo接口
≈
self
.
get_app
().
add_url_rule
(
rule
=
'/demo'
,
view_func
=
DemoView
.
as_view
(
'demo'
))
# 方便调试,注册一个demo接口
self
.
get_app
().
add_url_rule
(
rule
=
'/demo
/<path>
'
,
view_func
=
DemoView
.
as_view
(
'demo'
))
def
run
(
self
,
port
=
None
):
self
.
get_app
().
run
(
port
=
port
,
debug
=
True
)
This diff is collapsed.
Click to expand it.
src/hogwarts_testing_platform/templates/base.html
0 → 100644
+
158
-
0
View file @
e641d336
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
{% block head %}
<title>
{% block title %}
{% endblock %}
</title>
{% endblock %}
<link
href=
"https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
rel=
"stylesheet"
integrity=
"sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
crossorigin=
"anonymous"
>
</head>
<body>
{% block navbar %}
<nav
class=
"navbar navbar-expand-lg bg-body-tertiary"
>
<div
class=
"container-fluid"
>
<a
class=
"navbar-brand"
href=
"#"
>
Navbar
</a>
<button
class=
"navbar-toggler"
type=
"button"
data-bs-toggle=
"collapse"
data-bs-target=
"#navbarSupportedContent"
aria-controls=
"navbarSupportedContent"
aria-expanded=
"false"
aria-label=
"Toggle navigation"
>
<span
class=
"navbar-toggler-icon"
></span>
</button>
<div
class=
"collapse navbar-collapse"
id=
"navbarSupportedContent"
>
<ul
class=
"navbar-nav me-auto mb-2 mb-lg-0"
>
<li
class=
"nav-item"
>
<a
class=
"nav-link active"
aria-current=
"page"
href=
"#"
>
Home
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"#"
>
Link
</a>
</li>
<li
class=
"nav-item dropdown"
>
<a
class=
"nav-link dropdown-toggle"
href=
"#"
role=
"button"
data-bs-toggle=
"dropdown"
aria-expanded=
"false"
>
Dropdown
</a>
<ul
class=
"dropdown-menu"
>
<li><a
class=
"dropdown-item"
href=
"#"
>
Action
</a></li>
<li><a
class=
"dropdown-item"
href=
"#"
>
Another action
</a></li>
<li>
<hr
class=
"dropdown-divider"
>
</li>
<li><a
class=
"dropdown-item"
href=
"#"
>
Something else here
</a></li>
</ul>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link disabled"
aria-disabled=
"true"
>
Disabled
</a>
</li>
</ul>
<form
class=
"d-flex"
role=
"search"
>
<input
class=
"form-control me-2"
type=
"search"
placeholder=
"Search"
aria-label=
"Search"
>
<button
class=
"btn btn-outline-success"
type=
"submit"
>
Search
</button>
</form>
</div>
</div>
</nav>
{% endblock %}
<div
class=
"row"
>
<div
class=
"col-3"
>
{% block sidebar %}
<div
class=
"d-flex flex-column flex-shrink-0 p-3 text-bg-dark"
style=
"width: 280px;"
>
<a
href=
"/"
class=
"d-flex align-items-center mb-3 mb-md-0 me-md-auto text-white text-decoration-none"
>
<svg
class=
"bi pe-none me-2"
width=
"40"
height=
"32"
>
<use
xlink:href=
"#bootstrap"
></use>
</svg>
<span
class=
"fs-4"
>
Sidebar
</span>
</a>
<hr>
<ul
class=
"nav nav-pills flex-column mb-auto"
>
<li
class=
"nav-item"
>
<a
href=
"#"
class=
"nav-link active"
aria-current=
"page"
>
<svg
class=
"bi pe-none me-2"
width=
"16"
height=
"16"
>
<use
xlink:href=
"#home"
></use>
</svg>
Home
</a>
</li>
<li>
<a
href=
"#"
class=
"nav-link text-white"
>
<svg
class=
"bi pe-none me-2"
width=
"16"
height=
"16"
>
<use
xlink:href=
"#speedometer2"
></use>
</svg>
Dashboard
</a>
</li>
<li>
<a
href=
"#"
class=
"nav-link text-white"
>
<svg
class=
"bi pe-none me-2"
width=
"16"
height=
"16"
>
<use
xlink:href=
"#table"
></use>
</svg>
Orders
</a>
</li>
<li>
<a
href=
"#"
class=
"nav-link text-white"
>
<svg
class=
"bi pe-none me-2"
width=
"16"
height=
"16"
>
<use
xlink:href=
"#grid"
></use>
</svg>
Products
</a>
</li>
<li>
<a
href=
"#"
class=
"nav-link text-white"
>
<svg
class=
"bi pe-none me-2"
width=
"16"
height=
"16"
>
<use
xlink:href=
"#people-circle"
></use>
</svg>
Customers
</a>
</li>
</ul>
<hr>
<div
class=
"dropdown"
>
<a
href=
"#"
class=
"d-flex align-items-center text-white text-decoration-none dropdown-toggle"
data-bs-toggle=
"dropdown"
aria-expanded=
"false"
>
<img
src=
"https://github.com/mdo.png"
alt=
""
width=
"32"
height=
"32"
class=
"rounded-circle me-2"
>
<strong>
mdo
</strong>
</a>
<ul
class=
"dropdown-menu dropdown-menu-dark text-small shadow"
>
<li><a
class=
"dropdown-item"
href=
"#"
>
New project...
</a></li>
<li><a
class=
"dropdown-item"
href=
"#"
>
Settings
</a></li>
<li><a
class=
"dropdown-item"
href=
"#"
>
Profile
</a></li>
<li>
<hr
class=
"dropdown-divider"
>
</li>
<li><a
class=
"dropdown-item"
href=
"#"
>
Sign out
</a></li>
</ul>
</div>
</div>
{% endblock %}
</div>
<div
class=
"col-9"
>
<div
id=
"content"
>
{% block content %}
{% endblock %}
</div>
</div>
</div>
<div
id=
"footer"
>
{% block footer %}
footer
{% endblock %}
</div>
<script
src=
"https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
integrity=
"sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
crossorigin=
"anonymous"
></script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/hogwarts_testing_platform/templates/child.html
0 → 100644
+
14
-
0
View file @
e641d336
{% extends "base.html" %}
{% block title %}Title Index{% endblock %}
{% block head %}
{{ super() }}
<style
type=
"text/css"
>
.important
{
color
:
#336699
;
}
</style>
{% endblock %}
{% block content %}
content
{% endblock %}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/hogwarts_testing_platform/templates/login.html
0 → 100644
+
36
-
0
View file @
e641d336
{% extends "base.html" %}
{% block title %}Title Index{% endblock %}
{% block head %}
{{ super() }}
<style
type=
"text/css"
>
.important
{
color
:
#336699
;
}
</style>
{% endblock %}
{% block navbar %}
{% endblock %}
{% block sidebar %}
{% endblock %}
{% block content %}
<form>
<div
class=
"mb-3"
>
<label
for=
"exampleInputEmail1"
class=
"form-label"
>
Email address
</label>
<input
type=
"email"
class=
"form-control"
id=
"exampleInputEmail1"
aria-describedby=
"emailHelp"
>
<div
id=
"emailHelp"
class=
"form-text"
>
We'll never share your email with anyone else.
</div>
</div>
<div
class=
"mb-3"
>
<label
for=
"exampleInputPassword1"
class=
"form-label"
>
Password
</label>
<input
type=
"password"
class=
"form-control"
id=
"exampleInputPassword1"
>
</div>
<div
class=
"mb-3 form-check"
>
<input
type=
"checkbox"
class=
"form-check-input"
id=
"exampleCheck1"
>
<label
class=
"form-check-label"
for=
"exampleCheck1"
>
Check me out
</label>
</div>
<button
type=
"submit"
class=
"btn btn-primary"
>
Submit
</button>
</form>
{% endblock %}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/hogwarts_testing_platform/templates/testcase_create.html
0 → 100644
+
16
-
0
View file @
e641d336
{% extends "base.html" %}
{% block title %}Title Index{% endblock %}
{% block content %}
<div
class=
"mb-3"
>
<label
for=
"exampleFormControlInput1"
class=
"form-label"
>
Email address
</label>
<input
type=
"email"
class=
"form-control"
id=
"exampleFormControlInput1"
placeholder=
"name@example.com"
>
</div>
<div
class=
"mb-3"
>
<label
for=
"exampleFormControlTextarea1"
class=
"form-label"
>
Example textarea
</label>
<textarea
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
></textarea>
</div>
<button
type=
"submit"
class=
"btn btn-primary"
>
保存
</button>
{% endblock %}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets