aboutsummaryrefslogtreecommitdiffstats
path: root/templates/main
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-02-21 09:30:05 +0000
committerGravatar Gareth Coles <[email protected]>2018-02-21 09:30:05 +0000
commitef8e96157f60ba0813cab72a90a6e8e92b44b6f0 (patch)
treecbda21178338d3f992072d5f06e4ac4572e433f1 /templates/main
parentadds initial unit testing (#22) (diff)
Rearrange views and templates
Diffstat (limited to 'templates/main')
-rw-r--r--templates/main/base.html18
-rw-r--r--templates/main/index.html9
-rw-r--r--templates/main/navigation.html19
-rw-r--r--templates/main/ws_test.html24
4 files changed, 70 insertions, 0 deletions
diff --git a/templates/main/base.html b/templates/main/base.html
new file mode 100644
index 00000000..5dd0c02c
--- /dev/null
+++ b/templates/main/base.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ {% block head %}
+ <title>Python | {% block title %}{% endblock %}</title>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
+ <script defer src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.39/js/uikit.min.js"></script>
+ <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.39/css/uikit.min.css" />
+ {% endblock %}
+</head>
+<body>
+{% include "navigation.html" %}
+{% block content %}{% endblock %}
+</body>
+</html>
diff --git a/templates/main/index.html b/templates/main/index.html
new file mode 100644
index 00000000..418347d2
--- /dev/null
+++ b/templates/main/index.html
@@ -0,0 +1,9 @@
+{% extends "base.html" %}
+{% block title %}Home{% endblock %}
+{% block content %}
+ <div class="uk-container uk-section">
+ <h1 class="uk-title uk-text-center">
+ Coming soon :tm:
+ </h1>
+ </div>
+{% endblock %} \ No newline at end of file
diff --git a/templates/main/navigation.html b/templates/main/navigation.html
new file mode 100644
index 00000000..cbd6a36a
--- /dev/null
+++ b/templates/main/navigation.html
@@ -0,0 +1,19 @@
+<div class="uk-container uk-container-expand uk-section-secondary">
+ <nav data-uk-navbar class="uk-navbar-container uk-navbar-transparent">
+ <div class="uk-navbar-left">
+ <a href="/" class="uk-navbar-item uk-logo">
+ <img src="/static/logos/logo_banner.png" style="height: 50px;"/>
+ </a>
+ </div>
+ <div class="uk-navbar-right">
+ <ul class="uk-navbar-nav">
+ {% if current_page == "index" %}
+ <li class="uk-active"><a href="/"><i class="uk-icon fas fa-home"></i> &nbsp;Home</a></li>
+ {% else %}
+ <li><a href="/"><i class="uk-icon fas fa-home"></i> &nbsp;Home</a></li>
+ {% endif %}
+ <li><a href="/invite"><i class="uk-icon fab fa-discord"></i> &nbsp;Discord</a></li>
+ </ul>
+ </div>
+ </nav>
+</div> \ No newline at end of file
diff --git a/templates/main/ws_test.html b/templates/main/ws_test.html
new file mode 100644
index 00000000..6ef1bb68
--- /dev/null
+++ b/templates/main/ws_test.html
@@ -0,0 +1,24 @@
+{% extends "base.html" %}
+{% block title %}WS Test{% endblock %}
+{% block content %}
+ <div class="uk-container uk-section">
+ <h1>Open your JS console to test</h1>
+
+ <script type="application/javascript">
+ let ws = new WebSocket("wss://api.{{ server_name }}/ws/echo");
+
+ ws.onopen = function(event) {
+ console.log("WS opened! Use send() to send a message.");
+ };
+
+ ws.onmessage = function (event) {
+ console.log("<- " + event.data);
+ };
+
+ function send(text) {
+ console.log("-> " + text);
+ ws.send(text);
+ }
+ </script>
+ </div>
+{% endblock %}