fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ff91c0e
)
Set minimum funding amount.
author
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 26 Jun 2013 13:29:50 +0000
(15:29 +0200)
committer
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 26 Jun 2013 13:29:50 +0000
(15:29 +0200)
apps/funding/forms.py
patch
|
blob
|
history
apps/funding/locale/pl/LC_MESSAGES/django.mo
patch
|
blob
|
history
apps/funding/locale/pl/LC_MESSAGES/django.po
patch
|
blob
|
history
wolnelektury/settings/custom.py
patch
|
blob
|
history
diff --git
a/apps/funding/forms.py
b/apps/funding/forms.py
index
3bd7f1d
..
dc0e623
100644
(file)
--- a/
apps/funding/forms.py
+++ b/
apps/funding/forms.py
@@
-1,5
+1,7
@@
+from django.conf import settings
from django import forms
from django import forms
-from django.utils.translation import ugettext_lazy as _, ugettext as __, get_language
+from django.utils import formats
+from django.utils.translation import ugettext_lazy as _, ugettext, get_language
from .models import Funding
from .widgets import PerksAmountWidget
from .models import Funding
from .widgets import PerksAmountWidget
@@
-21,13
+23,18
@@
class FundingForm(forms.Form):
self.fields['amount'].widget.form_instance = self
def clean_amount(self):
self.fields['amount'].widget.form_instance = self
def clean_amount(self):
- if self.cleaned_data['amount'] <= 0:
- raise forms.ValidationError(__("Enter positive amount."))
+ if self.cleaned_data['amount'] < settings.FUNDING_MIN_AMOUNT:
+ min_amount = settings.FUNDING_MIN_AMOUNT
+ if isinstance(settings.FUNDING_MIN_AMOUNT, float):
+ min_amount = formats.number_format(settings.FUNDING_MIN_AMOUNT, 2)
+ raise forms.ValidationError(
+ ugettext("The minimum amount is %(amount)s PLN.") % {
+ 'amount': min_amount})
return self.cleaned_data['amount']
def clean(self):
if not self.offer.is_current():
return self.cleaned_data['amount']
def clean(self):
if not self.offer.is_current():
- raise forms.ValidationError(
__
("This offer is out of date."))
+ raise forms.ValidationError(
ugettext
("This offer is out of date."))
return self.cleaned_data
def save(self):
return self.cleaned_data
def save(self):
diff --git
a/apps/funding/locale/pl/LC_MESSAGES/django.mo
b/apps/funding/locale/pl/LC_MESSAGES/django.mo
index
e2cc757
..
2027e14
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
0543b8a
..
6c35c86
100644
(file)
--- a/
apps/funding/locale/pl/LC_MESSAGES/django.po
+++ b/
apps/funding/locale/pl/LC_MESSAGES/django.po
@@
-7,34
+7,34
@@
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-06-2
5 11:55
+0200\n"
-"PO-Revision-Date: 2013-0
4-25 13:03
+0100\n"
+"POT-Creation-Date: 2013-06-2
6 15:26
+0200\n"
+"PO-Revision-Date: 2013-0
6-26 15:26
+0100\n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
-"|| n%100>=20) ? 1 : 2)\n"
+"|| n%100>=20) ? 1 : 2);\n"
+"X-Generator: Poedit 1.5.4\n"
-#: forms.py:1
0 templates/funding/wlfund.html:28
+#: forms.py:1
2 templates/funding/wlfund.html:27
msgid "Amount"
msgstr "Kwota"
msgid "Amount"
msgstr "Kwota"
-#: forms.py:1
2
+#: forms.py:1
4
msgid "Name"
msgstr "Imię i nazwisko na listę darczyńców"
msgid "Name"
msgstr "Imię i nazwisko na listę darczyńców"
-#: forms.py:1
3
+#: forms.py:1
5
msgid "Optional name for public list of contributors"
msgstr "Opcjonalnie imię i nazwisko lub pseudonim do listy darczyńców."
msgid "Optional name for public list of contributors"
msgstr "Opcjonalnie imię i nazwisko lub pseudonim do listy darczyńców."
-#: forms.py:1
4
+#: forms.py:1
6
msgid "Contact e-mail"
msgstr "E-mail kontaktowy"
msgid "Contact e-mail"
msgstr "E-mail kontaktowy"
-#: forms.py:1
5
+#: forms.py:1
7
msgid ""
"We'll use it to contact you about your perks and fundraiser status and "
"payment updates.<br/> Won't be publicised."
msgid ""
"We'll use it to contact you about your perks and fundraiser status and "
"payment updates.<br/> Won't be publicised."
@@
-42,6
+42,15
@@
msgstr ""
"Użyjemy go do kontaktu w sprawie prezentów i informacji o zmianach statusu "
"zbiórki i kolejnych akcjach.<br/>Nie będzie publikowany."
"Użyjemy go do kontaktu w sprawie prezentów i informacji o zmianach statusu "
"zbiórki i kolejnych akcjach.<br/>Nie będzie publikowany."
+#: forms.py:28
+#, python-format
+msgid "The minimum amount is %(amount)s PLN."
+msgstr "Minimalna kwota wpłaty to %(amount)s zł."
+
+#: forms.py:34
+msgid "This offer is out of date."
+msgstr "Ta zbiórka jest już nieaktywna."
+
#: models.py:19
msgid "author"
msgstr "autor"
#: models.py:19
msgid "author"
msgstr "autor"
@@
-54,7
+63,7
@@
msgstr "tytuł"
msgid "slug"
msgstr "slug"
msgid "slug"
msgstr "slug"
-#: models.py:22
models.py:117
+#: models.py:22
msgid "description"
msgstr "opis"
msgid "description"
msgstr "opis"
@@
-114,6
+123,10
@@
msgstr "cena"
msgid "name"
msgstr "nazwa"
msgid "name"
msgstr "nazwa"
+#: models.py:117
+msgid "long name"
+msgstr "długa nazwa"
+
#: models.py:118
msgid "end date"
msgstr "data końcowa"
#: models.py:118
msgid "end date"
msgstr "data końcowa"
@@
-130,7
+143,7
@@
msgstr "prezenty"
msgid "email"
msgstr "e-mail"
msgid "email"
msgstr "e-mail"
-#: models.py:138 models.py:16
7
+#: models.py:138 models.py:16
8
msgid "amount"
msgstr "kwota"
msgid "amount"
msgstr "kwota"
@@
-138,27
+151,27
@@
msgstr "kwota"
msgid "payed at"
msgstr "data wpłaty"
msgid "payed at"
msgstr "data wpłaty"
-#: models.py:15
0
+#: models.py:15
1
msgid "funding"
msgstr "wpłata"
msgid "funding"
msgstr "wpłata"
-#: models.py:15
1
+#: models.py:15
2
msgid "fundings"
msgstr "wpłaty"
msgid "fundings"
msgstr "wpłaty"
-#: models.py:16
8
+#: models.py:16
9
msgid "when"
msgstr "kiedy"
msgid "when"
msgstr "kiedy"
-#: models.py:17
1
+#: models.py:17
2
msgid "money spent on a book"
msgstr "pieniądze wydane na książkę"
msgid "money spent on a book"
msgstr "pieniądze wydane na książkę"
-#: models.py:17
2
+#: models.py:17
3
msgid "money spent on books"
msgstr "pieniądze wydane na książki"
msgid "money spent on books"
msgstr "pieniądze wydane na książki"
-#: models.py:20
2
templates/funding/thanks.html:6
+#: models.py:20
3
templates/funding/thanks.html:6
#: templates/funding/thanks.html.py:13
msgid "Thank you for your support!"
msgstr "Dziękujemy za Twoje wsparcie!"
#: templates/funding/thanks.html.py:13
msgid "Thank you for your support!"
msgstr "Dziękujemy za Twoje wsparcie!"
@@
-324,23
+337,23
@@
msgstr ""
msgid "Spending these remaining funds is recorded in this table."
msgstr "W poniższej tabeli rejetrujemy wydatkowanie tych środków."
msgid "Spending these remaining funds is recorded in this table."
msgstr "W poniższej tabeli rejetrujemy wydatkowanie tych środków."
-#: templates/funding/wlfund.html:2
6
+#: templates/funding/wlfund.html:2
5
msgid "Date"
msgstr "Data"
msgid "Date"
msgstr "Data"
-#: templates/funding/wlfund.html:2
7
+#: templates/funding/wlfund.html:2
6
msgid "Operation"
msgstr "Rozdysponowanie środków"
msgid "Operation"
msgstr "Rozdysponowanie środków"
-#: templates/funding/wlfund.html:2
9
+#: templates/funding/wlfund.html:2
8
msgid "Balance"
msgstr "Bilans"
msgid "Balance"
msgstr "Bilans"
-#: templates/funding/wlfund.html:3
6
+#: templates/funding/wlfund.html:3
5
msgid "Money spent on publishing the book"
msgstr "Pieniądze przeznaczone na opublikowanie książki"
msgid "Money spent on publishing the book"
msgstr "Pieniądze przeznaczone na opublikowanie książki"
-#: templates/funding/wlfund.html:4
5
+#: templates/funding/wlfund.html:4
4
msgid "Money remaining from the fundraiser for"
msgstr "Pieniądze pozostałe ze zbiórki na"
msgid "Money remaining from the fundraiser for"
msgstr "Pieniądze pozostałe ze zbiórki na"
diff --git
a/wolnelektury/settings/custom.py
b/wolnelektury/settings/custom.py
index
8e2489d
..
6cd036a
100644
(file)
--- a/
wolnelektury/settings/custom.py
+++ b/
wolnelektury/settings/custom.py
@@
-18,3
+18,4
@@
CATALOGUE_CUSTOMPDF_RATE_LIMIT = '1/m'
LIBRARIAN_PDF_MOREFLOATS = None
FUNDING_DEFAULT = 20
LIBRARIAN_PDF_MOREFLOATS = None
FUNDING_DEFAULT = 20
+FUNDING_MIN_AMOUNT = 1