added and revised templates
This commit is contained in:
parent
7bf2881145
commit
4c6310343d
@ -28,6 +28,9 @@ The program queries the database `db/cts.db` (`./src/dbquery.c`, function `stati
|
||||
- Requests a player's ranks for all maps leaderboards s/he is present on.
|
||||
|
||||
## Usage: Static Page Generation
|
||||
|
||||
python scripts/allmaps.py
|
||||
|
||||
The CGI program is still invoked in static generation. The files `allmaps.py`, `output/leaderboard.css`, `template.html`, `template_map.html` help produce the output.
|
||||
|
||||
Before executing `allmaps.py`, copy and modify the templates.
|
||||
@ -37,8 +40,6 @@ Before executing `allmaps.py`, copy and modify the templates.
|
||||
|
||||
`allmaps.py` outputs an html file for all distinct maps in the database. The leaderboards for each map (equivalent to `?map=[map name]`) are in `output/maps/`.
|
||||
|
||||
python allmaps.py
|
||||
|
||||
## Game Versions Used Under:
|
||||
* Xonotic 0.8.1
|
||||
* Xonotic 0.8.2
|
||||
|
@ -32,11 +32,11 @@ def renderindex(template):
|
||||
|
||||
def main():
|
||||
template = ""
|
||||
with open("template.html", 'r') as fin:
|
||||
with open("templates/overview.html", 'r') as fin:
|
||||
template = fin.read()
|
||||
renderindex(template)
|
||||
maps = getmaps("db/cts.db")
|
||||
with open("template_map.html", 'r') as fin:
|
||||
with open("templates/map.html", 'r') as fin:
|
||||
template = fin.read()
|
||||
# for each map generate an html file.
|
||||
for game_map in maps:
|
||||
|
24
templates/map.html
Normal file
24
templates/map.html
Normal file
@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<!-- %s = map name -->
|
||||
<title>%s - Leaderboards - Minimal Working Example</title>
|
||||
<link href="/style.css" rel="stylesheet" type="text/css" media="all">
|
||||
<!-- <link href="../style.css" rel="stylesheet" type="text/css" media="all"> -->
|
||||
<link href="../leaderboard.css" rel="stylesheet" type="text/css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- map name -->
|
||||
<h1>%s</h1>
|
||||
|
||||
<!-- code generated table goes here -->
|
||||
%s
|
||||
|
||||
<footer>
|
||||
<p>Page generated using <a href="https://notabug.org/scuti/xdfcgi">xdfcgi</a> by <a href="https://scuti.neocities.org/">scuti</a></p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
22
templates/overview.html
Normal file
22
templates/overview.html
Normal file
@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>CTS Leaderboards - Minimal Working Example</title>
|
||||
|
||||
<link href="/style.css" rel="stylesheet" type="text/css" media="all">
|
||||
|
||||
<!-- <link href="./style.css" rel="stylesheet" type="text/css" media="all"> -->
|
||||
<link href="./leaderboard.css" rel="stylesheet" type="text/css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- code generated table goes here -->
|
||||
%s
|
||||
|
||||
<footer>
|
||||
<p>Page generated using <a href="https://notabug.org/scuti/xdfcgi">xdfcgi</a> by <a href="https://scuti.neocities.org/">scuti</a></p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user