From adb823312013dcbbfa18ecf9f6ffc5863a7752b6 Mon Sep 17 00:00:00 2001 From: Konrad Mohrfeldt Date: Fri, 14 Oct 2011 09:21:13 +0200 Subject: [PATCH] updated buyButton and table.showitem styles updated templates for product listings --- k4ever/buyable/templates/buyables/main | 31 ++++++++++++ .../templates/buyables/product_list.html | 40 +++++++++++++++ .../buyable/templates/buyables/showItems.html | 45 +---------------- k4ever/main/templates/main/product_list.html | 14 ++---- k4ever/media/css/style.css | 49 +++++++++++++++++-- 5 files changed, 123 insertions(+), 56 deletions(-) create mode 100644 k4ever/buyable/templates/buyables/main create mode 100644 k4ever/buyable/templates/buyables/product_list.html diff --git a/k4ever/buyable/templates/buyables/main b/k4ever/buyable/templates/buyables/main new file mode 100644 index 0000000..8fc65b2 --- /dev/null +++ b/k4ever/buyable/templates/buyables/main @@ -0,0 +1,31 @@ +{% if buyables %} + {% if removeWrapper == None %} + + + {% endif %} + {% for buyable in buyables %} + + + + + + {% endfor %} + {% if removeWrapper == None %} + +
+ + {{ buyable.buyable__name }} ({{ buyable.num_buys }} mal gekauft) + {% if buyable.buyable__deposit > 0 %} + Kaufen (Ohne Pfand) + Kaufen (Mit Pfand) + {% if includeDeposit %} + Kaufen (Nur Pfand) + {% endif %} + {% else %} + Kaufen + {% endif %} +
+ {% endif %} +{% else %} +

{{ default|default_if_none:"Noch keine gekauft" }}

+{% endif %} \ No newline at end of file diff --git a/k4ever/buyable/templates/buyables/product_list.html b/k4ever/buyable/templates/buyables/product_list.html new file mode 100644 index 0000000..6fe3755 --- /dev/null +++ b/k4ever/buyable/templates/buyables/product_list.html @@ -0,0 +1,40 @@ +{% if buyables %} + + + {% for buyable in buyables %} + + + + + + {% endfor %} + +
+ + {{ buyable.name }} + {% if buyable.hasDeposit %} + + {{ buyable.price|floatformat:2 }} € + + + + {{ buyable.price|floatformat:2 }} € / {{ buyable.deposit|floatformat:2 }} € + + + + {{ buyable.deposit|floatformat:2 }} € + + + {% else %} + + {{ buyable.price|floatformat:2 }} € + + {% endif %} +
+{% else %} +

{{ default|default_if_none:"Noch keine gekauft" }}

+{% endif %} \ No newline at end of file diff --git a/k4ever/buyable/templates/buyables/showItems.html b/k4ever/buyable/templates/buyables/showItems.html index 4df3578..8f4f60f 100644 --- a/k4ever/buyable/templates/buyables/showItems.html +++ b/k4ever/buyable/templates/buyables/showItems.html @@ -1,47 +1,6 @@ {% extends "base.html" %} {% block "content" %} -
- Sortieren nach Letzte Änderung | Alphabet | Preis
- - {% for item in items %} - - - - - - - - {% comment %} - Buy it! - {% if item.hasDeposit %} - it+deposit! - only deposit! - {% endif %} -
( - {% for type in item.buyableType.all %} - {{ type }} - {% endfor %} ) - {% endcomment %} - {% endfor %} -
- - - {{ item.name }}
- Details -
- Kaufen für {{ item.price|floatformat:2 }} €
{% if item.hasDeposit %} (Ohne Pfand){% endif %}
-
- {% if item.hasDeposit %} - Kaufen für {{ item.price|floatformat:2 }} €
+ {{ item.deposit|floatformat:2 }} € Pfand
- {% else %} -   - {% endif %} -
- {% if item.hasDeposit %} - Kaufen
nur {{ item.deposit|floatformat:2 }} € Pfand
- {% else %} -   - {% endif %} -
+ Sortieren nach Letzte Änderung | Alphabet | Preis
+ {% include "buyables/product_list.html" with buyables=items %} {% endblock %} diff --git a/k4ever/main/templates/main/product_list.html b/k4ever/main/templates/main/product_list.html index 8fc65b2..2a7cd3a 100644 --- a/k4ever/main/templates/main/product_list.html +++ b/k4ever/main/templates/main/product_list.html @@ -1,31 +1,27 @@ {% if buyables %} - {% if removeWrapper == None %} - {% endif %} {% for buyable in buyables %} - {% endfor %} - {% if removeWrapper == None %}
{{ buyable.buyable__name }} ({{ buyable.num_buys }} mal gekauft) + {% if buyable.buyable__deposit > 0 %} - Kaufen (Ohne Pfand) - Kaufen (Mit Pfand) + + {% if includeDeposit %} - Kaufen (Nur Pfand) + {% endif %} {% else %} - Kaufen + {% endif %}
- {% endif %} {% else %}

{{ default|default_if_none:"Noch keine gekauft" }}

{% endif %} \ No newline at end of file diff --git a/k4ever/media/css/style.css b/k4ever/media/css/style.css index b76ddc5..2684d2d 100644 --- a/k4ever/media/css/style.css +++ b/k4ever/media/css/style.css @@ -407,6 +407,19 @@ table.showitem td.name span { font-weight: bold; } +table.showitem td.name a { + display: block; + font: 20px "Istok Web", inherit; + text-decoration: none; + color: inherit; + font-weight: bold; +} + +table.showitem tbody tr:nth-child(even) td.name, +table.showitem tbody tr:nth-child(even) td.actions { + background-color: #ececec; +} + table.showitem td, table.showitem th { vertical-align: middle; } @@ -429,11 +442,14 @@ table.showitem th[scope="row"] { a.buyButton { display: block; padding: 5px 10px; + margin: 10px 10px 15px 0; + position: relative; height: 32px; text-align: center; border-radius: 6px; float: left; - margin-right: 10px; + z-index: 2; + text-decoration: none; background-image: -webkit-gradient(linear, left top, left bottom, from(#666666), to(#111111)); background-image: -webkit-linear-gradient(top, #666666, #111111); @@ -448,6 +464,11 @@ a.buyButton { box-shadow: 0 1px 3px 0 black; } +a.buyButton.includingPrice { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} + a.buyButton:hover { background-image: -webkit-gradient(linear, left top, left bottom, from(#555555), to(#000000)); background-image: -webkit-linear-gradient(top, #555555, #000000); @@ -465,15 +486,35 @@ a.buyButton:active { box-shadow: 0 1px 3px 0 black, 0 1px 3px 0 black inset; } -a.buyButton.includingDeposit span { +a.buyButton.includingDeposit > span { background-image: url("img/payment_deposit.png"); min-width: 65px; } -a.buyButton span { +a.buyButton.onlyDeposit > span { + background-image: url("img/deposit.png"); +} + +a.buyButton > span { display: block; height: 100%; min-width: 32px; background: url("img/payment.png") no-repeat center center transparent; - text-indent: -10000px; } + +a.buyButton > span > span { + position: absolute; + bottom: -15px; + left: 0; + display: block; + width: 100%; + z-index: 1; + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; + background-color: #3398cc; + color: white; + + -moz-box-shadow: 0 1px 3px 0 black, 0 1px 1px 0 black inset; + -webkit-box-shadow: 0 1px 3px 0 black, 0 1px 1px 0 black inset; + box-shadow: 0 1px 3px 0 black, 0 1px 1px 0 black inset; +} \ No newline at end of file