From 7e608ae6afaeaf125eda870b8d3c1439a178002f Mon Sep 17 00:00:00 2001 From: tkroenert Date: Fri, 28 Oct 2011 21:51:28 +0200 Subject: [PATCH] virtualtransaction: add listingz --- k4ever/media/css/img/cashIn.png | Bin 0 -> 806 bytes k4ever/media/css/img/cashOut.png | Bin 0 -> 802 bytes k4ever/media/css/style.css | 6 +++ k4ever/media/css/style.less | 10 +++- .../templates/transaction/overview.html | 47 ++++++++++++++++++ k4ever/transaction/views.py | 5 +- 6 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 k4ever/media/css/img/cashIn.png create mode 100644 k4ever/media/css/img/cashOut.png diff --git a/k4ever/media/css/img/cashIn.png b/k4ever/media/css/img/cashIn.png new file mode 100644 index 0000000000000000000000000000000000000000..09c5198ab28616d3d39ee2adc9b0af75eb1f6b32 GIT binary patch literal 806 zcmV+>1KIqEP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipo9 z5*r4)rLTJc00O2-L_t(Y$F-KvOH@%5$3N%3H>M70qfuE(KeR%~O&}2{7(@$Ow2Elg zqG-UNRST`Q3I%N=GtTf8^Vc{bTI@WA6; z?tAxq&-a|~J@<;%n!Pl|9^0M+NPDyuCrKI*XVUxXzBOnxPaBuLg%3VgAp%-!1aVdi z_%p6C5vV^?N2ttnr?l%^XpWBhejhCwckHki>wh5H)3cG zn1<=`?}FRB2!`5WtCZ^?;yp(pAXBbRy{heE&4(LoMVoD1$GF zq>nvPiow2+F9OGcF*w=M;4m&!LOYe5N+dDSP7Oqa?RzdLgQ@WuuWllEV~2sjrOO>u zhQnK$^hVDE0bIS->8Y<+>O+Guhr!ZPn&kXfL=?&plo*J>@qi2#(hDf15G^2%#5dP7 zh`0=_1&afR_fvQ17^Y!*k`3CWYO42SuAc zlg(f%6Km0OY7p-qqb=G>WmyI3l{EIMO*XrU5=BEmfRt?^N?{rXrV+w4L)i8*@%}M~ zfe5VFYpiXoQd?b%5_5M9ltPK3ysUzJKF^B1OfH+ju; zftx)>YGfw~?`XZb$a&yRiPjVcZuA(b*&P)YN}!TPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipo9 z5*iIPY)7&H00N>(L_t(Y$F-HqYZFlvhrc_Sgrs@UOq)WbYSiK`t{OyWsMw7~eEb3G zvZUaq1x0Y-LJNY>ZWI(w?fwrAVQhE<{ajseK62CnTwP%yE&KG>O_y3Oz6| z+)QlTN=;P5{gy!wozG`T+r60YlozM&>|(gAz)E;dbCH zkf_`G4BT{$Zq6PWpfnin1;&8Le^QFTF!0DVx>?#6Ad!qC2%t#$(h9f-JO*?JR!;-B zdUBof)r%iq%%A~uC%f=AdFi`;nUpWx42%O$92N(-0L-R*>HbT77twVW%A&5>Lc&Iv z`xDP&z$f4ujYkN0`Ec^}yZ7!dhCMu*y*su(bpx0J&N?hu0yh8g^a2wp-+T<)0;S-= z`P<_jucz7L_K@ApVv5P|$2a@UunPzS+&OnufkwoLu=Z<(pr@Ic=^4Q4flJp3go0?A z#%?}`DJEi?4f$hAk@f9$n!J7jp(gC(r6&gBghD||#Uh&0@cRO&gO5i|oM?|$hH@vf zO*Wq+7z&UWh?f-@Ee1uih+B7qbyTI{9xIdrzt2xDo55%?sPw>SH7FDcY!$XZK$KuM zVA100cSOLH5@tydF)>;VmKK)KMWC%MQpH$oK8^vR$4>uscC(obC{W$W_};Ptk-hgx zZ`zSlJ-N;rHcEkrpipItqOlIEsFf$>Uk2&4BL$~o$E)<03+I0qSpD|146r!2T&^v) z3hTw^%%X+49~SF91$O8PI2r4xcy2QQX+S}TWwJ#~L4Ma#Ak_-$!|PPRa#atdGO`r~ z(Taz4v(!Kjq;C2O`64S{*HGQbu9|yCRZWs0D5VgAr)PF5Id|uS1PH_5c6? literal 0 HcmV?d00001 diff --git a/k4ever/media/css/style.css b/k4ever/media/css/style.css index e7a4241..5fcf6f6 100644 --- a/k4ever/media/css/style.css +++ b/k4ever/media/css/style.css @@ -611,6 +611,12 @@ table.itemListContainer > tbody > tr:first-child ~ tr > td { .icon.transfer { background-image: url("img/transfer.png"); } +.icon.cashIn { + background-image: url("img/cashIn.png"); +} +.icon.cashOut { + background-image: url("img/cashOut.png"); +} .transaction { padding: 0 30px; } diff --git a/k4ever/media/css/style.less b/k4ever/media/css/style.less index 0fa0ecb..4122c88 100644 --- a/k4ever/media/css/style.less +++ b/k4ever/media/css/style.less @@ -630,6 +630,14 @@ table.itemListContainer { &.transfer { background-image: url("@{fldImages}/transfer.png"); } + + &.cashIn { + background-image: url("@{fldImages}/cashIn.png"); + } + + &.cashOut { + background-image: url("@{fldImages}/cashOut.png"); + } } .transaction { @@ -680,4 +688,4 @@ table.itemListContainer { background: #E6EFC2; color: #264409; border-color: #C6D880; -} \ No newline at end of file +} diff --git a/k4ever/transaction/templates/transaction/overview.html b/k4ever/transaction/templates/transaction/overview.html index c1f40dd..f202645 100644 --- a/k4ever/transaction/templates/transaction/overview.html +++ b/k4ever/transaction/templates/transaction/overview.html @@ -87,4 +87,51 @@ + +

Vergangene virtuelle Transaktionen

+ + + + + + + + + + + + + + + {% for transaction in vhistory %} + + + + + + + + + + {% endfor %} + + + + + + + + + + + + + +
DatumUhrzeitBetragSenderTypRecipientComment
{{ transaction.dateTime|date:"j. F Y" }}{{ transaction.dateTime|date:"H:i" }} Uhr{{ transaction.amount|floatformat:2 }}€{{ transaction.user }}{{ transaction.recipient }}{{ transaction.comment }}
DatumUhrzeitBetragSenderTypRecipientComment
{% endblock %} diff --git a/k4ever/transaction/views.py b/k4ever/transaction/views.py index 3c801db..07c300d 100644 --- a/k4ever/transaction/views.py +++ b/k4ever/transaction/views.py @@ -1,6 +1,7 @@ from django.shortcuts import render_to_response from django.template import RequestContext from django.contrib.auth.decorators import login_required +from django.db.models import Q from django.http import HttpResponseRedirect from models import Transaction, TransactionType, VirtualTransaction from forms import TransactionForm, VirtualTransactionForm @@ -11,7 +12,7 @@ def overview(request): """ Creates an overview over the users transactions, also handles adding and transfering money. """ # create history history = Transaction.objects.filter(user=request.user).order_by("-dateTime") - + vhistory = VirtualTransaction.objects.filter(Q(user=request.user) | Q(recipient=request.user)).order_by("-dateTime") # create forms form = TransactionForm() vform = VirtualTransactionForm() @@ -39,5 +40,5 @@ def overview(request): vtransacted = True else: error = True - return render_to_response("transaction/overview.html", {'history': history, 'form': form, 'transacted': transacted, 'error': error, 'vform': vform, 'vtransacted': vtransacted, 'verror': verror}, RequestContext(request)) + return render_to_response("transaction/overview.html", {'history': history, 'vhistory': vhistory, 'form': form, 'transacted': transacted, 'error': error, 'vform': vform, 'vtransacted': vtransacted, 'verror': verror}, RequestContext(request))