fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
28cb104
)
Move excessive funds to WLF
author
Radek Czajka
<radek.czajka@gmail.com>
Wed, 27 Mar 2013 16:38:05 +0000
(17:38 +0100)
committer
Radek Czajka
<radek.czajka@gmail.com>
Wed, 27 Mar 2013 16:48:35 +0000
(17:48 +0100)
apps/funding/locale/pl/LC_MESSAGES/django.mo
patch
|
blob
|
history
apps/funding/locale/pl/LC_MESSAGES/django.po
patch
|
blob
|
history
apps/funding/templates/funding/wlfund.html
patch
|
blob
|
history
apps/funding/views.py
patch
|
blob
|
history
diff --git
a/apps/funding/locale/pl/LC_MESSAGES/django.mo
b/apps/funding/locale/pl/LC_MESSAGES/django.mo
index
537a35f
..
3c69a40
100644
(file)
Binary files a/apps/funding/locale/pl/LC_MESSAGES/django.mo and b/apps/funding/locale/pl/LC_MESSAGES/django.mo differ
diff --git
a/apps/funding/locale/pl/LC_MESSAGES/django.po
b/apps/funding/locale/pl/LC_MESSAGES/django.po
index
3e3e62a
..
c3f843c
100644
(file)
--- a/
apps/funding/locale/pl/LC_MESSAGES/django.po
+++ b/
apps/funding/locale/pl/LC_MESSAGES/django.po
@@
-7,8
+7,8
@@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-03-27 17:
10
+0100\n"
-"PO-Revision-Date: 2013-03-27 17:
10
+0100\n"
+"POT-Creation-Date: 2013-03-27 17:
36
+0100\n"
+"PO-Revision-Date: 2013-03-27 17:
36
+0100\n"
"Last-Translator: Radek Czajka <radek.czajka@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"Last-Translator: Radek Czajka <radek.czajka@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
@@
-198,8
+198,8
@@
msgid "Book"
msgstr "Książka"
#: templates/funding/wlfund.html:34
msgstr "Książka"
#: templates/funding/wlfund.html:34
-msgid "
Money from partial
fundraiser"
-msgstr "Pieniądze
z częściowej
zbiórki"
+msgid "
Excessive money from
fundraiser"
+msgstr "Pieniądze
pozostałe ze
zbiórki"
#: templates/funding/tags/funding.html:10
msgid "Support a book:"
#: templates/funding/tags/funding.html:10
msgid "Support a book:"
diff --git
a/apps/funding/templates/funding/wlfund.html
b/apps/funding/templates/funding/wlfund.html
index
8188f1a
..
da35943
100755
(executable)
--- a/
apps/funding/templates/funding/wlfund.html
+++ b/
apps/funding/templates/funding/wlfund.html
@@
-29,9
+29,9
@@
{% else %}
<tr class="funding-plus">
<td><div>{{ entry.end }}</div></td>
{% else %}
<tr class="funding-plus">
<td><div>{{ entry.end }}</div></td>
- <td><div>+{{ entry.
sum
}} zł</div></td>
+ <td><div>+{{ entry.
wlfund
}} zł</div></td>
<td><div>{{ entry.total }} zł</div></td>
<td><div>{{ entry.total }} zł</div></td>
- <td><div>{% trans "
Money from partial
fundraiser" %}:
+ <td><div>{% trans "
Excessive money from
fundraiser" %}:
<a href="{{ entry.get_absolute_url }}">
{{ entry }}</a></div></td>
</tr>
<a href="{{ entry.get_absolute_url }}">
{{ entry }}</a></div></td>
</tr>
diff --git
a/apps/funding/views.py
b/apps/funding/views.py
index
f543162
..
c14cee3
100644
(file)
--- a/
apps/funding/views.py
+++ b/
apps/funding/views.py
@@
-21,7
+21,7
@@
def mix(*streams):
else:
substreams.append([read_date(item), item, iterstream, read_date, tag])
while substreams:
else:
substreams.append([read_date(item), item, iterstream, read_date, tag])
while substreams:
- i, substream = max(enumerate(substreams), key=lambda x: x[0])
+ i, substream = max(enumerate(substreams), key=lambda x: x[
1][
0])
yield substream[4], substream[1]
try:
item = next(substream[2])
yield substream[4], substream[1]
try:
item = next(substream[2])
@@
-41,12
+41,21
@@
class WLFundView(TemplateView):
if tag == 'spent':
total += e.amount
else:
if tag == 'spent':
total += e.amount
else:
- total -= e.
sum()
+ total -= e.
wlfund
yield tag, e
ctx = super(WLFundView, self).get_context_data()
yield tag, e
ctx = super(WLFundView, self).get_context_data()
- offers = [o for o in Offer.objects.all() if o.state() == 'lose' and o.sum()]
- amount = sum(o.sum() for o in offers) - sum(o.amount for o in Spent.objects.all())
+ offers = []
+ for o in Offer.objects.all():
+ if o.state() == 'lose':
+ o.wlfund = o.sum()
+ if o.wlfund > 0:
+ offers.append(o)
+ elif o.state() == 'win':
+ o.wlfund = o.sum() - o.target
+ if o.wlfund > 0:
+ offers.append(o)
+ amount = sum(o.wlfund for o in offers) - sum(o.amount for o in Spent.objects.all())
print offers
ctx['amount'] = amount
print offers
ctx['amount'] = amount