From: Aleksander Łukasz Date: Mon, 20 May 2013 13:08:08 +0000 (+0200) Subject: Adding polls to croudfunding X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/a4bbdfca488d989c3459a7e95345686bc072be54?ds=sidebyside;hp=9203d27cee887569ad260dd91d798df68a1d3ada Adding polls to croudfunding --- diff --git a/apps/funding/locale/pl/LC_MESSAGES/django.mo b/apps/funding/locale/pl/LC_MESSAGES/django.mo index fad3cf0aa..10ad21b76 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 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 %}