-
-
-
- |
-
- Die beliebtesten Artikel
- |
-
- Deine Lieblingsartikel
- |
-
- Zuletzt hattest du:
- |
-
-
-
- Getränke
- |
-
- {% if allMostDrinks %}
-
- {% else %}
- Noch keine gekauft.
- {% endif %}
- |
-
- {% if usersMostDrinks %}
-
- {% else %}
- Noch keine gekauft.
- {% endif %}
- |
-
- {% if usersLastDrinks %}
-
- {% else %}
- Noch keine gekauft.
- {% endif %}
- |
-
-
-
- Snacks
- |
-
- {% if allMostSnacks %}
-
- {% else %}
- Noch keine gekauft.
- {% endif %}
- |
-
- {% if usersMostSnacks %}
-
- {% else %}
- Noch keine gekauft.
- {% endif %}
- |
-
- {% if usersLastSnacks %}
-
- {% else %}
- Noch keine gekauft.
- {% endif %}
- |
-
+ {% if allMostDrinks or allMostSnacks %}
+
+
+
+ |
+ Die beliebtesten Artikel |
+ Deine Lieblingsartikel
+ | Zuletzt hattest du |
+
+
+
+
+ Getränke |
+
+ {% include "main/product_list.html" with buyables=allMostDrinks %}
+ |
+
+ {% include "main/product_list.html" with buyables=usersMostDrinks %}
+ |
+
+ {% include "main/product_list.html" with buyables=usersLastDrinks %}
+ |
+
+
+ Snacks |
+
+ {% include "main/product_list.html" with buyables=allMostSnacks %}
+ |
+
+ {% include "main/product_list.html" with buyables=usersMostSnacks %}
+ |
+
+ {% include "main/product_list.html" with buyables=usersLastSnacks %}
+ |
+
+
{% else %}
{{ error }}
Es hat scheinbar noch niemand etwas gekauft. Sei der Erste!
{% endif %}
-
-
- {% comment %}
-
- {% if usersMostSnacks or usersMostDrinks %}
-
Deine Lieblingsartikel
-
-
-
- Getränke
- |
-
- Snacks
- |
-
-
-
-
- {% else %}
- {{ error }}
- Wie es aussieht, hast du noch nichts gekauft.
Das kannst du ändern!
- {% endif %}
-
-
- {% if usersLastSnacks or usersLastDrinks %}
-
Du hattest als letztes:
-
-
-
- Getränke
- |
-
- Snacks
- |
-
-
-
-
- {% else %}
- {{ error }}
- {% endif %}
-
- {% endcomment %}
{% endblock %}
diff --git a/k4ever/media/css/img/base_nav_bg.gif b/k4ever/media/css/img/base_nav_bg.gif
deleted file mode 100644
index 8acc059..0000000
Binary files a/k4ever/media/css/img/base_nav_bg.gif and /dev/null differ
diff --git a/k4ever/media/css/img/deposit.png b/k4ever/media/css/img/deposit.png
new file mode 100644
index 0000000..0497e3d
Binary files /dev/null and b/k4ever/media/css/img/deposit.png differ
diff --git a/k4ever/media/css/img/payment.png b/k4ever/media/css/img/payment.png
new file mode 100644
index 0000000..e46dff0
Binary files /dev/null and b/k4ever/media/css/img/payment.png differ
diff --git a/k4ever/media/css/img/payment_deposit.png b/k4ever/media/css/img/payment_deposit.png
new file mode 100644
index 0000000..a674b80
Binary files /dev/null and b/k4ever/media/css/img/payment_deposit.png differ
diff --git a/k4ever/media/css/style.css b/k4ever/media/css/style.css
index 18aaad9..b76ddc5 100644
--- a/k4ever/media/css/style.css
+++ b/k4ever/media/css/style.css
@@ -1,7 +1,8 @@
-/* THOSE ARE JUST TEMPORARY, I CHANGE THEM LATER INTO LOCAL RESOURCES */
+/* THOSE ARE JUST TEMPORARYLY, I CHANGE THEM LATER INTO LOCAL RESOURCES */
+/* OR DOES SHE?! */
-@import url(http://fonts.googleapis.com/css?family=Droid+Serif:regular,italic,bold,bolditalic&subset=latin);
-@import url(http://fonts.googleapis.com/css?family=Droid+Sans:regular,bold&subset=latin);
+@import url(http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,600,700);
+@import url(http://fonts.googleapis.com/css?family=Istok+Web:400,700);
/* jQuery Theme */
/* @import url(jquery-ui-1.8.10.custom.css); */
@@ -18,90 +19,98 @@ b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
- background: transparent;
- border: 0;
- margin: 0;
- padding: 0;
- vertical-align: baseline;
+ background: transparent;
+ border: 0;
+ margin: 0;
+ padding: 0;
+ vertical-align: baseline;
+}
+
+a:focus {
+ outline: none;
}
-/* added by seba because nobody else did this. */
.content {
margin: 5px;
}
-/* end of addition */
body {
- line-height: 1;
+ line-height: 1;
}
-h1, h2, h3, h4, h5, h6 {
- clear: both;
- font-weight: normal;
+h1, h2, h3, h4, h5, h6, th {
+ clear: both;
+ font-weight: bold;
+ font-family: "Istok Web", inherit;
}
ol, ul, li {
- list-style: none;
+ list-style: none;
}
blockquote {
- quotes: none;
+ quotes: none;
}
blockquote:before, blockquote:after {
- content: '';
- content: none;
+ content: '';
+ content: none;
}
del {
- text-decoration: line-through;
+ text-decoration: line-through;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
- border-collapse: collapse;
- border-spacing: 0;
+ border-collapse: collapse;
+ border-spacing: 0;
}
a img {
- border: none;
+ border: none;
}
/* GENERAL SETTINGS */
body {
- font: 11px "lucida grande", tahoma, verdana, arial, sans-serif;
-}
-
-h1, h2, h3, h4, h5, h6 {
- font-family: 'Droid Serif', Garamond, serif;
+ font: 11px "Open Sans", Tahoma, Verdana, Arial, sans-serif;
}
p { margin-bottom: 7px; }
input {
- padding: 2px 5px;
- border: 1px solid #E5E5E5;
- background: none repeat scroll 0 0 #FBFBFB;
+ padding: 2px 5px;
+ border: 1px solid #E5E5E5;
+ background: none repeat scroll 0 0 #FBFBFB;
}
input[type=text]:focus, input[type=search]:focus, input[type=password]:focus {
- background: #FAFFBD;
+ background: #FAFFBD;
}
/* HEADER */
#header {
- margin-bottom: 20px;
+ margin-bottom: 20px;
+ background: #333;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#666666), to(#111111));
+ background-image: -webkit-linear-gradient(top, #666666, #111111);
+ background-image: -moz-linear-gradient(top, #666666, #111111);
+ background-image: -ms-linear-gradient(top, #666666, #111111);
+ background-image: -o-linear-gradient(top, #666666, #111111);
+ background-image: linear-gradient(top, #666666, #111111);
+
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#666666', EndColorStr='#111111');
}
#header > div {
- padding: 5px 10px;
+ padding: 5px 10px;
}
#header .search {
- background: url("img/logo.png") 10px center no-repeat #323232;
- height: 40px;
+ background: url("img/logo.png") 10px center no-repeat transparent;
+ height: 40px;
}
#header .search input[type='search'] {
@@ -110,73 +119,100 @@ input[type=text]:focus, input[type=search]:focus, input[type=password]:focus {
}
#header .search form {
- float: right;
- line-height: 40px;
+ float: right;
+ line-height: 40px;
}
#header .base_nav {
- background: url("img/base_nav_bg.gif") repeat-x #339DD1;
- text-transform: uppercase;
- height: 50px;
- color: white;
+ background: #3398cc;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#32bbef), to(#3398cc));
+ background-image: -webkit-linear-gradient(top, #32bbef, #3398cc);
+ background-image: -moz-linear-gradient(top, #32bbef, #3398cc);
+ background-image: -ms-linear-gradient(top, #32bbef, #3398cc);
+ background-image: -o-linear-gradient(top, #32bbef, #3398cc);
+ background-image: linear-gradient(top, #32bbef, #3398cc);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#32bbef', EndColorStr='#3398cc');
+ text-transform: uppercase;
+ color: white;
+ border-bottom: 2px solid black;
+ padding-top: 10px;
+ -moz-box-shadow: 0 3px 8px 0 black inset;
+ -webkit-box-shadow: 0 3px 8px 0 black inset;
+ box-shadow: 0 3px 8px 0 black inset;
}
#header .base_nav h1 {
- color: white;
- float: left;
- margin-right: 20px;
- line-height: 50px;
+ color: white;
+ display: inline-block;
+ margin: 0 20px 0 0;
+ padding: 5px 0 0 0;
+ vertical-align: middle;
+ line-height: 1;
+ text-shadow: 0 -1px #777;
}
#header .base_nav ul {
- float: left;
+ display: inline-block;
+ vertical-align: middle;
}
#header .base_nav ul li {
- display: inline-block;
- text-transform: uppercase;
- line-height: 36px;
+ display: inline-block;
+ font-weight: bold;
+ margin-right: 10px;
}
#header .base_nav a {
- display: block;
- margin-top: 7px;
- padding: 0 10px;
- text-decoration: none;
- color: white;
+ text-align: center;
+ //background: #3398cc;
+ display: block;
+ vertical-align: middle;
+ text-decoration: none;
+ color: inherit;
+ padding: 10px 15px;
+ margin: 3px 0;
+ -webkit-border-radius: 20px;
+ -moz-border-radius: 20px;
+ border-radius: 20px;
+ -webkit-transition: background .2s;
}
#header .base_nav a:hover {
- background: white;
- color: #339DD1;
+ -webkit-transition: background .2s;
+ background: white;
+ color: #339DD1;
+ -webkit-box-shadow: 0 1px 0 0 #777 inset;
+ -moz-box-shadow: 0 1px 0 0 #777 inset;
+ box-shadow: 0 1px 0 0 #777 inset;
}
span.balance {
- float: right;
- line-height: 50px;
+ float:right;
+ padding: 10px 0;
+ margin: 3px 0;
}
/* LOGIN FORM */
form.login {
- width: 300px;
- margin: 60px auto;
- /*-moz-box-shadow: 3px 3px 6px #333;
- -webkit-box-shadow: 3px 3px 6px #333;*/
- box-shadow: 1px 1px 2px #eaeaea;
- border: 1px solid #E5E5E5;
- padding: 20px;
+ width: 300px;
+ margin: 60px auto;
+ -moz-box-shadow: 1px 1px 2px #eaeaea;
+ -webkit-box-shadow: 1px 1px 2px #eaeaea;
+ box-shadow: 1px 1px 2px #eaeaea;
+ border: 1px solid #E5E5E5;
+ padding: 20px;
}
form.login label {
- display: block;
- margin-top: 10px;
- margin-bottom: 3px;
+ display: block;
+ margin-top: 10px;
+ margin-bottom: 3px;
}
form.login input {
- font-size: 24px;
- width: 97%;
+ font-size: 24px;
+ width: 97%;
}
form.login input[type=submit] {
@@ -214,37 +250,39 @@ form.login input[type=submit]:active {
/* NOTIFICATIONS */
div.error, div.notice, div.success {
- border-top: 1px solid #DDD;
- padding: 0.6em 0.8em;
- position: fixed;
- bottom: 0;
- width: 100%;
+ border-top: 1px solid #DDD;
+ padding: 0.6em 0.8em;
+ position: fixed;
+ bottom: 0;
+ width: 100%;
}
div.error h2, div.notice h2, div.success h2 {
- font-size: 100%;
- font-weight: bold;
- margin-bottom: 10px;
+ font-size: 100%;
+ font-weight: bold;
+ margin-bottom: 10px;
}
div.error {
- background: #FBE3E4;
- color: #8A1F11;
- border-color: #FBC2C4;
+ background: #FBE3E4;
+ color: #8A1F11;
+ border-color: #FBC2C4;
}
+
div.error a { color:#8A1F11; }
div.notice {
- background: #FFF6BF;
- color: #514721;
- border-color: #FFD324;
+ background: #FFF6BF;
+ color: #514721;
+ border-color: #FFD324;
}
+
div.notice a { color:#514721; }
div.success{
- background: #E6EFC2;
- color: #264409;
- border-color: #C6D880;
+ background: #E6EFC2;
+ color: #264409;
+ border-color: #C6D880;
}
div.success a { color:#264409; }
@@ -339,56 +377,103 @@ html body div#header div.search ul.ui-autocomplete li.ui-menu-item.focus {
font-weight: bold;
}
-/* TABLE */
-/* Edited by Theri */
table.showitem {
- border:1px solid #DFDFDF;
- border-collapse: separate;
- border-spacing: 5pt;
+ border: 0 none;
+ border-collapse: collapse;
+ width: 100%;
}
-table.showitem td {
- vertical-align: middle;
+table.showitem td.productImage {
+ width: 80px;
+ text-align: center;
+}
+
+table.showitem td.productImage img {
+ max-width: 100%;
+ max-height: 64px;
}
table.showitem th {
- vertical-align: middle;
+ font-size: 20px;
text-align:center;
}
-table.details {
- border-width: 0px;
- margin-top: 25px;
+table.showitem td.name {
+ padding: 0 10px;
}
-table.details th {
- vertical-align: middle;
- text-align: center;
+table.showitem td.name span {
+ display: block;
+ font-weight: bold;
}
-table.details td {
+table.showitem td, table.showitem th {
vertical-align: middle;
- text-align: center;
}
-.content a {
- color: #3398CC;
- text-decoration: none;
+table.showitem tr td {
+ padding-bottom: 10px;
}
-
-.content a.button {
- text-align: center;
+
+table.showitem th[scope="row"] {
+ width: 20px;
+ padding: 0;
+ margin: 0;
+ -moz-transform: rotate(270deg);
+ -webkit-transform: rotate(270deg);
+ -ms-transform: rotate(270deg);
+ -o-transform: rotate(270deg);
+ transform: rotate(270deg);
+}
+
+a.buyButton {
display: block;
- margin-top: 7px;
- padding: 0 10px;
+ padding: 5px 10px;
+ height: 32px;
+ text-align: center;
+ border-radius: 6px;
+ float: left;
+ margin-right: 10px;
+
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#666666), to(#111111));
+ background-image: -webkit-linear-gradient(top, #666666, #111111);
+ background-image: -moz-linear-gradient(top, #666666, #111111);
+ background-image: -ms-linear-gradient(top, #666666, #111111);
+ background-image: -o-linear-gradient(top, #666666, #111111);
+ background-image: linear-gradient(top, #666666, #111111);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#666666', EndColorStr='#111111');
+
+ -moz-box-shadow: 0 1px 3px 0 black;
+ -webkit-box-shadow: 0 1px 3px 0 black;
+ box-shadow: 0 1px 3px 0 black;
+}
+
+a.buyButton:hover {
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#555555), to(#000000));
+ background-image: -webkit-linear-gradient(top, #555555, #000000);
+ background-image: -moz-linear-gradient(top, #555555, #000000);
+ background-image: -ms-linear-gradient(top, #555555, #000000);
+ background-image: -o-linear-gradient(top, #555555, #000000);
+ background-image: linear-gradient(top, #555555, #000000);
+
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#555555', EndColorStr='#000000');
}
-.content a:hover {
- background: #3398CC;
- color: white;
+a.buyButton:active {
+ -moz-box-shadow: 0 1px 3px 0 black, 0 1px 3px 0 black inset;
+ -webkit-box-shadow: 0 1px 3px 0 black, 0 1px 3px 0 black inset;
+ box-shadow: 0 1px 3px 0 black, 0 1px 3px 0 black inset;
}
-.content h1 {
- font: 20px "lucida grande", tahoma, verdana, arial, sans-serif;
- text-align: center;
+a.buyButton.includingDeposit span {
+ background-image: url("img/payment_deposit.png");
+ min-width: 65px;
+}
+
+a.buyButton span {
+ display: block;
+ height: 100%;
+ min-width: 32px;
+ background: url("img/payment.png") no-repeat center center transparent;
+ text-indent: -10000px;
}
diff --git a/k4ever/media/js/k4ever.js b/k4ever/media/js/k4ever.js
index 517255a..76176dc 100644
--- a/k4ever/media/js/k4ever.js
+++ b/k4ever/media/js/k4ever.js
@@ -1,24 +1,28 @@
jQuery(document).ready(function($) {
+
+ if(!$("html").hasClass("loggedIn"))
+ return;
+
var search_input = $("div.search input.autocomplete");
var selected_item = [];
var selection = false;
var lock = false;
var items = [false];
- $.getJSON('/api/store/', function(data) {
+ $.getJSON("/api2/buyable/item", function(data) {
if(data.error === undefined) {
source = [];
- $.each(data, function(key, val) {
- items[val.pk] = val;
-
+ $.each(data, function(key, item) {
+ items[item.id] = item;
+
source.push({
- value: val.pk,
- label: "" +
- "" + val.fields.name +
- "
Preis: " + val.fields.price.toFixed(2) +
+ value: item.id,
+ label: "" +
+ "" + item.name +
+ "
Preis: " + parseFloat(item.price).toFixed(2) +
" €"
});
});
@@ -58,8 +62,8 @@ jQuery(document).ready(function($) {
if(lock && event.keyCode === 39) {
selected_item.addClass("load");
- $.get("/api/store/buy/" + selection.value + "/", {
-
+ $.post("/api2/buyable/item/" + selection.value, {
+ "deposit": "1"
}, function(data, status) {
selected_item.removeClass("load");