whuppie, works (mostly), minor api probs
This commit is contained in:
parent
d6a3b21d51
commit
97ea6a6d31
10
devel/TODO
10
devel/TODO
|
@ -1,18 +1,18 @@
|
||||||
WTFs:
|
WTFs:
|
||||||
[x] Kontostand beim kaufen auch veraendern..
|
[x] Kontostand beim kaufen auch veraendern..
|
||||||
[x] Einkaufshistory basteln
|
[x] Einkaufshistory basteln
|
||||||
[ ] Beim einkaufen von Objekten ohne Deposit sollten es nicht moeglich sein diese "with Deposit" zu kaufen
|
[x] Beim einkaufen von Objekten ohne Deposit sollten es nicht moeglich sein diese "with Deposit" zu kaufen
|
||||||
|
|
||||||
Noch zu tun:
|
Noch zu tun:
|
||||||
[ ] "Home" mit inhalt fuellen
|
[x] "Home" mit inhalt fuellen
|
||||||
[ ] API
|
[x] API
|
||||||
[ ] Kassenwart-ueberweisung "ok" interface
|
[ ] Kassenwart-ueberweisung "ok" interface
|
||||||
[ ] Einstellungen (email bei ueberweisung,...?)
|
[ ] Einstellungen (email bei ueberweisung,...?)
|
||||||
[ ] Ldap anbindung fuer login
|
[x] Ldap anbindung fuer login
|
||||||
|
|
||||||
|
|
||||||
Nice-to-haf:
|
Nice-to-haf:
|
||||||
[ ] Search'n'Buy
|
[x] Search'n'Buy
|
||||||
[ ] API-Beispiele
|
[ ] API-Beispiele
|
||||||
|
|
||||||
Konrad:
|
Konrad:
|
||||||
|
|
|
@ -73,6 +73,11 @@ auth/
|
||||||
blob blob to get user from / auth user with, returns User or NULL
|
blob blob to get user from / auth user with, returns User or NULL
|
||||||
POST
|
POST
|
||||||
""" set authblob if allowed """
|
""" set authblob if allowed """
|
||||||
|
user/
|
||||||
|
GET (=get)
|
||||||
|
""" get user by authblob string - this function works only when plugin
|
||||||
|
has unique authblobs """
|
||||||
|
authblob [REQ] authblob to sear
|
||||||
|
|
||||||
config/
|
config/
|
||||||
GET (=get)
|
GET (=get)
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Buyable(models.Model):
|
||||||
buyableType = models.ManyToManyField(BuyableType)
|
buyableType = models.ManyToManyField(BuyableType)
|
||||||
|
|
||||||
def hasDeposit(self):
|
def hasDeposit(self):
|
||||||
return self.deposit > 0.0
|
return self.deposit > Decimal(0)
|
||||||
|
|
||||||
def createPurchase(self, isDeposit=False):
|
def createPurchase(self, isDeposit=False):
|
||||||
p = Purchase()
|
p = Purchase()
|
||||||
|
|
|
@ -2,12 +2,27 @@
|
||||||
|
|
||||||
{% block "content" %}
|
{% block "content" %}
|
||||||
{% if item %}
|
{% if item %}
|
||||||
You got the item {{ item }}.
|
<table border="1" frame="box" rules="cols" width="40%" cellpadding="5">
|
||||||
Buy <a href="/store/buy/{{ item.id }}/">it!</a>
|
<tr>
|
||||||
{% if item.hasDeposit %}
|
<td colspan="2"><img src="{{ MEDIA_URL }}{{ item.image }}"></td>
|
||||||
<a href="/store/buy/{{ item.id }}/with/deposit/">it+deposit!</a>
|
</tr>
|
||||||
<a href="/store/buy/{{ item.id }}/only/deposit/"> only deposit!</a>
|
<tr>
|
||||||
{% endif %}
|
<th>Zugehörig zu:</th>
|
||||||
|
<td>{% for type in item.buyableType.all %}
|
||||||
|
{{ type }}
|
||||||
|
{% endfor %}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Kauf {{ item }}:</th>
|
||||||
|
<td>Buy <a href="/store/buy/{{ item.id }}/">it!</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> </td>
|
||||||
|
<td>{% if item.hasDeposit %}
|
||||||
|
<a href="/store/buy/{{ item.id }}/with/deposit/">it+deposit!</a>
|
||||||
|
<a href="/store/buy/{{ item.id }}/only/deposit/"> only deposit!</a>
|
||||||
|
{% endif %}</td>
|
||||||
|
</tr></table>
|
||||||
{% else %}
|
{% else %}
|
||||||
No item found :(
|
No item found :(
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -2,7 +2,18 @@
|
||||||
|
|
||||||
{% block "content" %}
|
{% block "content" %}
|
||||||
{% for item in items %}
|
{% for item in items %}
|
||||||
<img src="{{ MEDIA_URL }}{{ item.image }}">{{ item }}
|
<div style="float:left; width=200; ">
|
||||||
<a href="/store/show/{{ item.id }}">{{ item.name }}</a>
|
<a href="/store/show/{{ item.id }}"><img WIDTH=64 HEIGHT=64 src="{{ MEDIA_URL }}{{ item.image }}"></a>
|
||||||
|
</br> {{ item }}
|
||||||
|
</br> Buy <a href="/store/buy/{{ item.id }}/">it!</a>
|
||||||
|
{% if item.hasDeposit %}
|
||||||
|
<a href="/store/buy/{{ item.id }}/with/deposit/">it+deposit!</a>
|
||||||
|
<a href="/store/buy/{{ item.id }}/only/deposit/"> only deposit!</a>
|
||||||
|
{% endif %}
|
||||||
|
</br> (
|
||||||
|
{% for type in item.buyableType.all %}
|
||||||
|
{{ type }}
|
||||||
|
{% endfor %} )
|
||||||
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
{% block "content" %}
|
{% block "content" %}
|
||||||
<h2>Passwort</h2>
|
<h2>Passwort</h2>
|
||||||
<hr />
|
<hr />
|
||||||
<Change Password here>
|
Da die meisten der Nutzer dieses Systems über den LDAP der Freitagsrunde laufen, kann man hier sein Passwort nicht ändern. Wenn du dein Passwort trotzdem ändern möchstest (und dieses System nicht über einen Freitagsrundenaccount benutzt), wende dich bitte an einen der Freitagsrunden-Admins. (lies: not implemented)
|
||||||
<br />
|
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<h2>Plugin Berechtigungen</h2>
|
<h2>Plugin Berechtigungen</h2>
|
||||||
|
|
|
@ -16,7 +16,7 @@ def startpage(request):
|
||||||
allMost = Purchase.objects.filter(isDeposit=False).values('buyable__name', 'buyable__id').annotate(num_buys=Count('buyable')).order_by('-num_buys')
|
allMost = Purchase.objects.filter(isDeposit=False).values('buyable__name', 'buyable__id').annotate(num_buys=Count('buyable')).order_by('-num_buys')
|
||||||
usersMost = Purchase.objects.filter(isDeposit=False).values('buyable__name','buyable__id').filter(order__user=request.user.id).annotate(num_buys=Count('buyable')).order_by('-num_buys')
|
usersMost = Purchase.objects.filter(isDeposit=False).values('buyable__name','buyable__id').filter(order__user=request.user.id).annotate(num_buys=Count('buyable')).order_by('-num_buys')
|
||||||
usersLast = Purchase.objects.filter(isDeposit=False).values('buyable__name','buyable__id').filter(order__user=request.user.id).order_by('-order__dateTime')
|
usersLast = Purchase.objects.filter(isDeposit=False).values('buyable__name','buyable__id').filter(order__user=request.user.id).order_by('-order__dateTime')
|
||||||
return render_to_response("main/startpage.html", {'allMost' : allMost,'usersMost': usersMost, 'usersLast' : usersLast}, RequestContext(request))
|
return render_to_response("main/startpage.html", {'allMost' : allMost,'usersMost': usersMost, 'usersLast' : usersLast[:12]}, RequestContext(request))
|
||||||
|
|
||||||
def register(request):
|
def register(request):
|
||||||
return render_to_response("registration/register.html", RequestContext(request))
|
return render_to_response("registration/register.html", RequestContext(request))
|
||||||
|
@ -88,6 +88,11 @@ def pluginAuthblob(request, pluginId):
|
||||||
d['pluginerror'] = "Der Authblob darf für dieses Plugin nicht vom User verändert werden (oder der Authblob war kaputt)"
|
d['pluginerror'] = "Der Authblob darf für dieses Plugin nicht vom User verändert werden (oder der Authblob war kaputt)"
|
||||||
return render_to_response("settings/settings.html", d, RequestContext(request))
|
return render_to_response("settings/settings.html", d, RequestContext(request))
|
||||||
|
|
||||||
|
if p.plugin.uniqueAuthblob and PluginPermission.objects.filter(plugin=plugin, authblob=request.POST["authblob"]).count() > 0:
|
||||||
|
d = getPluginDict(request)
|
||||||
|
d['pluginerror'] = "Achtung! Dein Authblob wird bereits von einer anderen Person benutzt. Bitte wähle einen anderen (eindeutigen) Authblob!"
|
||||||
|
return render_to_response("settings/settings.html", d, RequestContext(request))
|
||||||
|
|
||||||
p.authblob = request.POST['authblob']
|
p.authblob = request.POST['authblob']
|
||||||
p.save()
|
p.save()
|
||||||
d = getPluginDict(request)
|
d = getPluginDict(request)
|
||||||
|
|
|
@ -3,6 +3,7 @@ from models import Transaction, TransactionType
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
class TransactionAdmin(admin.ModelAdmin):
|
class TransactionAdmin(admin.ModelAdmin):
|
||||||
|
list_filter = ('checked','transactionType','amount')
|
||||||
actions = ['really_delete_selected']
|
actions = ['really_delete_selected']
|
||||||
|
|
||||||
def get_actions(self, request):
|
def get_actions(self, request):
|
||||||
|
|
Loading…
Reference in New Issue