From 4ba0165e7cb5126971c6e7d9376b506df523da99 Mon Sep 17 00:00:00 2001 From: s3lph Date: Wed, 11 Jul 2018 15:32:07 +0200 Subject: [PATCH] Added some barebones CSS to display the user- and product-list in a somewhat acceptable way. --- static/css/matemat.css | 31 +++++++++++++++++++++++++++++++ templates/base.html | 1 + templates/productlist.html | 11 +++++++---- templates/userlist.html | 5 ++++- 4 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 static/css/matemat.css diff --git a/static/css/matemat.css b/static/css/matemat.css new file mode 100644 index 0000000..ef813ca --- /dev/null +++ b/static/css/matemat.css @@ -0,0 +1,31 @@ +.thumblist-item { + display: inline-block; + margin: 10px; + padding: 10px; + background: #f0f0f0; + text-decoration: none; +} + +.thumblist-item a { + text-decoration: none; +} + +.thumblist-item .imgcontainer { + width: 150px; + height: 150px; + position: relative; +} + +.thumblist-item .imgcontainer img { + max-width: 150px; + max-height: 150px; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} + +.thumblist-title { + display: block; + font-weight: bolder; +} diff --git a/templates/base.html b/templates/base.html index 6d4e379..76136bf 100644 --- a/templates/base.html +++ b/templates/base.html @@ -3,6 +3,7 @@ {% block head %} Matemat + {% endblock %} diff --git a/templates/productlist.html b/templates/productlist.html index 4c0c093..4e4d7e0 100644 --- a/templates/productlist.html +++ b/templates/productlist.html @@ -10,9 +10,9 @@ {% block main %} Your balance: {{ authuser.balance }} - -Deposit CHF 1 -Deposit CHF 10 +
+Deposit CHF 1
+Deposit CHF 10
{% for product in products %}
@@ -25,10 +25,13 @@ Your balance: {{ authuser.balance }} {{ product.price_non_member }} {% endif %} ; Stock: {{ product.stock }}
- Picture of {{ product.name }} +
+ Picture of {{ product.name }} +
{% endfor %} +
Logout {{ super() }} diff --git a/templates/userlist.html b/templates/userlist.html index 64a3f82..d1724f9 100644 --- a/templates/userlist.html +++ b/templates/userlist.html @@ -10,10 +10,13 @@
{{ user.name }}
- Avatar of {{ user.name }} +
+ Avatar of {{ user.name }} +
{% endfor %} +
Password-based login {{ super() }} {% endblock %}