summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJonathan Tschanter <jmtw@tutanota.de>2022-01-21 15:13:35 +0100
committerJonathan Tschanter <jmtw@tutanota.de>2022-01-21 15:13:35 +0100
commit432bba3dee1d9be25b9626ac45115929a6422961 (patch)
tree22964fb4b3f55aa1594067af238344f150d4d9ad /templates
parent2bde1b0660585e16116fbd12c86b53e886b6f3be (diff)
Add layout based on list entries
Diffstat (limited to 'templates')
-rw-r--r--templates/base.twig8
-rw-r--r--templates/card/card.twig8
-rw-r--r--templates/card/card_add.twig18
-rw-r--r--templates/card/card_display.twig51
-rw-r--r--templates/card/card_edit.twig40
-rw-r--r--templates/card/card_list.twig56
-rw-r--r--templates/dashboard.twig40
7 files changed, 155 insertions, 66 deletions
diff --git a/templates/base.twig b/templates/base.twig
index a27b5d7..758b6f8 100644
--- a/templates/base.twig
+++ b/templates/base.twig
@@ -2,9 +2,13 @@
{% block css %}
{{ parent() }}
+ <!-- SimpleCSS -->
<link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css">
<link rel="stylesheet" href="/css/style.css"/>
+
+ <!-- Fork Awesome Icons -->
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fork-awesome@1.2.0/css/fork-awesome.min.css" integrity="sha256-XoaMnoYC5TH6/+ihMEnospgm0J1PM/nioxbOUdnM8HY=" crossorigin="anonymous">
{% endblock %}
{% block body %}
@@ -12,7 +16,9 @@
<nav>
<a href="/dashboard">Dashboard</a>
<a href="/card/list">Cards</a>
- <a href="/card/add">New Card</a>
+ <a href="/events/list">Events</a>
+ <a href="/news/list">News</a>
+ <a href="https://gitlab.com/DRogueRonin/elements">Gitlab</a>
</nav>
<h1>Elements</h1>
<p>{% block subtitle %}{% endblock %}</p>
diff --git a/templates/card/card.twig b/templates/card/card.twig
index 9a91bfa..fcf6bd0 100644
--- a/templates/card/card.twig
+++ b/templates/card/card.twig
@@ -4,9 +4,11 @@
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>
+ <div class="content content-header">
+ <button onclick="location.href='/card/list'">Overview</button>
+ <button onclick="location.href='/card/add'">New Card</button>
+ </div>
+ <div class="content content-header">
<h3>{% block pagetitle %}{% endblock %}</h3>
</div>
diff --git a/templates/card/card_add.twig b/templates/card/card_add.twig
index ef01632..db91fc4 100644
--- a/templates/card/card_add.twig
+++ b/templates/card/card_add.twig
@@ -1,6 +1,24 @@
{% extends 'card/card.twig' %}
{% block pagetitle %}
+ Edit Card
+{% endblock %}
+{% block pagecontent %}
+ <div class="content">
+ <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>
+ </div>
+{% endblock %}
+
+{% block pagetitle %}
Add Card
{% endblock %}
{% block pagecontent %}
diff --git a/templates/card/card_display.twig b/templates/card/card_display.twig
index 27d5bea..7b2ed3e 100644
--- a/templates/card/card_display.twig
+++ b/templates/card/card_display.twig
@@ -4,22 +4,45 @@
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 %}
+ <div class="content">
+ <button onclick="location.href='/card/{{ card.id }}/edit'">Edit</button>
+ </div>
+
+ <div class="content">
+ <div class="row">
+ <div class="column column-5">
+ <button class="vote"><i class="fa fa-thumbs-o-up" aria-hidden="true"></i></button>
+ {{ card.getVotesTotal() }}
+ <button class="vote"><i class="fa fa-thumbs-o-down" aria-hidden="true"></i></button>
+ </div>
+ <div class="column column-95">
+ {% for meta in card.meta %}
+ <p>
+ <label>{{ meta.key }}</label><br>
+ <input type="text" name="{{ meta.key }}" value="{{ meta.value }}" disabled>
+ </p>
+ {% endfor %}
+ </div>
+ </div>
+ </div>
- <button onclick="location.href='/card/{{ card.id }}/edit'">Edit</button>
+ <div class="content content-header">
+ <h3>Artworks</h3>
+ </div>
- <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>
+ <div class="content">
+ <div class="row">
+ <div class="column column-5">
+ <button class="vote"><i class="fa fa-thumbs-o-up" aria-hidden="true"></i></button>
+ {{ artwork.getVotesTotal() }}
+ <button class="vote"><i class="fa fa-thumbs-o-down" aria-hidden="true"></i></button>
+ </div>
+ <div class="column column-95">
+ <img class="image" src='{{ artwork.path }}'>
+ <button onclick="location.href='/artwork/{{ artwork.id }}'">Show</button>
+ </div>
+ </div>
+ </div>
{% endfor %}
{% endblock %}
diff --git a/templates/card/card_edit.twig b/templates/card/card_edit.twig
index a7f9aa7..b066437 100644
--- a/templates/card/card_edit.twig
+++ b/templates/card/card_edit.twig
@@ -4,23 +4,33 @@
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 %}
+ <div class="content">
+ <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>
+ <input type="submit" value="Save">
+ </form>
+ </div>
+
+ <div class="content content-header">
+ <h3>Edit Artworks</h3>
+ </div>
+
+ <div class="content">
+ <button>Add Artwork</button>
+ </div>
- <h4>Artworks</h4>
{% for artwork in card.artworks %}
- <p>
- <img style='max-width: 100%; max-height:300px;' src='{{ artwork.path }}'>
+ <div class="content">
+ <img class="image" src='{{ artwork.path }}'>
<button onclick="location.href='/artwork/{{ artwork.id }}/edit'">Edit</button>
- <button onclick="location.href='/artwork/{{ artwork.id }}'">Delete</button>
- </p>
+ <button>Remove</button>
+ </div>
{% endfor %}
-{% endblock %}
+
+{% endblock %} \ No newline at end of file
diff --git a/templates/card/card_list.twig b/templates/card/card_list.twig
index 1714fc8..b6d8bbe 100644
--- a/templates/card/card_list.twig
+++ b/templates/card/card_list.twig
@@ -4,35 +4,35 @@
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>
+ {% for card in cards %}
+ <div class="content">
+ <div class="row">
+ <div class="column column-5">
+ <button class="vote"><i class="fa fa-thumbs-o-up" aria-hidden="true"></i></button>
{{ card.getVotesTotal() }}
- <button>Up</button>
- <button>Down</button>
- </td>
- <td>
+ <button class="vote"><i class="fa fa-thumbs-o-down" aria-hidden="true"></i></button>
+ </div>
+ <div class="column column-95">
+ <table>
+ <thead>
+ <tr>
+ {% for meta in card.getAllMeta() %}
+ <th>{{ meta.key }}</th>
+ {% endfor %}
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ {% for meta in card.getAllMeta() %}
+ <td>{{ meta.value }}</td>
+ {% endfor %}
+ </tr>
+ </tbody>
+ </table>
<button onclick="location.href='/card/{{ card.id }}'">Card</button>
<button onclick="location.href='/card/{{ card.id }}/artworks'">Artworks</button>
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
+ </div>
+ </div>
+ </div>
+ {% endfor %}
{% endblock %}
diff --git a/templates/dashboard.twig b/templates/dashboard.twig
index 31f2353..97534bf 100644
--- a/templates/dashboard.twig
+++ b/templates/dashboard.twig
@@ -4,9 +4,39 @@
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>
+ <div class="content content-header">
+ <h3>Hello World</h3>
+ </div>
+ <div class="content content-header">
+ <h3>Cards</h3>
+ </div>
+ <div class="content">
+ <h4>Card of the day</h4>
+ <div class="row">
+ <div class="column column-5">
+ <button class="vote"><i class="fa fa-thumbs-o-up" aria-hidden="true"></i></button>
+ {{ cardOfTheDay.getVotesTotal() }}
+ <button class="vote"><i class="fa fa-thumbs-o-down" aria-hidden="true"></i></button>
+ </div>
+ <div class="column column-95">
+ {% for meta in cardOfTheDay.meta %}
+ <p>
+ <label>{{ meta.key }}</label><br>
+ <input type="text" name="{{ meta.key }}" value="{{ meta.value }}" disabled>
+ </p>
+ {% endfor %}
+ </div>
+ <button onclick="location.href='/card/{{ cardOfTheDay.id }}'">Card</button>
+ <button onclick="location.href='/card/{{ cardOfTheDay.id }}/artworks'">Artworks</button>
+ </div>
+ </div>
+ <div class="content">
+ <h4>Updates to my cards</h4>
+ </div>
+ <div class="content content-header">
+ <h3>Events</h3>
+ </div>
+ <div class="content content-header">
+ <h3>News</h3>
+ </div>
{% endblock %}