From: Radek Czajka Date: Mon, 15 Jul 2013 08:39:39 +0000 (+0200) Subject: Remove funding.offer.due. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/b412f294aa668eab3295a058f6c66845ef23ada7?ds=sidebyside Remove funding.offer.due. --- diff --git a/apps/funding/admin.py b/apps/funding/admin.py index 66cff10f7..59c3ac6e3 100644 --- a/apps/funding/admin.py +++ b/apps/funding/admin.py @@ -4,7 +4,7 @@ from .models import Offer, Perk, Funding, Spent class OfferAdmin(admin.ModelAdmin): model = Offer - list_display = ['title', 'author', 'target', 'sum', 'is_win', 'start', 'end', 'due'] + list_display = ['title', 'author', 'target', 'sum', 'is_win', 'start', 'end'] search_fields = ['title', 'author'] readonly_fields = ('cover_img_tag',) diff --git a/apps/funding/locale/pl/LC_MESSAGES/django.mo b/apps/funding/locale/pl/LC_MESSAGES/django.mo index 15638ce3e..314fc6297 100644 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 07a2ced27..a099dc3ba 100644 --- 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" -"POT-Creation-Date: 2013-07-12 17:00+0200\n" -"PO-Revision-Date: 2013-07-12 17:01+0100\n" +"POT-Creation-Date: 2013-07-15 10:35+0200\n" +"PO-Revision-Date: 2013-07-15 10:37+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" @@ -83,114 +83,106 @@ msgid "end" msgstr "koniec" #: models.py:29 -msgid "due" -msgstr "data publikacji" - -#: models.py:30 -msgid "When will it be published if the money is raised." -msgstr "Kiedy książka zostanie opublikowana, jeśli uda się zebrać pieniądze." - -#: models.py:31 msgid "redakcja URL" msgstr "URL na Redakcji" -#: models.py:33 +#: models.py:31 msgid "Published book." msgstr "Opublikowana książka." -#: models.py:34 +#: models.py:32 msgid "Cover" msgstr "Okładka" -#: models.py:35 +#: models.py:33 msgid "Poll" msgstr "Ankieta" -#: models.py:39 +#: models.py:37 msgid "Cover preview" msgstr "Podgląd okładki" -#: models.py:43 models.py:168 models.py:189 +#: models.py:41 models.py:166 models.py:187 msgid "offer" msgstr "zbiórka" -#: models.py:44 +#: models.py:42 msgid "offers" msgstr "zbiórki" -#: models.py:128 +#: models.py:126 msgid "The fundraiser has ended!" msgstr "Zbiórka dobiegła końca!" -#: models.py:141 +#: models.py:139 msgid "The fundraiser will end soon!" msgstr "Zbiórka niedługo się zakończy!" -#: models.py:153 +#: models.py:151 msgid "The book you helped fund has been published." msgstr "Książka, którą pomogłeś/-aś ufundować, została opublikowana." -#: models.py:169 +#: models.py:167 msgid "price" msgstr "cena" -#: models.py:170 models.py:190 +#: models.py:168 models.py:188 msgid "name" msgstr "nazwa" -#: models.py:171 +#: models.py:169 msgid "long name" msgstr "długa nazwa" -#: models.py:172 +#: models.py:170 msgid "end date" msgstr "data końcowa" -#: models.py:175 +#: models.py:173 msgid "perk" msgstr "prezent" -#: models.py:176 models.py:194 +#: models.py:174 models.py:192 msgid "perks" msgstr "prezenty" -#: models.py:191 +#: models.py:189 msgid "email" msgstr "e-mail" -#: models.py:192 models.py:268 +#: models.py:190 models.py:266 msgid "amount" msgstr "kwota" -#: models.py:193 +#: models.py:191 msgid "payed at" msgstr "data wpłaty" -#: models.py:196 +#: models.py:194 msgid "notifications" msgstr "powiadomienia" -#: models.py:200 +#: models.py:198 msgid "funding" msgstr "wpłata" -#: models.py:201 +#: models.py:199 msgid "fundings" msgstr "wpłaty" -#: models.py:269 +#: models.py:267 msgid "when" msgstr "kiedy" -#: models.py:272 +#: models.py:270 msgid "money spent on a book" msgstr "pieniądze wydane na książkę" -#: models.py:273 +#: models.py:271 msgid "money spent on books" msgstr "pieniądze wydane na książki" -#: models.py:299 templates/funding/thanks.html:6 +#: models.py:297 templates/funding/thanks.html:6 #: templates/funding/thanks.html.py:13 msgid "Thank you for your support!" msgstr "Dziękujemy za Twoje wsparcie!" @@ -239,7 +231,7 @@ msgstr "" msgid "Help free the book!" msgstr "Pomóż uwolnić książkę!" -#: templates/funding/offer_detail.html:36 templates/funding/thanks.html:29 +#: templates/funding/offer_detail.html:36 templates/funding/thanks.html:33 #: templates/funding/wlfund.html:17 templates/funding/tags/funding.html:12 msgid "Learn more" msgstr "Dowiedz się więcej" @@ -252,7 +244,7 @@ msgstr "Wesprzyj publikację" msgid "Donate!" msgstr "Wpłać!" -#: templates/funding/offer_detail.html:58 templates/funding/thanks.html:35 +#: templates/funding/offer_detail.html:58 templates/funding/thanks.html:39 msgid "Tell your friends!" msgstr "Powiedz swoim znajomym!" @@ -288,38 +280,44 @@ msgstr "Poprzednie zbiórki:" msgid "Thank you!" msgstr "Dziękujemy!" -#: templates/funding/thanks.html:16 -#: templates/funding/tags/offer_status.html:22 +#: templates/funding/thanks.html:14 +msgid "We will contact you if you qualify for perks." +msgstr "Skontaktujemy się z Tobą w sprawie prezentów, które wybrałeś/-aś." + +#: templates/funding/thanks.html:17 +#: templates/funding/tags/offer_status.html:24 msgid "Full amount was successfully raised!" msgstr "Udało się zebrać pełną kwotę!" -#: templates/funding/thanks.html:18 templates/funding/tags/offer_status.html:6 +#: templates/funding/thanks.html:19 #, python-format msgid "" -"The fundraiser\n" -" ends on %(end)s. The book will be published by %(due)s." -msgstr "Zbiórka kończy się %(end)s. Książka zostanie opublikowana do %(due)s." +"Your donation will be spent on digitizing, compiling and\n" +" publishing the book %(b)s in multiple formats." +msgstr "" +"Wpłacone przez Ciebie pieniądze przeznaczymy na digitalizację, opracowanie i " +"udostępnienie książki %(b)s w bibliotece w wielu formatach." -#: templates/funding/thanks.html:22 +#: templates/funding/thanks.html:24 #, python-format msgid "" -"Your donation will be spent on digitizing, compiling and\n" -" publishing the book %(b)s in multiple formats. We will contact you " -"if you qualify for perks." +"If the full amount needed is raised,\n" +" your donation will be spent on digitizing, compiling and\n" +" publishing the book %(b)s in multiple formats." msgstr "" -"Pieniądze przez Ciebie wpłacone przeznaczymy na digitalizację, opracowanie " -"i udostępnienie książki %(b)s w serwisie w wielu formatach. Jeśli wybrałeś/-" -"aś nagrody, skontaktujemy się z Tobą mailowo." +"Jeśli uda się zebrać pełną kwotę, wpłacone przez Ciebie pieniądze " +"przeznaczymy na digitalizację, opracowanie i udostępnienie książki %(b)s w " +"bibliotece w wielu formatach." -#: templates/funding/thanks.html:32 +#: templates/funding/thanks.html:36 msgid "Go back to the current fundraiser." msgstr "Wróć do aktualnej zbiórki." -#: templates/funding/thanks.html:36 +#: templates/funding/thanks.html:40 msgid "I support Wolne Lektury." msgstr "Wspieram Wolne Lektury" -#: templates/funding/thanks.html:39 +#: templates/funding/thanks.html:43 msgid "Vote for a book for the next fundraiser" msgstr "Pomóż wybrać następną książkę, na którą będziemy zbierać pieniądze" @@ -501,13 +499,16 @@ msgstr "" "Twoje imię i nazwisko lub pseudonim zostaną dodane do listy darczyńców przy " "opublikowanej książce." -#: templates/funding/email/thanks.txt:14 +#: templates/funding/email/thanks.txt:10 +msgid "We will contact you about details needed for your perks." +msgstr "Skontaktujemy się z Tobą w sprawie prezentów, które wybrałeś/-aś." + +#: templates/funding/email/thanks.txt:12 msgid "" -"We will contact you to keep you informed about\n" -"status changes to this fundraiser and the upcoming ones that we plan\n" -"to launch." +"We will keep you informed about status changes to this fundraiser\n" +"and the upcoming ones that we plan to launch." msgstr "" -"Będziemy Cię informować o zmienach statusu tej zbiórki\n" +"Będziemy Cię informować o zmianach statusu tej zbiórki\n" "i o kolejnych, które planujemy rozpocząć." #: templates/funding/snippets/any_remaining.html:4 @@ -543,7 +544,18 @@ msgstr "potrzebujemy" msgid "until fundraiser end" msgstr "do końca zbiórki" -#: templates/funding/tags/offer_status.html:11 +#: templates/funding/tags/offer_status.html:6 +#, python-format +msgid "" +"The fundraiser\n" +" ends on %(end)s. The full amount has been successfully\n" +" raised, but you can still contribute and help liberate\n" +" more books." +msgstr "" +"Zbiórka kończy się %(end)s. Pełna kwota została już zebrana,\n" +" ale ciągle możesz dołożyć się i pomóc uwolnić więcej książek." + +#: templates/funding/tags/offer_status.html:13 #, python-format msgid "" "W need %(target)s zł to digitize it,\n" @@ -552,7 +564,7 @@ msgstr "" "Potrzebujemy %(target)s zł, by ją zdigitalizować, opracować i bezpłatnie " "udostępnić w serwisie w wielu formatach." -#: templates/funding/tags/offer_status.html:15 +#: templates/funding/tags/offer_status.html:17 #, python-format msgid "" "If we raise enought money before %(end)s we will\n" @@ -561,7 +573,7 @@ msgstr "" "Jeśli do %(end)s uda się zebrać pełną kwotę, opublikujemy ją i będzie " "dostępna dla wszystkich." -#: templates/funding/tags/offer_status.html:26 +#: templates/funding/tags/offer_status.html:28 msgid "The amount needed was not raised." msgstr "Nie udało się zebrać pełnej kwoty." @@ -578,14 +590,7 @@ msgstr "" "Książka\n" " %(bt)s została opublikowana." -#: templates/funding/tags/offer_status_more.html:15 -#, python-format -msgid "" -"The book\n" -" will be published by %(due)s." -msgstr "Książka zostanie opublikowana do %(due)s." - -#: templates/funding/tags/offer_status_more.html:18 +#: templates/funding/tags/offer_status_more.html:16 #, python-format msgid "" "You can follow\n" @@ -595,3 +600,21 @@ msgstr "Możesz śledzić prace na Platformie Redakcyjnej. #: templates/funding/widgets/amount.html:13 msgid "Other amount" msgstr "Inna kwota" + +#~ msgid "due" +#~ msgstr "data publikacji" + +#~ msgid "When will it be published if the money is raised." +#~ msgstr "" +#~ "Kiedy książka zostanie opublikowana, jeśli uda się zebrać pieniądze." + +#~ msgid "" +#~ "The fundraiser\n" +#~ " ends on %(end)s. The book will be published by %(due)s." +#~ msgstr "" +#~ "Zbiórka kończy się %(end)s. Książka zostanie opublikowana do %(due)s." + +#~ msgid "" +#~ "The book\n" +#~ " will be published by %(due)s." +#~ msgstr "Książka zostanie opublikowana do %(due)s." diff --git a/apps/funding/migrations/0016_auto__del_field_offer_due.py b/apps/funding/migrations/0016_auto__del_field_offer_due.py new file mode 100644 index 000000000..13351005f --- /dev/null +++ b/apps/funding/migrations/0016_auto__del_field_offer_due.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Deleting field 'Offer.due' + db.delete_column(u'funding_offer', 'due') + + + def backwards(self, orm): + + # User chose to not deal with backwards NULL issues for 'Offer.due' + raise RuntimeError("Cannot reverse this migration. 'Offer.due' and its values cannot be restored.") + + models = { + 'catalogue.book': { + 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, + '_related_info': ('jsonfield.fields.JSONField', [], {'null': 'True', 'blank': 'True'}), + 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), + 'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120'}), + 'cover': ('catalogue.fields.EbookField', [], {'max_length': '100', 'null': 'True', 'format_name': "'cover'", 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'epub_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'epub'", 'blank': 'True'}), + 'extra_info': ('jsonfield.fields.JSONField', [], {'default': "'{}'"}), + 'fb2_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'fb2'", 'blank': 'True'}), + 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'html_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'html'", 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), + 'mobi_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'mobi'", 'blank': 'True'}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), + 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'pdf_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'pdf'", 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120'}), + 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'txt_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'txt'", 'blank': 'True'}), + 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'xml_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'xml'", 'blank': 'True'}) + }, + u'funding.funding': { + 'Meta': {'ordering': "['-payed_at']", 'object_name': 'Funding'}, + 'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}), + 'email': ('django.db.models.fields.EmailField', [], {'db_index': 'True', 'max_length': '75', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language_code': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '127', 'blank': 'True'}), + 'notifications': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), + 'notify_key': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'offer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['funding.Offer']"}), + 'payed_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'perks': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['funding.Perk']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'funding.offer': { + 'Meta': {'ordering': "['-end']", 'object_name': 'Offer'}, + 'author': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'book': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Book']", 'null': 'True', 'blank': 'True'}), + 'cover': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'end': ('django.db.models.fields.DateField', [], {'db_index': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'poll': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['polls.Poll']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}), + 'redakcja_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), + 'start': ('django.db.models.fields.DateField', [], {'db_index': 'True'}), + 'target': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) + }, + u'funding.perk': { + 'Meta': {'ordering': "['-price']", 'object_name': 'Perk'}, + 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'long_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'offer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['funding.Offer']", 'null': 'True', 'blank': 'True'}), + 'price': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}) + }, + u'funding.spent': { + 'Meta': {'ordering': "['-timestamp']", 'object_name': 'Spent'}, + 'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}), + 'book': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Book']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'timestamp': ('django.db.models.fields.DateField', [], {}) + }, + u'polls.poll': { + 'Meta': {'object_name': 'Poll'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'open': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'question': ('django.db.models.fields.TextField', [], {}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}) + } + } + + complete_apps = ['funding'] \ No newline at end of file diff --git a/apps/funding/models.py b/apps/funding/models.py index ac652b18e..f88659997 100644 --- a/apps/funding/models.py +++ b/apps/funding/models.py @@ -26,8 +26,6 @@ class Offer(models.Model): target = models.DecimalField(_('target'), decimal_places=2, max_digits=10) start = models.DateField(_('start'), db_index=True) end = models.DateField(_('end'), db_index=True) - due = models.DateField(_('due'), - help_text=_('When will it be published if the money is raised.')) redakcja_url = models.URLField(_('redakcja URL'), blank=True) book = models.ForeignKey(Book, null=True, blank=True, help_text=_('Published book.')) diff --git a/apps/funding/templates/funding/email/thanks.txt b/apps/funding/templates/funding/email/thanks.txt index f1bb08565..2ded0bd9d 100644 --- a/apps/funding/templates/funding/email/thanks.txt +++ b/apps/funding/templates/funding/email/thanks.txt @@ -7,11 +7,8 @@ {% trans 'The book will be supplemented with your name as a donor.' %}{% endif %} {% if funding.perks.exists %} -Skontaktujemy się z Tobą jeszcze w sprawie Twoich prezentów -({% for perk in funding.perks.all %}{{ perk.name }}{% if not forloop.first %}, {% endif %}{% endfor %}). +{% blocktrans %}We will contact you about details needed for your perks.{% endblocktrans %} {% endif %}{# funding.perks.exists #} - -{% blocktrans %}We will contact you to keep you informed about -status changes to this fundraiser and the upcoming ones that we plan -to launch.{% endblocktrans %} +{% blocktrans %}We will keep you informed about status changes to this fundraiser +and the upcoming ones that we plan to launch.{% endblocktrans %} {% endblock %} diff --git a/apps/funding/templates/funding/tags/offer_status.html b/apps/funding/templates/funding/tags/offer_status.html index 1c140686f..5828ce41c 100755 --- a/apps/funding/templates/funding/tags/offer_status.html +++ b/apps/funding/templates/funding/tags/offer_status.html @@ -3,8 +3,10 @@ {% if offer.is_current %} {% if offer.is_win %}

