added thumbnail support (kudoes to tannek)
This commit is contained in:
parent
b62b6543e4
commit
17e9321eed
|
@ -11,6 +11,14 @@ and overengineered... But oh well, here is our attempt!
|
|||
|
||||
Mighty Kassensystem, finally!
|
||||
|
||||
Dependencies
|
||||
============
|
||||
- python-django >= 1.3
|
||||
- python-django-auth-ldap
|
||||
- python-django-piston
|
||||
- easy-thumbnails
|
||||
https://github.com/SmileyChris/easy-thumbnails.git
|
||||
|
||||
|
||||
Installation Process
|
||||
====================
|
||||
|
|
|
@ -49,3 +49,5 @@ Open for discussion:
|
|||
|
||||
Konrad:
|
||||
- in js verhindern, das wer durch doppelklick auf "KAUFEN" das ding 2x kauft(also 2x http request abgesetzt werden)
|
||||
- BUG: Auf der HOME-seite ist das Bild direkt neben "SNACKS" nicht als link anklickbar
|
||||
- BUG: directBuy-anzeige ist z.B. auf der HOME-seite hinter den "Kauf"-Buttons
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{% extends "base.html" %}
|
||||
{% load thumbnail %}
|
||||
|
||||
|
||||
{% block "content" %}
|
||||
{% if history %}
|
||||
|
@ -53,7 +55,7 @@
|
|||
{% for item in order.purchase_set.all %}
|
||||
<td width="80px">
|
||||
{% if not item.isDeposit %}
|
||||
<img src="{{ MEDIA_URL }}{{ item.buyable.image }}" width=64 height=64>
|
||||
<img src="{% thumbnail item.buyable.image 64x64 %}" width=64 height=64>
|
||||
{% else %}
|
||||
<b>{{ item.buyable.name }} Pfand</b>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
{% if buyables %}
|
||||
{% if removeWrapper == None %}
|
||||
<table width=100%>
|
||||
<tbody>
|
||||
{% endif %}
|
||||
{% for buyable in buyables %}
|
||||
<tr>
|
||||
<td class="productImage">
|
||||
<a href="/store/show/{{ buyable.buyable__id }}"><img src="{{ MEDIA_URL }}{{ buyable.buyable__image }}" /></a>
|
||||
</td>
|
||||
<td class="name"><span>{{ buyable.buyable__name }}</span> ({{ buyable.num_buys }} mal gekauft)</td>
|
||||
<td>
|
||||
{% if buyable.buyable__deposit > 0 %}
|
||||
<a class="buyButton" href="/store/buy/{{ buyable.buyable__id }}" title="Kaufen (Ohne Pfand)"><span>Kaufen (Ohne Pfand)</span></a>
|
||||
<a class="buyButton includingDeposit" href="/store/buy/{{ buyable.buyable__id }}/with/deposit" title="Kaufen (Mit Pfand)"><span>Kaufen (Mit Pfand)</span></a>
|
||||
{% if includeDeposit %}
|
||||
<a class="buyButton onlyDeposit" href="/store/buy/{{ buyable.buyable__id }}/only/deposit" title="Kaufen (Nur Pfand)"><span>Kaufen (Nur Pfand)</span></a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<a class="buyButton" href="/store/buy/{{ buyable.buyable__id }}" title="Kaufen"><span>Kaufen</span></a>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% if removeWrapper == None %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p>{{ default|default_if_none:"Noch keine gekauft" }}</p>
|
||||
{% endif %}
|
|
@ -1,10 +1,12 @@
|
|||
{% load thumbnail %}
|
||||
|
||||
{% if buyables %}
|
||||
<table class="showitem">
|
||||
<tbody>
|
||||
{% for buyable in buyables %}
|
||||
<tr>
|
||||
<td class="productImage">
|
||||
<a href="/store/show/{{ buyable.id }}"><img src="{{ MEDIA_URL }}{{ buyable.image }}" /></a>
|
||||
<a href="/store/show/{{ buyable.id }}"><img src="{% thumbnail buyable.image 64x64 %}"/></a>
|
||||
</td>
|
||||
<td class="name"><a href="/store/show/{{ buyable.id }}">{{ buyable.name }}</a></td>
|
||||
<td class="actions">
|
||||
|
@ -37,4 +39,4 @@
|
|||
</table>
|
||||
{% else %}
|
||||
<p>{{ default|default_if_none:"Noch keine gekauft" }}</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{% extends "base.html" %}
|
||||
{% load thumbnail %}
|
||||
|
||||
|
||||
{% block "content" %}
|
||||
<p><a href="/store/">Zur Liste aller Items</a></p>
|
||||
|
@ -10,7 +12,7 @@
|
|||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<div style="font-size:large">{{ item.name }}</div>
|
||||
<img src="{{ MEDIA_URL }}{{ item.image }}">
|
||||
<img src="{% thumbnail item.image 400x400 %}">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
{% load thumbnail %}
|
||||
|
||||
{% if buyables %}
|
||||
<table width=100% class="showitem">
|
||||
<tbody>
|
||||
{% for buyable in buyables %}
|
||||
<tr>
|
||||
<td class="productImage">
|
||||
<a href="/store/show/{{ buyable.buyable__id }}"><img src="{{ MEDIA_URL }}{{ buyable.buyable__image }}" /></a>
|
||||
<a href="/store/show/{{ buyable.buyable__id }}"><img src="{% thumbnail buyable.buyable__image 64x64 %}" /></a>
|
||||
</td>
|
||||
<td class="name"><span>{{ buyable.buyable__name }}</span> {% if buyable.num_buys %}({{ buyable.num_buys }} mal gekauft){% endif %}</td>
|
||||
<td class="actions">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<form method="post" action="/what/do/i/know">
|
||||
<form method="get" action="#">
|
||||
<input placeholder="Suche und kaufe..." class="autocomplete"
|
||||
type="search" name="search_term" value="Lade Daten..."
|
||||
disabled="disabled" />
|
||||
<input type="submit" value="Suchen" />
|
||||
</form>
|
||||
</form>
|
||||
|
|
|
@ -18,4 +18,10 @@
|
|||
|
||||
<input type="submit" value="Anmelden" />
|
||||
<input type="hidden" name="next" value="{{ next }}" />
|
||||
</form>
|
||||
</form>
|
||||
|
||||
|
||||
<div class="notice">
|
||||
<h2>Das Kassensystem ist 'Aktiv' - nutzt euren Frunden-Account</h2>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ LOGIN_REDIRECT_URL = '/'
|
|||
|
||||
AUTHENTICATION_BACKENDS = (
|
||||
# 'main.backend.CustomLDAPBackend',
|
||||
# 'django_auth_ldap.backend.LDAPBackend',
|
||||
'django_auth_ldap.backend.LDAPBackend',
|
||||
'django.contrib.auth.backends.ModelBackend',
|
||||
)
|
||||
|
||||
|
@ -129,4 +129,5 @@ INSTALLED_APPS = (
|
|||
'main',
|
||||
# Uncomment the next line to enable the admin:
|
||||
'django.contrib.admin',
|
||||
'easy_thumbnails',
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue