From a4bbdfca488d989c3459a7e95345686bc072be54 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Mon, 20 May 2013 15:08:08 +0200 Subject: [PATCH] Adding polls to croudfunding --- apps/funding/locale/pl/LC_MESSAGES/django.mo | Bin 6736 -> 6908 bytes apps/funding/locale/pl/LC_MESSAGES/django.po | 66 +++++++----- .../0012_auto__add_field_offer_poll.py | 100 ++++++++++++++++++ apps/funding/models.py | 2 + apps/funding/templates/funding/thanks.html | 7 +- 5 files changed, 146 insertions(+), 29 deletions(-) create mode 100644 apps/funding/migrations/0012_auto__add_field_offer_poll.py diff --git a/apps/funding/locale/pl/LC_MESSAGES/django.mo b/apps/funding/locale/pl/LC_MESSAGES/django.mo index fad3cf0aa1ada2536c16fadd56ba9560db7ba6d1..10ad21b76dd1bf15e061d2b40deddc2e7f094024 100644 GIT binary patch delta 1857 zcmXxkZ){Ul7{~F)mJK!;Xhl%Q9H}4)D)V9H=AsCz?1hcG(?ky4_;e1-isE zF_H;H@ePTMZx#cI8e@!CLo`!^D{5j;gS;?N7UQDCFy5e16E*Vv-JPEFxu0{+ZO=XT zIp_4-)V~`_(}{UUjnYG`AYO=>?ZMf3TqrNrnk~kI$j8cD>Tm*|#kX)iuHdo=o3RGl zu>m{r8tg_5*^7Ma87|FcB^#u&ijJ31Uwjv@!wSyeIoyRO7ns#!f~P033H7^esDTG@ zEe_*Cd<`|BH{AUbcrEQo)C--7ESddGB~QmCT!KDN>BKQyitpnx{0f(pCjKaP;4ypze?Vnu9kWdGd`nSLDxbnO{2HG`<*yxjv5ZGhOR$>P zlC8*`Z6h+KbzvNPP!D+6wVyyuycbEP^}F^EmXwlFDthz7s8mj%9&j8r(A%#49%`Tu zQQ!N_-T%UQ8kxI&=kEXH`hP)C>Kp=+_hgp{r+{-xF5LtAK^{3r?3gnqc(d@g8XZZSMjUmOrR5=ru`T@ zQ8Ns&8NbB!coDVvJZ^U3cGO-tgj(~Xs1%<-KK3aW?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b=@)Kl(`ULM{{}uHCOlS1&?qA{V`ODzoHi>aStx! zG1g%V*5g%FWCn*nowgs@(P_e;W>J`vn|wmEZiOno0^X3P-2cV lI+D`uh#pEyb0+)BJwAWH=Z~JusGA!d%{uFdUUr9^{{h^;i@yK> diff --git a/apps/funding/locale/pl/LC_MESSAGES/django.po b/apps/funding/locale/pl/LC_MESSAGES/django.po index d96f7a21e..13e9228ef 100644 --- a/apps/funding/locale/pl/LC_MESSAGES/django.po +++ b/apps/funding/locale/pl/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-17 12:12+0200\n" +"POT-Creation-Date: 2013-05-20 14:06+0200\n" "PO-Revision-Date: 2013-04-25 13:03+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: LANGUAGE \n" @@ -54,7 +54,7 @@ msgstr "tytuł" msgid "slug" msgstr "slug" -#: models.py:18 models.py:112 +#: models.py:18 models.py:113 msgid "description" msgstr "opis" @@ -90,67 +90,71 @@ msgstr "Opublikowana książka." msgid "Cover" msgstr "Okładka" -#: models.py:31 +#: models.py:28 +msgid "Poll" +msgstr "Ankieta" + +#: models.py:32 msgid "Cover preview" msgstr "Podgląd okładki" -#: models.py:35 models.py:109 models.py:130 +#: models.py:36 models.py:110 models.py:131 msgid "offer" msgstr "zbiórka" -#: models.py:36 +#: models.py:37 msgid "offers" msgstr "zbiórki" -#: models.py:110 +#: models.py:111 msgid "price" msgstr "cena" -#: models.py:111 models.py:131 +#: models.py:112 models.py:132 msgid "name" msgstr "nazwa" -#: models.py:113 +#: models.py:114 msgid "end date" msgstr "data końcowa" -#: models.py:116 +#: models.py:117 msgid "perk" msgstr "prezent" -#: models.py:117 models.py:135 +#: models.py:118 models.py:136 msgid "perks" msgstr "prezenty" -#: models.py:132 +#: models.py:133 msgid "email" msgstr "e-mail" -#: models.py:133 models.py:162 +#: models.py:134 models.py:163 msgid "amount" msgstr "kwota" -#: models.py:134 +#: models.py:135 msgid "payed at" msgstr "data wpłaty" -#: models.py:145 +#: models.py:146 msgid "funding" msgstr "wpłata" -#: models.py:146 +#: models.py:147 msgid "fundings" msgstr "wpłaty" -#: models.py:163 +#: models.py:164 msgid "when" msgstr "kiedy" -#: models.py:166 +#: models.py:167 msgid "money spent on a book" msgstr "pieniądze wydane na książkę" -#: models.py:167 +#: models.py:168 msgid "money spent on books" msgstr "pieniądze wydane na książki" @@ -167,7 +171,9 @@ msgstr "Twoje wsparcie nie zostało zaksięgowane." msgid "" "Return to the current fundraiser and try again " "or try to use a different payment method." -msgstr "Wróć do aktualnej zbiórki i spróbuj ponownie lub użyj innej metody płatności." +msgstr "" +"Wróć do aktualnej zbiórki i spróbuj ponownie lub " +"użyj innej metody płatności." #: templates/funding/offer_detail.html:25 #: templates/funding/tags/funding.html:20 @@ -175,7 +181,7 @@ msgstr "Wróć do aktualnej zbiórki i spróbuj pono msgid "Help free the book!" msgstr "Pomóż uwolnić książkę!" -#: templates/funding/offer_detail.html:29 templates/funding/thanks.html:28 +#: templates/funding/offer_detail.html:29 templates/funding/thanks.html:29 #: templates/funding/wlfund.html:17 templates/funding/tags/funding.html:12 msgid "Learn more" msgstr "Dowiedz się więcej" @@ -188,7 +194,7 @@ msgstr "Wesprzyj publikację" msgid "Donate!" msgstr "Wpłać!" -#: templates/funding/offer_detail.html:52 templates/funding/thanks.html:34 +#: templates/funding/offer_detail.html:52 templates/funding/thanks.html:35 msgid "Tell your friends!" msgstr "Powiedz swoim znajomym!" @@ -220,27 +226,27 @@ msgstr "Aktualna zbiórka:" msgid "Previous fundraisers:" msgstr "Poprzednie zbiórki:" -#: templates/funding/thanks.html:5 templates/funding/thanks.html.py:12 +#: 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:9 +#: templates/funding/thanks.html:10 msgid "Thank you!" msgstr "Dziękujemy!" -#: templates/funding/thanks.html:15 +#: templates/funding/thanks.html:16 #: templates/funding/tags/offer_status.html:18 msgid "Full amount was successfully raised!" msgstr "Udało się zebrać pełną kwotę!" -#: templates/funding/thanks.html:17 templates/funding/tags/offer_status.html:6 +#: templates/funding/thanks.html:18 templates/funding/tags/offer_status.html:6 #, 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." -#: templates/funding/thanks.html:20 +#: templates/funding/thanks.html:21 #, python-format msgid "" "Your\n" @@ -253,14 +259,18 @@ msgstr "" "digitalizację, redakcję techniczną i literacką. Książka zostanie wówczas " "opublikowana do %(due)s." -#: templates/funding/thanks.html:31 +#: templates/funding/thanks.html:32 msgid "Go back to the current fundraiser." msgstr "Wróć do aktualnej zbiórki." -#: templates/funding/thanks.html:35 +#: templates/funding/thanks.html:36 msgid "I support Wolne Lektury." msgstr "Wspieram Wolne Lektury" +#: templates/funding/thanks.html:39 +msgid "Vote for a book for the next fundraiser" +msgstr "Pomóż wybrać nastęną książkę, na którą będziemy zbierać pieniądze" + #: templates/funding/wlfund.html:4 templates/funding/wlfund.html.py:8 msgid "Remaining funds" msgstr "Pozostałe środki" diff --git a/apps/funding/migrations/0012_auto__add_field_offer_poll.py b/apps/funding/migrations/0012_auto__add_field_offer_poll.py new file mode 100644 index 000000000..f824e8ac3 --- /dev/null +++ b/apps/funding/migrations/0012_auto__add_field_offer_poll.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): + # Adding field 'Offer.poll' + db.add_column(u'funding_offer', 'poll', + self.gf('django.db.models.fields.related.ForeignKey')(to=orm['polls.Poll'], null=True, on_delete=models.SET_NULL), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'Offer.poll' + db.delete_column(u'funding_offer', 'poll_id') + + + 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', [], {'max_length': '75', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '127', 'blank': 'True'}), + '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'}), + 'due': ('django.db.models.fields.DateField', [], {}), + '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'}), + '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'}, + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + '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 2c2820d58..162d33739 100644 --- a/apps/funding/models.py +++ b/apps/funding/models.py @@ -8,6 +8,7 @@ from django.db import models from django.utils.translation import ugettext_lazy as _, ugettext as __ import getpaid from catalogue.models import Book +from polls.models import Poll class Offer(models.Model): @@ -25,6 +26,7 @@ class Offer(models.Model): book = models.ForeignKey(Book, null=True, blank=True, help_text=_('Published book.')) cover = models.ImageField(_('Cover'), upload_to = 'funding/covers') + poll = models.ForeignKey(Poll, help_text = _('Poll'), null = True, on_delete = models.SET_NULL) def cover_img_tag(self): return u'' % self.cover.url diff --git a/apps/funding/templates/funding/thanks.html b/apps/funding/templates/funding/thanks.html index 923ed666d..8f65629a4 100755 --- a/apps/funding/templates/funding/thanks.html +++ b/apps/funding/templates/funding/thanks.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% load i18n %} {% load fnp_share %} +{% load polls_tags %} {% block titleextra %}{% trans "Thank you for your support!" %}{% endblock %} @@ -31,9 +32,13 @@

{% trans "Go back to the current fundraiser." %}

-

{% trans "Tell your friends!" %}

+

{% trans "Tell your friends!" %}

+{% if offer.poll %} +

{% trans "Vote for a book for the next fundraiser" %}

+ {% poll offer.poll %} +{% endif %} -- 2.20.1