summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJonathan Tschanter <jmtw@tutanota.de>2022-01-21 00:14:34 +0100
committerJonathan Tschanter <jmtw@tutanota.de>2022-01-21 00:14:34 +0100
commit2bde1b0660585e16116fbd12c86b53e886b6f3be (patch)
tree8c23fbad83e8b947c60a50b7af6be2c8b0d4867a /templates
parentc2b0ebcdbb23a38a31b4d8c9e39f2a2be4cc862b (diff)
Add first layout with simplecss
Diffstat (limited to 'templates')
-rw-r--r--templates/base.twig26
-rw-r--r--templates/card/card.twig16
-rw-r--r--templates/card/card_add.twig29
-rw-r--r--templates/card/card_display.twig25
-rw-r--r--templates/card/card_edit.twig26
-rw-r--r--templates/card/card_list.twig38
-rw-r--r--templates/dashboard.twig12
-rw-r--r--templates/root.twig14
8 files changed, 186 insertions, 0 deletions
diff --git a/templates/base.twig b/templates/base.twig
new file mode 100644
index 0000000..a27b5d7
--- /dev/null
+++ b/templates/base.twig
@@ -0,0 +1,26 @@
+{% extends 'root.twig' %}
+
+{% block css %}
+ {{ parent() }}
+ <link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css">
+
+ <link rel="stylesheet" href="/css/style.css"/>
+{% endblock %}
+
+{% block body %}
+ <header>
+ <nav>
+ <a href="/dashboard">Dashboard</a>
+ <a href="/card/list">Cards</a>
+ <a href="/card/add">New Card</a>
+ </nav>
+ <h1>Elements</h1>
+ <p>{% block subtitle %}{% endblock %}</p>
+ </header>
+ <main>
+ {% block main %}{% endblock %}
+ </main>
+ <footer>
+ visit <a href="https://gitlab.com/DRogueRonin/elements">Gitlab</a>
+ </footer>
+{% endblock %}
diff --git a/templates/card/card.twig b/templates/card/card.twig
new file mode 100644
index 0000000..9a91bfa
--- /dev/null
+++ b/templates/card/card.twig
@@ -0,0 +1,16 @@
+{% extends 'base.twig' %}
+
+{% block subtitle %}
+ Cards
+{% endblock %}
+{% block main %}
+ <div style="align-content: center; text-align: center">
+ <button onclick="location.href='/card/list'">List</button>
+ <button onclick="location.href='/card/add'">Add</button>
+ <h3>{% block pagetitle %}{% endblock %}</h3>
+ </div>
+
+ <div style="align-content: center;">
+ {% block pagecontent %}{% endblock %}
+ </div>
+{% endblock %}
diff --git a/templates/card/card_add.twig b/templates/card/card_add.twig
new file mode 100644
index 0000000..ef01632
--- /dev/null
+++ b/templates/card/card_add.twig
@@ -0,0 +1,29 @@
+{% extends 'card/card.twig' %}
+
+{% block pagetitle %}
+ Add Card
+{% endblock %}
+{% block pagecontent %}
+ <form action="/card/add" method="post" enctype="multipart/form-data">
+ {% for key, field in fields %}
+ <p>
+ <label>{{ key }}</label><br>
+ <input type="text" name="{{ field }}">
+ </p>
+ {% endfor %}
+
+ <!--
+ {% for meta in card.meta %}
+ <p>
+ <label>{{ meta.key }}</label><br>
+ <input type="text" name="{{ meta.key }}" value="{{ meta.value }}" disabled>
+ </p>
+ {% endfor %}
+ -->
+
+ <h4>Artworks</h4>
+ <input type="file" name="images[]" multiple>
+
+ <input type="submit" value="Add">
+ </form>
+{% endblock %}
diff --git a/templates/card/card_display.twig b/templates/card/card_display.twig
new file mode 100644
index 0000000..27d5bea
--- /dev/null
+++ b/templates/card/card_display.twig
@@ -0,0 +1,25 @@
+{% extends 'card/card.twig' %}
+
+{% block pagetitle %}
+ Show Card
+{% endblock %}
+{% block pagecontent %}
+ {% for meta in card.meta %}
+ <p>
+ <label>{{ meta.key }}</label><br>
+ <input type="text" name="{{ meta.key }}" value="{{ meta.value }}" disabled>
+ </p>
+ {% endfor %}
+
+ <button onclick="location.href='/card/{{ card.id }}/edit'">Edit</button>
+
+ <h4>Artworks</h4>
+ {% for artwork in card.artworks %}
+ <p>
+ <img style='max-width: 100%; max-height:300px;' src='{{ artwork.path }}'>
+ <button>Up</button>
+ <button>Down</button>
+ <button onclick="location.href='/artwork/{{ artwork.id }}'">Show</button>
+ </p>
+ {% endfor %}
+{% endblock %}
diff --git a/templates/card/card_edit.twig b/templates/card/card_edit.twig
new file mode 100644
index 0000000..a7f9aa7
--- /dev/null
+++ b/templates/card/card_edit.twig
@@ -0,0 +1,26 @@
+{% extends 'card/card.twig' %}
+
+{% block pagetitle %}
+ Edit Card
+{% endblock %}
+{% block pagecontent %}
+ <form action="/card/{{ card.id }}/edit" method="post" enctype="multipart/form-data">
+ {% for meta in card.meta %}
+ <p>
+ <label>{{ meta.key }}</label><br>
+ <input type="text" name="{{ meta.key }}" value="{{ meta.value }}">
+ </p>
+ {% endfor %}
+
+ <input type="submit" value="Save">
+ </form>
+
+ <h4>Artworks</h4>
+ {% for artwork in card.artworks %}
+ <p>
+ <img style='max-width: 100%; max-height:300px;' src='{{ artwork.path }}'>
+ <button onclick="location.href='/artwork/{{ artwork.id }}/edit'">Edit</button>
+ <button onclick="location.href='/artwork/{{ artwork.id }}'">Delete</button>
+ </p>
+ {% endfor %}
+{% endblock %}
diff --git a/templates/card/card_list.twig b/templates/card/card_list.twig
new file mode 100644
index 0000000..1714fc8
--- /dev/null
+++ b/templates/card/card_list.twig
@@ -0,0 +1,38 @@
+{% extends 'card/card.twig' %}
+
+{% block pagetitle %}
+List
+{% endblock %}
+{% block pagecontent %}
+ <table>
+ <thead>
+ <tr>
+ <th>ID</th>
+ {% for meta in cards[0].getAllMeta() %}
+ <th>{{ meta.key }}</th>
+ {% endfor %}
+ <th>Votes</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for card in cards %}
+ <tr>
+ <td>{{ card.id }}</td>
+ {% for meta in card.getAllMeta() %}
+ <td>{{ meta.value }}</td>
+ {% endfor %}
+ <td>
+ {{ card.getVotesTotal() }}
+ <button>Up</button>
+ <button>Down</button>
+ </td>
+ <td>
+ <button onclick="location.href='/card/{{ card.id }}'">Card</button>
+ <button onclick="location.href='/card/{{ card.id }}/artworks'">Artworks</button>
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+{% endblock %}
diff --git a/templates/dashboard.twig b/templates/dashboard.twig
new file mode 100644
index 0000000..31f2353
--- /dev/null
+++ b/templates/dashboard.twig
@@ -0,0 +1,12 @@
+{% extends 'base.twig' %}
+
+{% block subtitle %}
+ Dashboard
+{% endblock %}
+{% block main %}
+ <p>Home?</p>
+ <p>Updates to own cards?</p>
+ <p>Card of the day?</p>
+ <p>Events?</p>
+ <p>News?</p>
+{% endblock %}
diff --git a/templates/root.twig b/templates/root.twig
new file mode 100644
index 0000000..9c3534e
--- /dev/null
+++ b/templates/root.twig
@@ -0,0 +1,14 @@
+<html>
+<head>
+ <title>Elements</title>
+
+ {% block css %}{% endblock %}
+</head>
+<body>
+{% block body %}{% endblock %}
+<script>
+
+</script>
+{% block js %}{% endblock %}
+</body>
+</html> \ No newline at end of file