From b412f294aa668eab3295a058f6c66845ef23ada7 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 15 Jul 2013 10:39:39 +0200 Subject: [PATCH] Remove funding.offer.due. --- apps/funding/admin.py | 2 +- apps/funding/locale/pl/LC_MESSAGES/django.mo | Bin 12741 -> 13102 bytes apps/funding/locale/pl/LC_MESSAGES/django.po | 161 ++++++++++-------- .../0016_auto__del_field_offer_due.py | 100 +++++++++++ apps/funding/models.py | 2 - .../templates/funding/email/thanks.txt | 9 +- .../templates/funding/tags/offer_status.html | 6 +- .../funding/tags/offer_status_more.html | 2 - apps/funding/templates/funding/thanks.html | 18 +- apps/funding/tests.py | 10 +- 10 files changed, 217 insertions(+), 93 deletions(-) create mode 100644 apps/funding/migrations/0016_auto__del_field_offer_due.py 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 15638ce3e2d33cac5bc0e0dc37e7a97ed4ffdfdc..314fc6297305e176d3297ee618e2a332987ac434 100644 GIT binary patch delta 2661 zcma*ndrXyO9KiACa1lXG#6VQU2NXf%A}J{%0!t}W0?b>cj`tj1;BYyIIGhn@)lrJv zyrsO(Vzt>?)~2b|*-D#pF<~>?>|(X$u*(v+TC=uhEi2dech0L@>z|&T-}yYxdwJgH z@_XMA*U6>>qrpQ;sftNTHRBgpg=P0B)rrqy0^Y=IRFjp;gdB{)HCTal7>@@rA78?W z_#twu`V!^(F-*oEk)KkDDj2RLCMwlMTVp9&crSj8C3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>A4?JyF&T zw|1G~d+s}~T94oK_3GA#KhLdO%%S~le%gzMD;gVxH z^$)7Ly`#_U(+m8jm%;0v_Mrh|Q!rqi%w29BEXvB&OY9zddg*9rfXcLDV`#q)7)>2P sU$0wtS{`?1+-Aey7VHUHhl|%)J4!Q>eMXmI?{KTJsl^{YT)HFb9|i4)OaK4? 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])) -- 2.20.1