aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/delete-link.html32
-rw-r--r--templates/footer.html5
-rw-r--r--templates/head.html5
-rw-r--r--templates/links.html39
-rw-r--r--templates/nav.html17
-rw-r--r--templates/new-link.html36
6 files changed, 134 insertions, 0 deletions
diff --git a/templates/delete-link.html b/templates/delete-link.html
new file mode 100644
index 0000000..809a57e
--- /dev/null
+++ b/templates/delete-link.html
@@ -0,0 +1,32 @@
1<!DOCTYPE html>
2<html lang="en">
3 <head>
4 {% include "head.html" %}
5 <title>shrt – Delet a Link</title>
6 </head>
7 <body>
8 <div id="Body" class="Window Dialog">
9 {% include "nav.html" %}
10 <form action="{{ url_for("delete-link") }}" method="post" id="DeleteLinkForm">
11 <table class="InputFields">
12 <tr>
13 <td><label for="id">Shortcut</label></td>
14 <td><input type="text" name="id" id="id" readonly value="{{ link.id_str }}" /></td>
15 </tr>
16 <tr>
17 <td><label for="shortcut">Shortcut</label></td>
18 <td><input type="text" id="shortcut" readonly value="{{ link.shortcut }}" /></td>
19 </tr>
20 <tr>
21 <td><label for="original_url">URL</label></td>
22 <td><input type="url" id="original_url" readonly value="{{ link.original_url }}" /></td>
23 </tr>
24 </table>
25 <div class="ButtonRow">
26 <input type="submit" value="Delete link!" />
27 </div>
28 </form>
29 {% include "footer.html" %}
30 </div>
31 </body>
32</html>
diff --git a/templates/footer.html b/templates/footer.html
new file mode 100644
index 0000000..66d46e2
--- /dev/null
+++ b/templates/footer.html
@@ -0,0 +1,5 @@
1<footer class="StatusBar">
2 <span class="StatusCell">
3 Powered by <a href="https://github.com/MetroWind/shrt">shrt</a>
4 </span>
5</footer>
diff --git a/templates/head.html b/templates/head.html
new file mode 100644
index 0000000..46b21e7
--- /dev/null
+++ b/templates/head.html
@@ -0,0 +1,5 @@
1<meta charset="utf-8">
2<meta name="viewport" content="width=device-width,initial-scale=1">
3<link rel="icon" href="{{ url_for("statics", "icon.svg") }}" type="image/svg+xml">
4<link rel="apple-touch-icon" href="{{ url_for("statics", "icon-180.png") }}">
5<link rel="stylesheet" href="{{ url_for("statics", "styles.css") }}">
diff --git a/templates/links.html b/templates/links.html
new file mode 100644
index 0000000..f3b3e3f
--- /dev/null
+++ b/templates/links.html
@@ -0,0 +1,39 @@
1<!DOCTYPE html>
2<html lang="en">
3 <head>
4 {% include "head.html" %}
5 <meta property="og:title" content="shrt">
6 <meta property="og:type" content="website">
7 <meta property="og:url" content="{{ url_for("links") }}">
8 <title>shrt</title>
9 </head>
10 <body>
11 <div id="Body" class="Window">
12 {% include "nav.html" %}
13 <div class="Toolbar">
14 <a class="FloatButton" href="{{ url_for("new-link") }}">➕</a>
15 </div>
16 <div id="Links">
17 <table class="TableView">
18 <thead><tr>
19 <th>Shortcut</th>
20 <th>URL</th>
21 <th>Regexp?</th>
22 <th>Actions</th>
23 </tr></thead>
24 <tbody>
25 {% for link in links %}
26 <tr>
27 <td>{{ link.shortcut }}</td>
28 <td>{{ link.original_url }}</td>
29 <td>{{ link.type_is_regexp_str }}</td>
30 <td><a href="{{ url_for("delete-link", link.id_str) }}">❌</a></td>
31 </tr>
32 {% endfor %}
33 </tbody>
34 </table>
35 </div>
36 {% include "footer.html" %}
37 </div>
38 </body>
39</html>
diff --git a/templates/nav.html b/templates/nav.html
new file mode 100644
index 0000000..5a89f7a
--- /dev/null
+++ b/templates/nav.html
@@ -0,0 +1,17 @@
1<nav class="Titlebar">
2 <span id="NavLeft">
3 {{ title }}
4 </span>
5
6 <span id="NavCenter"></span>
7
8 <span id="NavRight">
9 <span>
10 {% if length(session_user) > 0 %}
11 {{ session_user }}
12 {% else %}
13 <a href="{{ url_for("login") }}">Login</a>
14 {% endif %}
15 </span>
16 </span>
17</nav>
diff --git a/templates/new-link.html b/templates/new-link.html
new file mode 100644
index 0000000..3ce3fda
--- /dev/null
+++ b/templates/new-link.html
@@ -0,0 +1,36 @@
1<!DOCTYPE html>
2<html lang="en">
3 <head>
4 {% include "head.html" %}
5 <title>shrt – Create a New Link</title>
6 </head>
7 <body>
8 <div id="Body" class="Window Dialog">
9 {% include "nav.html" %}
10 <form action="{{ url_for("create-link") }}" method="post" id="LinkForm">
11 <table class="InputFields">
12 <tr>
13 <td><label for="shortcut">Shortcut</label></td>
14 <td><input type="text" name="shortcut" id="shortcut"
15 minlength="2" pattern="(\p{L}|\p{N}|_|-|\.)+"></td>
16 </tr>
17 <tr>
18 <td><label for="original_url">URL</label></td>
19 <td><input type="url" name="original_url" id="original_url" required></td>
20 </tr>
21 <tr>
22 <td></td>
23 <td>
24 <input type="checkbox" id="regexp" name="regexp">
25 <label for="regexp">Regexp</label>
26 </td>
27 </tr>
28 </table>
29 <div class="ButtonRow">
30 <input type="submit" value="Add link!">
31 </div>
32 </form>
33 {% include "footer.html" %}
34 </div>
35 </body>
36</html>