Actual some sort of navigation system

This commit is contained in:
Sunpy 2018-01-13 21:39:01 +01:00
parent c122acf968
commit 37ade4fd34
3 changed files with 39 additions and 8 deletions

9
templates/download.html Normal file
View File

@ -0,0 +1,9 @@
{% extends "layout.html" %}
{% block body %}
test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>
test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>
test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>
test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>
test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>
test<br>test<br>test<br>test<br>test<br>test<br>test<br>test<br>
{% endblock %}

View File

@ -1,3 +1,17 @@
{% set header_links =
{
"Home":
{
"endpoint": "home_index",
"href": "/home"
},
"Download":
{
"endpoint": "download_index",
"href": "/download"
}
}
%}
<html>
<head>
<title>osu!wayback</title>
@ -51,13 +65,15 @@
<body class="pushable">
<div class="ui large top fixed inverted menu transition hidden">
<div class="ui container">
<a class="active item">Home</a>
<a class="item">Downloader</a>
{% for entry in header_links.keys() %}
<a class="{% if header_links[entry]["endpoint"] == request.endpoint %}active{% endif %} item" href="{{ header_links[entry]["href"] }}">{{entry}}</a>
{% endfor %}
</div>
</div>
<div class="ui vertical inverted sidebar menu left" style="">
<a class="active item">Home</a>
<a class="item">Downloader</a>
<div class="ui vertical inverted sidebar menu left">
{% for entry in header_links.keys() %}
<a class="{% if header_links[entry]["endpoint"] == request.endpoint %}active{% endif %} item" href="{{ header_links[entry]["href"] }}">{{entry}}</a>
{% endfor %}
</div>
<div class="pusher">
<div class="ui inverted vertical masthead center aligned segment">
@ -66,8 +82,9 @@
<a class="toc item">
<i class="sidebar icon"></i>
</a>
<a class="active item">Home</a>
<a class="item">Downloader</a>
{% for entry in header_links.keys() %}
<a class="{% if header_links[entry]["endpoint"] == request.endpoint %}active{% endif %} item" href="{{ header_links[entry]["href"] }}">{{entry}}</a>
{% endfor %}
</div>
</div>
</div>

7
web.py
View File

@ -1,7 +1,7 @@
import json
import MySQLdb
import MySQLdb.cursors
from flask import Flask, make_response, request, render_template
from flask import Flask, make_response, request, render_template, jsonify
app = Flask(__name__)
@ -9,8 +9,13 @@ with open("config.json", "r") as f:
config = json.load(f)
@app.route("/")
@app.route("/home")
def home_index():
return render_template("index.html")
@app.route("/download")
def download_index():
return render_template("download.html")
if __name__ == "__main__":
app.run(**config["web"])