From 43c249ce9f87cb1ec87d92dbc18f6b667ae75579 Mon Sep 17 00:00:00 2001 From: Trever Fischer Date: Sat, 17 Nov 2012 16:04:54 -0500 Subject: [PATCH] Make a common "item" element for templates --- static/css/items.css | 3 +++ templates/common/item.html | 12 ++++++++++++ templates/vault/index.html | 15 +++------------ 3 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 templates/common/item.html diff --git a/static/css/items.css b/static/css/items.css index cf24b25..69267f6 100644 --- a/static/css/items.css +++ b/static/css/items.css @@ -1,6 +1,9 @@ .inventory td { padding: 0; margin: 0; + min-width: 64px; + height: 64px; + border: 1px solid black; } div[class|="inventory-item"] { diff --git a/templates/common/item.html b/templates/common/item.html new file mode 100644 index 0000000..ad779b4 --- /dev/null +++ b/templates/common/item.html @@ -0,0 +1,12 @@ +
+ {% if quantity > 0 %} +
{{quantity}}
+ {% endif %} +
{{item.name}}
+ {% if item.damage %} +
+
+
+ {% endif %} +
diff --git a/templates/vault/index.html b/templates/vault/index.html index 1f915c1..6a72f02 100644 --- a/templates/vault/index.html +++ b/templates/vault/index.html @@ -12,18 +12,9 @@ {% endif %} -
- {% if slot.quantity > 0 %} -
{{slot.quantity}}
{{slot.name}}
- {% if slot.damage %} -
-
-
- {% endif %} - {% endif %} -
+ {% if slot.item %} + {% include 'common/item.html' with quantity=slot.quantity item=slot.item %} + {% endif %} {% endfor %}