- {% blocktrans with due=offer.due end=offer.end %}The fundraiser - ends on {{ end }}. The book will be published by {{ due }}.{% endblocktrans %} + {% blocktrans with end=offer.end %}The fundraiser + ends on {{ end }}. The full amount has been successfully + raised, but you can still contribute and help liberate + more books.{% endblocktrans %}

{% else %}

diff --git a/apps/funding/templates/funding/tags/offer_status_more.html b/apps/funding/templates/funding/tags/offer_status_more.html index 5c6efb1ee..21e3315e1 100755 --- a/apps/funding/templates/funding/tags/offer_status_more.html +++ b/apps/funding/templates/funding/tags/offer_status_more.html @@ -12,8 +12,6 @@ {% blocktrans with bu=offer.book.get_absolute_url bt=offer.book %}The book {{ bt }} has been already published.{% endblocktrans %} {% else %} - {% blocktrans with due=offer.due %}The book - will be published by {{ due }}.{% endblocktrans %} {% if offer.redakcja_link %} {% blocktrans with r=offer.redakcja_url %}You can follow the work on the Editorial Platform.{% endblocktrans %} diff --git a/apps/funding/templates/funding/thanks.html b/apps/funding/templates/funding/thanks.html index efff200dc..10e680f15 100644 --- a/apps/funding/templates/funding/thanks.html +++ b/apps/funding/templates/funding/thanks.html @@ -10,20 +10,24 @@

