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!
|
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
|
Installation Process
|
||||||
====================
|
====================
|
||||||
|
|
|
@ -49,3 +49,5 @@ Open for discussion:
|
||||||
|
|
||||||
Konrad:
|
Konrad:
|
||||||
- in js verhindern, das wer durch doppelklick auf "KAUFEN" das ding 2x kauft(also 2x http request abgesetzt werden)
|
- 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" %}
|
{% extends "base.html" %}
|
||||||
|
{% load thumbnail %}
|
||||||
|
|
||||||
|
|
||||||
{% block "content" %}
|
{% block "content" %}
|
||||||
{% if history %}
|
{% if history %}
|
||||||
|
@ -53,7 +55,7 @@
|
||||||
{% for item in order.purchase_set.all %}
|
{% for item in order.purchase_set.all %}
|
||||||
<td width="80px">
|
<td width="80px">
|
||||||
{% if not item.isDeposit %}
|
{% 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 %}
|
{% else %}
|
||||||
<b>{{ item.buyable.name }} Pfand</b>
|
<b>{{ item.buyable.name }} Pfand</b>
|
||||||
{% endif %}
|
{% 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 %}
|
{% if buyables %}
|
||||||
<table class="showitem">
|
<table class="showitem">
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for buyable in buyables %}
|
{% for buyable in buyables %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="productImage">
|
<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>
|
||||||
<td class="name"><a href="/store/show/{{ buyable.id }}">{{ buyable.name }}</a></td>
|
<td class="name"><a href="/store/show/{{ buyable.id }}">{{ buyable.name }}</a></td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
{% load thumbnail %}
|
||||||
|
|
||||||
|
|
||||||
{% block "content" %}
|
{% block "content" %}
|
||||||
<p><a href="/store/">Zur Liste aller Items</a></p>
|
<p><a href="/store/">Zur Liste aller Items</a></p>
|
||||||
|
@ -10,7 +12,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" align="center">
|
<td colspan="2" align="center">
|
||||||
<div style="font-size:large">{{ item.name }}</div>
|
<div style="font-size:large">{{ item.name }}</div>
|
||||||
<img src="{{ MEDIA_URL }}{{ item.image }}">
|
<img src="{% thumbnail item.image 400x400 %}">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
|
{% load thumbnail %}
|
||||||
|
|
||||||
{% if buyables %}
|
{% if buyables %}
|
||||||
<table width=100% class="showitem">
|
<table width=100% class="showitem">
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for buyable in buyables %}
|
{% for buyable in buyables %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="productImage">
|
<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>
|
||||||
<td class="name"><span>{{ buyable.buyable__name }}</span> {% if buyable.num_buys %}({{ buyable.num_buys }} mal gekauft){% endif %}</td>
|
<td class="name"><span>{{ buyable.buyable__name }}</span> {% if buyable.num_buys %}({{ buyable.num_buys }} mal gekauft){% endif %}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<form method="post" action="/what/do/i/know">
|
<form method="get" action="#">
|
||||||
<input placeholder="Suche und kaufe..." class="autocomplete"
|
<input placeholder="Suche und kaufe..." class="autocomplete"
|
||||||
type="search" name="search_term" value="Lade Daten..."
|
type="search" name="search_term" value="Lade Daten..."
|
||||||
disabled="disabled" />
|
disabled="disabled" />
|
||||||
|
|
|
@ -19,3 +19,9 @@
|
||||||
<input type="submit" value="Anmelden" />
|
<input type="submit" value="Anmelden" />
|
||||||
<input type="hidden" name="next" value="{{ next }}" />
|
<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 = (
|
AUTHENTICATION_BACKENDS = (
|
||||||
# 'main.backend.CustomLDAPBackend',
|
# 'main.backend.CustomLDAPBackend',
|
||||||
# 'django_auth_ldap.backend.LDAPBackend',
|
'django_auth_ldap.backend.LDAPBackend',
|
||||||
'django.contrib.auth.backends.ModelBackend',
|
'django.contrib.auth.backends.ModelBackend',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -129,4 +129,5 @@ INSTALLED_APPS = (
|
||||||
'main',
|
'main',
|
||||||
# Uncomment the next line to enable the admin:
|
# Uncomment the next line to enable the admin:
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
|
'easy_thumbnails',
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue