forked from server/soundboard
Split templates for edit page
This commit is contained in:
parent
1e40ad6661
commit
e2687550f5
@ -55,3 +55,11 @@ def index(sound=None, text=None, video=None):
|
||||
edit = False
|
||||
|
||||
return render_template("index.html", sounds=sounds, edit=edit)
|
||||
|
||||
@app.route("/edit/<sound>", methods=["GET", "POST"])
|
||||
def edit(sound):
|
||||
if request.method == "POST":
|
||||
# TODO: Store changes
|
||||
return redirect("/edit")
|
||||
|
||||
return render_template("edit.html")
|
||||
|
||||
56
templates/base.html
Normal file
56
templates/base.html
Normal file
@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>WIAI Soundboard</title>
|
||||
<link rel="stylesheet" href="/static/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
{% block navigation %}
|
||||
<nav>
|
||||
<a href="#sounds">Sounds</a>
|
||||
<a href="#youtube">YouTube</a>
|
||||
<a href="#voice">Voice</a>
|
||||
{% if not edit %}
|
||||
<div class="extra"><a href="/edit">Edit</a></div>
|
||||
{% else %}
|
||||
<div class="extra"><a href="/">Done</a></div>
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% endblock %}
|
||||
<content>
|
||||
{% block content %}
|
||||
<section id="sounds">
|
||||
<div><input type="text" id="search" /><span id="reset">⨯</span></div>
|
||||
{% for sound in sounds %}
|
||||
<div class="sound{{ ' edit' if edit }}"><a href="{{ '/' + ('edit' if edit else 'play') + '/' + sound | urlencode }}">{{ sound.split('.', 1)[0] }}</a></div>
|
||||
{% endfor %}
|
||||
</section>
|
||||
<section id="youtube">
|
||||
<form action="/" method="GET">
|
||||
<label for="video">YouTube URL</label>
|
||||
<input type="text" name="video" />
|
||||
<input type="submit" value="Play" />
|
||||
</form>
|
||||
<form action="/" method="GET">
|
||||
<input type="hidden" name="killvideo" value="yes" />
|
||||
<input type="submit" name="submit" value="Terminate videos" />
|
||||
</form>
|
||||
</section>
|
||||
<section id="voice">
|
||||
<form action="/say/" method="POST">
|
||||
<input type="text" name="text" />
|
||||
<input type="text" name="voice" placeholder="DE" />
|
||||
<label for="speed">Speed</label>
|
||||
<input type="range" name="speed" min="80" max="450" step="10" value="160" id="speed" />
|
||||
<label for="pitch">Pitch</label>
|
||||
<input type="range" name="pitch" min="0" max="99" step="1" value="50" id="pitch" />
|
||||
<input type="submit" value="Voice" />
|
||||
</form>
|
||||
</section>
|
||||
{% endblock %}
|
||||
</content>
|
||||
<script src="/static/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
9
templates/edit.html
Normal file
9
templates/edit.html
Normal file
@ -0,0 +1,9 @@
|
||||
{% extends "base.html" %}
|
||||
{% block navigation %}
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<form action="{{ request.path }}" method="POST">
|
||||
<input type="button" value="Cancel" />
|
||||
<input type="submit" value="Submit" />
|
||||
</form>
|
||||
{% endblock %}
|
||||
@ -1,23 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>WIAI Soundboard</title>
|
||||
<link rel="stylesheet" href="/static/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<a href="#sounds">Sounds</a>
|
||||
<a href="#youtube">YouTube</a>
|
||||
<a href="#voice">Voice</a>
|
||||
{% if not edit %}
|
||||
<div class="extra"><a href="/edit">Edit</a></div>
|
||||
{% else %}
|
||||
<div class="extra"><a href="/">Done</a></div>
|
||||
{% endif %}
|
||||
</nav>
|
||||
<content>
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<section id="sounds">
|
||||
<div><input type="text" id="search" /><span id="reset">⨯</span></div>
|
||||
{% for sound in sounds %}
|
||||
@ -46,7 +28,4 @@
|
||||
<input type="submit" value="Voice" />
|
||||
</form>
|
||||
</section>
|
||||
</content>
|
||||
<script src="/static/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user