{% trans "Thank you!" %}

-{% trans "Thank you for your support!" %} +

{% trans "Thank you for your support!" %}

+

{% blocktrans %}We will contact you if you qualify for perks.{% endblocktrans %}

{% if offer.is_win %}

{% trans "Full amount was successfully raised!" %}

-

{% blocktrans with due=offer.due end=offer.end %}The fundraiser - ends on {{ end }}. The book will be published by {{ due }}.{% endblocktrans %}

+

{% blocktrans with b=offer.title %}Your donation will be spent on digitizing, compiling and + publishing the book {{ b }} in multiple formats.{% endblocktrans %}

+ {% else %} -

- {% blocktrans with b=offer.title %}Your donation will be spent on digitizing, compiling and - publishing the book {{ b }} in multiple formats. We will contact you if you qualify for perks.{% endblocktrans %} -

+ +

{% blocktrans with b=offer.title %}If the full amount needed is raised, + your donation will be spent on digitizing, compiling and + publishing the book {{ b }} in multiple formats.{% endblocktrans %}

+ {% endif %} +

{% include "funding/snippets/any_remaining.html" %} {% trans "Learn more" %}.

diff --git a/apps/funding/tests.py b/apps/funding/tests.py index c9438a878..6321f96b6 100644 --- a/apps/funding/tests.py +++ b/apps/funding/tests.py @@ -2,27 +2,29 @@ # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # +from datetime import date, timedelta from django.test import TestCase from .models import Offer, Perk, Funding class FundTest(TestCase): def setUp(self): + self.today = date.today() self.offer1 = Offer.objects.create( author='author1', title='title1', slug='slug1', - target=100, start='2013-03-01', end='2013-03-31') + target=100, start=self.today, end=self.today) def test_perks(self): perk = Perk.objects.create(price=20, name='Perk 20') perk1 = Perk.objects.create(offer=self.offer1, price=50, name='Perk 50') offer2 = Offer.objects.create( author='author2', title='title2', slug='slug2', - target=100, start='2013-02-01', end='2013-02-20') + target=100, start=self.today-timedelta(1), end=self.today-timedelta(1)) perk2 = Perk.objects.create(offer=offer2, price=1, name='Perk 1') self.assertEqual( - set(self.offer1.fund('Tester', 'test@example.com', 10).perks.all()), + set(self.offer1.get_perks(10)), set()) self.assertEqual( - set(self.offer1.fund('Tester', 'test@example.com', 70).perks.all()), + set(self.offer1.get_perks(70)), set([perk, perk1]))