Functional web interface

This commit is contained in:
da
2017-01-19 22:49:17 +01:00
parent 0ffa002ba9
commit f0cff35bea
7 changed files with 81 additions and 98 deletions
+11
View File
@@ -0,0 +1,11 @@
{{ define "footer" }}
</div>
</div>
<!-- /.container -->
</body>
</html>
{{ end }}
+10 -13
View File
@@ -1,4 +1,4 @@
{{ define "base" }}
{{ define "header" }}
<html>
<head>
@@ -15,6 +15,11 @@
body {
padding-top: 50px;
}
.vcenter {
display: inline-block;
vertical-align: middle;
float: none;
}
</style>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -46,17 +51,9 @@
</nav>
<div class="container">
<div class="starter-template">
<div class="container-fluid">
<h1>Gidbig</h1>
<p class="lead">{{ template "content" . }}</p>
</div>
<p class="lead">{{ template "sessionHandler" . }}</p>
{{ end }}
</div>
<!-- /.container -->
</body>
</html>
{{ end }}
+1 -1
View File
@@ -1,3 +1,3 @@
{{ define "content" }}
{{ define "sessionHandler" }}
<a href="/discordLogin">Login with Discord</a>
{{ end }}
+5 -5
View File
@@ -1,12 +1,12 @@
{{ define "content" }}
{{ define "sessionHandler" }}
<script type="text/javascript">
function playSound() {
function playSound(cmd, sndnm) {
var data = {
command: "!bsth",
soundname: "unmoeglich"
command: cmd,
soundname: sndnm
};
$.post("/playsound", data, function(data, success) {});
}
</script>
<a href="/logout">Logout</a><br/>
<a href="javascript:playSound()">Play sound</a> {{ end }}
{{ end }}
+5
View File
@@ -0,0 +1,5 @@
<div class="row">
{{ range . }}
<div class="col-sm-3 text-center">{{ .Itemtext }}<br/><a class="btn btn-primary" href="javascript:playSound('{{ .Itemcommand }}', '{{ .Itemsoundname }}')" role="button">Play!</a></div>
{{ end }}
</div>