Browse Source

added thumbnail support (kudoes to tannek)

master
seba 11 years ago
parent
commit
17e9321eed
  1. 8
      devel/README
  2. 2
      devel/TODO
  3. 4
      k4ever/buyable/templates/buyables/history.html
  4. 31
      k4ever/buyable/templates/buyables/main
  5. 6
      k4ever/buyable/templates/buyables/product_list.html
  6. 4
      k4ever/buyable/templates/buyables/showItem.html
  7. 4
      k4ever/main/templates/main/product_list.html
  8. 4
      k4ever/main/templates/main/search-form.html
  9. 8
      k4ever/main/templates/registration/loginForm.html
  10. 3
      k4ever/settings.py

8
devel/README

@ -11,6 +11,14 @@ and overengineered... But oh well, here is our attempt! @@ -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
====================

2
devel/TODO

@ -49,3 +49,5 @@ Open for discussion: @@ -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

4
k4ever/buyable/templates/buyables/history.html

@ -1,4 +1,6 @@ @@ -1,4 +1,6 @@
{% extends "base.html" %}
{% load thumbnail %}
{% block "content" %}
{% if history %}
@ -53,7 +55,7 @@ @@ -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 %}

31
k4ever/buyable/templates/buyables/main

@ -1,31 +0,0 @@ @@ -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 %}

6
k4ever/buyable/templates/buyables/product_list.html

@ -1,10 +1,12 @@ @@ -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 @@ @@ -37,4 +39,4 @@
</table>
{% else %}
<p>{{ default|default_if_none:"Noch keine gekauft" }}</p>
{% endif %}
{% endif %}

4
k4ever/buyable/templates/buyables/showItem.html

@ -1,4 +1,6 @@ @@ -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 @@ @@ -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>

4
k4ever/main/templates/main/product_list.html

@ -1,10 +1,12 @@ @@ -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">

4
k4ever/main/templates/main/search-form.html

@ -1,6 +1,6 @@ @@ -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>

8
k4ever/main/templates/registration/loginForm.html

@ -18,4 +18,10 @@ @@ -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>

3
k4ever/settings.py

@ -74,7 +74,7 @@ LOGIN_REDIRECT_URL = '/' @@ -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 = ( @@ -129,4 +129,5 @@ INSTALLED_APPS = (
'main',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
'easy_thumbnails',
)

Loading…
Cancel
Save