diff --git a/.gitignore b/.gitignore index 1a7ece8..758068a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,6 @@ *.bak *~ k4ever/k4ever.db +k4ever/media/img/ *.kdev4 .kdev4 diff --git a/client-barcode/doc/freitagskasse.svg b/client-barcode/doc/freitagskasse.svg index 12e412b..e6d543c 100644 --- a/client-barcode/doc/freitagskasse.svg +++ b/client-barcode/doc/freitagskasse.svg @@ -16,7 +16,7 @@ inkscape:version="0.48.2 r9819" sodipodi:docname="freitagskasse.svg"> HOWTO Freitagskasse v3 + id="title3609">HOWTO Freitagskasse v3.2 image/svg+xml - HOWTO Freitagskasse v3 + HOWTO Freitagskasse v3.2 Sebastian Pipping <sebastian@pipping.org> @@ -1054,7 +1054,8 @@ id="rect3535-9" />1 Euro + id="g6092" + transform="translate(-1.09375e-6,0)"> 10 Euro + transform="translate(-3.9999988,0)"> COMMIT + transform="translate(-19.933595,0)"> UNDO + id="flowPara3537-0-75-7">STORNO 3 + transform="translate(0,161.9389)"> + id="g4416" + transform="translate(7.1428575,-17.709575)"> ... allein Nur Pfand + transform="matrix(1.25,0,0,-1.25,853.67689,1044.1709)"> @@ -2374,7 +2375,8 @@ + id="g6038" + transform="translate(-2.4999999e-6,-483.00422)"> + id="g5879" + transform="translate(0,161.9389)"> - + + + {% endif %} + {% for buyable in buyables %} + + + + + {{ 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 %} + + + {% endfor %} + {% if removeWrapper == None %} + + + {% endif %} +{% else %} +

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

+{% endif %} \ No newline at end of file diff --git a/k4ever/main/templates/main/startpage.html b/k4ever/main/templates/main/startpage.html index 38c0e11..c0c2040 100644 --- a/k4ever/main/templates/main/startpage.html +++ b/k4ever/main/templates/main/startpage.html @@ -1,238 +1,45 @@ {% extends "base.html" %} {% block "content" %} -
- {% if allMostDrinks or allMostSnacks %} - - - - - - - - - - - - - - - - - - - + {% if allMostDrinks or allMostSnacks %} +
-   - -

Die beliebtesten Artikel

-
-

Deine Lieblingsartikel

-
-

Zuletzt hattest du:

-
-

Getränke

-
- {% if allMostDrinks %} - - {% for buyable in allMostDrinks %} - - - - - - {% endfor %} -
- - - {{ buyable.buyable__name }}
({{ buyable.num_buys }} mal) -
- Kaufen - {% if buyable.buyable__deposit > 0 %} - (Ohne Pfand) Kaufen (Mit Pfand) - {% else %} - - {% endif %} - -
- {% else %} - Noch keine gekauft. - {% endif %} -
- {% if usersMostDrinks %} - - {% for buyable in usersMostDrinks %} - - - - - - {% endfor %} -
- - - {{ buyable.buyable__name }}
({{ buyable.num_buys }} mal) -
- Kaufen - {% if buyable.buyable__deposit > 0 %} - (Ohne Pfand) Kaufen (Mit Pfand) - {% else %} - - {% endif %} - -
- {% else %} - Noch keine gekauft. - {% endif %} -
- {% if usersLastDrinks %} - - {% for buyable in usersLastDrinks %} - - - - - - {% endfor %} -
- - - {{ buyable.buyable__name }} - - Kaufen - {% if buyable.buyable__deposit > 0 %} - (Ohne Pfand) Kaufen (Mit Pfand) - {% else %} - - {% endif %} - -
- {% else %} - Noch keine gekauft. - {% endif %} -
-

Snacks

-
- {% if allMostSnacks %} - - {% for buyable in allMostSnacks %} - - - - - - {% endfor %} -
- - - {{ buyable.buyable__name }}
({{ buyable.num_buys }} mal) -
- Kaufen - {% if buyable.buyable__deposit > 0 %} - (Ohne Pfand) Kaufen (Mit Pfand) - {% else %} - - {% endif %} -
- {% else %} - Noch keine gekauft. - {% endif %} -
- {% if usersMostSnacks %} - - {% for buyable in usersMostSnacks %} - - - - - - {% endfor %} -
- - - {{ buyable.buyable__name }}
({{ buyable.num_buys }} mal) -
- Kaufen - {% if buyable.buyable__deposit > 0 %} - (Ohne Pfand) Kaufen (Mit Pfand) - {% else %} - - {% endif %} -
- {% else %} - Noch keine gekauft. - {% endif %} -
- {% if usersLastSnacks %} - - {% for buyable in usersLastSnacks %} - - - - - - {% endfor %} -
- - - {{ buyable.buyable__name }} - - Kaufen - {% if buyable.buyable__deposit > 0 %} - (Ohne Pfand) Kaufen (Mit Pfand) - {% else %} - - {% endif %} -
- {% else %} - Noch keine gekauft. - {% endif %} -
+ + + + + + + + + + + + + + + + + + + + +
 Die beliebtesten ArtikelDeine 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 + "" + - "" + val.fields.name + - "
Preis: " + val.fields.price.toFixed(2) + + value: item.id, + label: "" +
+						item.name + "" + + "" + 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");