Updated HTML formatting (#580) (#581)

This commit is contained in:
Nico Coetzee 2024-06-21 08:06:45 +02:00 committed by GitHub
parent acff1bbab8
commit a70b77d608
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 42 additions and 39 deletions

View File

@ -256,19 +256,20 @@ def handle_rpc():
@auth("list")
def simpleindex():
links = sorted(config.backend.get_projects())
tmpl = """\
<!DOCTYPE html>
<html>
<head>
<title>Simple Index</title>
</head>
<body>
<h1>Simple Index</h1>
% for p in links:
<a href="{{p}}/">{{p}}</a><br>
% end
</body>
</html>
tmpl = """<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Simple Index</title>
</head>
<body>
<h1>Simple Index</h1>
% for p in links:
<a href="{{p}}/">{{p}}</a><br>
% end
</body>
</html>
"""
return template(tmpl, links=links)
@ -300,19 +301,20 @@ def simple(project):
for pkg in packages
)
tmpl = """\
<!DOCTYPE html>
<html>
<head>
<title>Links for {{project}}</title>
</head>
<body>
<h1>Links for {{project}}</h1>
% for file, href in links:
<a href="{{href}}">{{file}}</a><br>
% end
</body>
</html>
tmpl = """<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Links for {{project}}</title>
</head>
<body>
<h1>Links for {{project}}</h1>
% for file, href in links:
<a href="{{href}}">{{file}}</a><br>
% end
</body>
</html>
"""
return template(tmpl, project=project, links=links)
@ -330,19 +332,20 @@ def list_packages():
(pkg.relfn_unix, urljoin(fp, pkg.fname_and_hash)) for pkg in packages
)
tmpl = """\
<!DOCTYPE html>
<html>
<head>
<title>Index of packages</title>
</head>
<body>
<h1>Index of packages</h1>
% for file, href in links:
<a href="{{href}}">{{file}}</a><br>
% end
</body>
</html>
tmpl = """<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Index of packages</title>
</head>
<body>
<h1>Index of packages</h1>
% for file, href in links:
<a href="{{href}}">{{file}}</a><br>
% end
</body>
</html>
"""
return template(tmpl, links=links)