From: Radek Czajka Date: Thu, 25 Apr 2013 09:01:12 +0000 (+0200) Subject: Some layout experiments. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/2a8b16aa45fb2b17f92068016ec72f93ccdef776?hp=-c Some layout experiments. --- 2a8b16aa45fb2b17f92068016ec72f93ccdef776 diff --git a/apps/funding/admin.py b/apps/funding/admin.py index 37adaf111..b9fc8c97c 100755 --- 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', 'state', 'start', 'end', 'due'] + list_display = ['title', 'author', 'target', 'sum', 'is_win', 'start', 'end', 'due'] search_fields = ['title', 'author'] diff --git a/apps/funding/locale/pl/LC_MESSAGES/django.mo b/apps/funding/locale/pl/LC_MESSAGES/django.mo index 3c69a40bb..866363abe 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 c3f843cb5..86dc282b6 100644 --- a/apps/funding/locale/pl/LC_MESSAGES/django.po +++ b/apps/funding/locale/pl/LC_MESSAGES/django.po @@ -7,9 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-03-27 17:36+0100\n" -"PO-Revision-Date: 2013-03-27 17:36+0100\n" -"Last-Translator: Radek Czajka \n" +"POT-Creation-Date: 2013-04-25 10:52+0200\n" +"PO-Revision-Date: 2013-04-25 10:52+0100\n" +"Last-Translator: Radek Czajka \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" @@ -18,48 +18,42 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" #: forms.py:10 +#: templates/funding/wlfund.html:25 +msgid "Amount" +msgstr "Kwota" + +#: forms.py:12 msgid "Name" msgstr "Imię i nazwisko" -#: forms.py:11 -msgid "Anonymously" -msgstr "Anonimowo" - #: forms.py:13 -msgid "Check if you don't want your name to be visible publicly." -msgstr "Zaznacz, jeśli nie chcesz by Twoje nazwisko było widoczne publicznie." - -#: forms.py:14 -msgid "E-mail" -msgstr "E-mail" - -#: forms.py:15 -msgid "Won't be publicised." -msgstr "Nie zostanie opublikowany." +msgid "Optional name for public list of contributors.
Leave empty if you prefer to remain anonymous.
If we need any data for your perks, we'll get to you by e-mail anyway." +msgstr "Opcjonalnie imię i nazwisko lub pseudonim do listy darczyńców.
Zostaw puste, jeśli wolisz pozostać anonimową/anonimowym.
Jeśli będziemy potrzebować Twoich danych, by wysłać Ci prezenty, zwrócimy się do Ciebie e-mailem." #: forms.py:16 -msgid "Amount" -msgstr "Kwota" +msgid "Contact e-mail" +msgstr "E-mail kontaktowy" + +#: forms.py:17 +msgid "Won't be publicised.
We'll use it to contact you about your perks and fundraiser status updates.
Leave empty if you prefer not to be contacted by us." +msgstr "Nie będzie publikowany.
Użyjemy go do kontaktowania się z Tobą w sprawie prezentów i informacji o zmianach statusu zbiórki.
Zostaw puste, jeśli nie chcesz abyśmy się z Tobą kontaktowali." -#: models.py:13 +#: models.py:15 msgid "author" msgstr "autor" -#: models.py:14 +#: models.py:16 msgid "title" msgstr "tytuł" -#: models.py:15 +#: models.py:17 msgid "slug" msgstr "slug" -#: models.py:17 -msgid "Published book." -msgstr "Opublikowana książka." - #: models.py:18 -msgid "redakcja URL" -msgstr "URL na Redakcji" +#: models.py:100 +msgid "description" +msgstr "opis" #: models.py:19 msgid "target" @@ -81,185 +75,263 @@ 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." +#: models.py:24 +msgid "redakcja URL" +msgstr "URL na Redakcji" + #: models.py:26 -#: models.py:82 +msgid "Published book." +msgstr "Opublikowana książka." + +#: models.py:29 #: models.py:97 +#: models.py:118 msgid "offer" msgstr "zbiórka" -#: models.py:27 +#: models.py:30 msgid "offers" msgstr "zbiórki" -#: models.py:83 +#: models.py:98 msgid "price" msgstr "cena" -#: models.py:84 -#: models.py:98 +#: models.py:99 +#: models.py:119 msgid "name" msgstr "nazwa" -#: models.py:85 -msgid "description" -msgstr "opis" +#: models.py:101 +msgid "end date" +msgstr "data końcowa" -#: models.py:88 +#: models.py:104 msgid "perk" msgstr "prezent" -#: models.py:89 -#: models.py:102 +#: models.py:105 +#: models.py:123 msgid "perks" msgstr "prezenty" -#: models.py:99 +#: models.py:120 msgid "email" msgstr "e-mail" -#: models.py:100 -#: models.py:115 +#: models.py:121 +#: models.py:150 msgid "amount" msgstr "kwota" -#: models.py:101 +#: models.py:122 msgid "payed at" msgstr "data wpłaty" -#: models.py:103 -msgid "anonymous" -msgstr "anonimowo" - -#: models.py:106 +#: models.py:133 msgid "funding" msgstr "wpłata" -#: models.py:107 +#: models.py:134 msgid "fundings" msgstr "wpłaty" -#: models.py:116 +#: models.py:151 msgid "when" msgstr "kiedy" -#: models.py:120 +#: models.py:154 msgid "money spent on a book" msgstr "pieniądze wydane na książkę" -#: models.py:121 +#: models.py:155 msgid "money spent on books" msgstr "pieniądze wydane na książki" -#: templates/funding/offer_detail.html:22 -msgid "Support" -msgstr "Wesprzyj" +#: templates/funding/no_thanks.html:5 +#: templates/funding/no_thanks.html.py:9 +msgid "Payment failed" +msgstr "Płatność nie doszła do skutku" + +#: templates/funding/no_thanks.html:12 +msgid "You're support has not been processed successfully." +msgstr "Twoje wsparcie nie zostało zaksięgowane." + +#: templates/funding/no_thanks.html:17 +#: templates/funding/thanks.html:29 +msgid "Go back to the current fundraiser." +msgstr "Wróć do aktualnej zbiórki." + +#: templates/funding/offer_detail.html:24 +msgid "Support the publication" +msgstr "Wesprzyj publikację" -#: templates/funding/offer_detail.html:39 +#: templates/funding/offer_detail.html:29 +msgid "Donate!" +msgstr "Wpłać!" + +#: templates/funding/offer_detail.html:35 +msgid "See all fundraisers." +msgstr "Zobacz wszystkie zbiórki." + +#: templates/funding/offer_detail.html:40 msgid "Supporters" msgstr "Wpłaty" -#: templates/funding/offer_detail.html:49 +#: templates/funding/offer_detail.html:54 msgid "Anonymous" msgstr "Anonim" -#: templates/funding/offer_list.html:6 -#: templates/funding/offer_list.html:9 -msgid "Support Wolne Lektury" -msgstr "Wspieraj Wolne Lektury" +#: templates/funding/offer_list.html:7 +#: templates/funding/offer_list.html:12 +msgid "All fundraisers" +msgstr "Wszystkie zbiórki" + +#: templates/funding/offer_list.html:20 +msgid "Current fundraiser:" +msgstr "Aktualna zbiórka:" -#: templates/funding/offer_list.html:16 -msgid "funding closed" -msgstr "zbiórka zakończona" +#: templates/funding/offer_list.html:22 +#: templates/funding/offer_list.html:38 +msgid "Previous fundraisers:" +msgstr "Poprzednie zbiórki:" #: templates/funding/thanks.html:5 -#: templates/funding/thanks.html.py:9 +#: templates/funding/thanks.html.py:12 +msgid "Thank you for your support!" +msgstr "Dziękujemy za Twoje wsparcie!" + +#: templates/funding/thanks.html:9 msgid "Thank you!" msgstr "Dziękujemy!" -#: templates/funding/thanks.html:12 -msgid "Thank you for your support!" -msgstr "Dziękujemy za Twoje wsparcie!" +#: templates/funding/thanks.html:15 +#: 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:14 -msgid "Go back to the current fundraiser." -msgstr "Wróć do aktualnej zbiórki." +#: templates/funding/thanks.html:17 +#: 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 +#, python-format +msgid "" +"Your\n" +" donation will be spent on publishing\n" +" the book %(b)s if the full amount is raised by %(end)s.\n" +" The book will then be published by %(due)s." +msgstr "Pieniądze przez Ciebie wpłacone zostaną przekazane napublikację książki %(b)s, jeśli do %(end)s uda nam się zebrać pełnąkwotę potrzebną na digitalizację, redakcję techniczną i literacką.Książka zostanie wówczas opublikowana do %(due)s." + +#: templates/funding/thanks.html:32 +msgid "Tell your friends!" +msgstr "Powiedz swoim znajomym!" + +#: templates/funding/thanks.html:34 +msgid "I support Wolne Lektury." +msgstr "Wspieram Wolne Lektury" #: templates/funding/wlfund.html:4 #: templates/funding/wlfund.html.py:8 -msgid "Wolne Lektury Fund" -msgstr "Fundusz Wolnych Lektur" +msgid "Remaining funds" +msgstr "Pozostałe środki" -#: templates/funding/wlfund.html:14 +#: templates/funding/wlfund.html:11 +#, python-format +msgid "" +"If\n" +"the full amount needed for publishing a book is not raised in time,\n" +"the funds are spent on other books waiting for\n" +"publication. The same thing happens with any money remaining\n" +"from successful fundraisers." +msgstr "Jeśli nie udało się zebrać pełnej kwoty potrzebnej do opublikowaniaksiążki, środki przekazujemy na redakcję innych utworów oczekujących napublikację w serwisie. Na ten celprzekazujemy również pozostałe środki ze zbiórek ukończonych sukcesem." + +#: templates/funding/wlfund.html:16 +msgid "Spending these remaining funds is recorded in this table." +msgstr "W poniższej tabeli rejetrujemy wydatkowanie tych środków." + +#: templates/funding/wlfund.html:23 +msgid "Date" +msgstr "Data" + +#: templates/funding/wlfund.html:24 +msgid "Title" +msgstr "Tytuł" + +#: templates/funding/wlfund.html:26 msgid "Balance" msgstr "Bilans" -#: templates/funding/wlfund.html:26 -msgid "Book" -msgstr "Książka" +#: templates/funding/wlfund.html:33 +msgid "Money spent on publishing the book" +msgstr "Pieniądze przeznaczone na opublikowanie książki" -#: templates/funding/wlfund.html:34 -msgid "Excessive money from fundraiser" -msgstr "Pieniądze pozostałe ze zbiórki" +#: templates/funding/wlfund.html:42 +msgid "Money remaining from the fundraiser for" +msgstr "Pieniądze pozostałe ze zbiórki na" -#: templates/funding/tags/funding.html:10 -msgid "Support a book:" -msgstr "Wesprzyj książkę:" +#: templates/funding/snippets/any_remaining.html:3 +#, python-format +msgid "" +"Any remaining funds will be spent\n" +"on other books waiting to be published in the library." +msgstr "Wszelkie pozostałe środki przeznaczymy na inne książki czekające na publikację w serwisie." -#: templates/funding/tags/funding.html:14 +#: templates/funding/tags/funding.html:8 +msgid "Support a book!" +msgstr "Wesprzyj kolejną publikację!" + +#: templates/funding/tags/funding.html:21 msgid "collected" msgstr "zebrane" -#: templates/funding/tags/funding.html:16 +#: templates/funding/tags/funding.html:24 +msgid "missing" +msgstr "brakuje" + +#: templates/funding/tags/funding.html:27 msgid "until fundraiser end" msgstr "do końca zbiórki" -#: templates/funding/tags/offer_detail_head.html:5 +#: templates/funding/tags/offer_status.html:11 #, python-format msgid "" "If the target is met\n" " by %(end)s, this book will be published by %(due)s." msgstr "Jeśli do %(end)s uda się zebrać pełną kwotę, książka zostanie opublikowana do %(due)s." -#: templates/funding/tags/offer_detail_head.html:10 +#: templates/funding/tags/offer_status.html:22 +msgid "The amount needed was not raised." +msgstr "Nie udało się zebrać pełnej kwoty." + +#: templates/funding/tags/offer_status_more.html:12 #, python-format msgid "" -"Any excessive money will be transfered to the\n" -" Wolne Lektury Fund." +"The book\n" +" %(bt)s has been already published." msgstr "" -"Wszelkie pozostałe środki zostaną przekazane na\n" -" Fundusz Wolnych Lektur." - -#: templates/funding/tags/offer_detail_head.html:15 -msgid "See the published book:" -msgstr "Zobacz opublikowaną książkę:" - -#: templates/funding/tags/offer_detail_head.html:18 -msgid "Funding target has been met!" -msgstr "Udało się zebrać pełną kwotę!" +"Książka\n" +" %(bt)s została opublikowana." -#: templates/funding/tags/offer_detail_head.html:19 -msgid "The book will be published by:" -msgstr "Książka zostanie opublikowana do" - -#: templates/funding/tags/offer_detail_head.html:22 +#: templates/funding/tags/offer_status_more.html:15 #, python-format -msgid "You can follow the work on the Editorial Platform." -msgstr "Możesz śledzić prace na Platformie Redakcyjnej." - -#: templates/funding/tags/offer_detail_head.html:28 -msgid "Funding target has not been met." -msgstr "Nie udało się zebrać pełnej kwoty." +msgid "" +"The book\n" +" will be published by %(due)s." +msgstr "Książka zostanie opublikowana do %(due)s." -#: templates/funding/tags/offer_detail_head.html:31 +#: templates/funding/tags/offer_status_more.html:18 #, python-format msgid "" -"Collected funds have been transfered to the\n" -" Wolne Lektury Fund." -msgstr "" -"Zebrane środki zostały przekazane na\n" -" Fundusz Wolnych Lektur." +"You can follow\n" +" the work on the Editorial Platform." +msgstr "Możesz śledzić prace na Platformie Redakcyjnej." -#: templates/funding/widgets/amount.html:12 +#: templates/funding/widgets/amount.html:13 msgid "Other amount" msgstr "Inna kwota" diff --git a/apps/funding/models.py b/apps/funding/models.py index 8d6fa62c0..de90226f3 100644 --- a/apps/funding/models.py +++ b/apps/funding/models.py @@ -31,7 +31,7 @@ class Offer(models.Model): ordering = ['-end'] def __unicode__(self): - return u"%s – %s" % (self.author, self.title) + return u"%s - %s" % (self.author, self.title) def get_absolute_url(self): return reverse('funding_offer', args=[self.slug]) @@ -39,6 +39,17 @@ class Offer(models.Model): def is_current(self): return self.start <= date.today() <= self.end + def is_win(self): + return self.sum() >= self.target + + def remaining(self): + if self.is_current(): + return None + if self.is_win(): + return self.sum() - self.target + else: + return self.sum() + @classmethod def current(cls): """ Returns current fundraiser or None. """ @@ -76,14 +87,6 @@ class Offer(models.Model): """ The money gathered. """ return self.funding_payed().aggregate(s=models.Sum('amount'))['s'] or 0 - def state(self): - if self.sum() >= self.target: - return 'win' - elif self.start <= date.today() <= self.end: - return 'running' - else: - return 'lose' - class Perk(models.Model): """ A perk offer. diff --git a/apps/funding/static/funding/funding.css b/apps/funding/static/funding/funding.css index aa99d1d27..9b458a2db 100755 --- a/apps/funding/static/funding/funding.css +++ b/apps/funding/static/funding/funding.css @@ -1 +1 @@ -a.funding{font-size:1.5em;padding:.5em 1em;display:block;color:#000;background-image:url(/static/img/green-pixel.png);background-repeat:repeat-y;background-color:rgba(13, 126, 133, .2)}a.funding .mono{font-size:.9em}.wlfund{width:100%;border-collapse:collapse}.wlfund td{padding:0 0 1em 0;text-align:center}.wlfund td:last-child{text-align:right}.wlfund td div{padding:1em;box-shadow:0 2px 0 #DDD}.wlfund .funding-plus td div{background:rgba(13, 126, 133, .2)}.wlfund .funding-minus td div{bbackground:rgba(255, 0, 0, .2);background:#fff}.funding-stale .funding{opacity:.5}button.honking{background:#018189;font-size:1.5em;padding:.5em;color:#fff;border:0}button.honking:hover{background:rgb(.537%, 69.284%, 73.581%)} \ No newline at end of file +.funding{background:orange}.funding a.call{font-size:1.5em;height:1.2em;width:13em;position:relative;padding:.35em .5em;margin:.5em;display:inline-block;vertical-align:top;box-shadow:.2em .2em .3em #888;text-align:center;background:#fff;color:#4E56C8}.funding a.call:hover{box-shadow:none;top:.1em;left:.1em}.funding .description{display:inline-block;padding-left:.6em}.funding strong{font-size:1.5em;padding:.2em .2em 0;display:block}.funding strong a{color:#000}.funding .progress{width:95.7em;margin:.1em .3em .4em;border-radius:2em;background-image:url(/static/img/progress-pixel.png);background-repeat:repeat-y;background-color:rgba(236, 109, 0, .5);box-shadow:.1em .1em .1em #888}.funding .progress .piece{font-size:1.3em;padding:.3em .5em}.funding .with-button .progress{width:73em}.wlfund{width:100%;border-collapse:collapse}.wlfund td{padding:0 0 1em 0;text-align:center}.wlfund td:last-child{text-align:right}.wlfund td div{padding:1em;box-shadow:0 2px 0 #DDD}.wlfund .funding-plus td div{background:rgba(13, 126, 133, .2)}.wlfund .funding-minus td div{background:#fff}button.honking{background:#018189;font-size:1.5em;padding:.5em;color:#fff;border:0;box-shadow:.2em .2em .3em #888;position:relative}button.honking:hover{box-shadow:none;top:.1em;left:.1em} \ No newline at end of file diff --git a/apps/funding/static/funding/funding.scss b/apps/funding/static/funding/funding.scss index 7a158d24e..44109ee9c 100755 --- a/apps/funding/static/funding/funding.scss +++ b/apps/funding/static/funding/funding.scss @@ -1,18 +1,58 @@ -a.funding { - font-size: 1.5em; - padding: .5em 1em; - display: block; - color: black; - - background-image: url(/static/img/green-pixel.png); - background-repeat: repeat-y; - background-color: fade-out(#0D7E85, .8); +.funding { + background: orange; - .mono { - font-size: .9em; + a.call { + font-size: 1.5em; + height: 1.2em; + width: 13em; + position: relative; + padding: .35em .5em; + margin: .5em; + display: inline-block; + vertical-align: top; + box-shadow: 0.2em 0.2em 0.3em #888888; + text-align: center; + background: white; + color: #4E56C8; + } + a.call:hover { + box-shadow: none; + top: .1em; + left: .1em; + } + .description { + display: inline-block; + padding-left: .6em; + } + strong { + font-size: 1.5em; + padding: .2em .2em 0; + display: block; + a { + color: black; + } + } + .progress { + .piece { + font-size: 1.3em; + padding: .3em .5em; + } + width: 95.7em; + margin: .1em .3em .4em; + border-radius: 2em; + background-image: url(/static/img/progress-pixel.png); + background-repeat: repeat-y; + background-color: fade-out(#ec6d00, .5); + box-shadow: .1em .1em .1em #888; + } + .with-button .progress { + width: 73em; } } + + + .wlfund { width: 100%; border-collapse: collapse; @@ -36,18 +76,11 @@ a.funding { } .funding-minus td div { - bbackground: fade-out(red, .8); background: white; } } -.funding-stale { - .funding { - opacity: .5; - } -} - button.honking { background: #018189; @@ -55,7 +88,12 @@ button.honking { padding: .5em; color: white; border: 0; + box-shadow: 0.2em 0.2em 0.3em #888888; + position: relative; } button.honking:hover { - background: lighten(#018189, .1); + box-shadow: none; + top: .1em; + left: .1em; + } diff --git a/apps/funding/templates/funding/offer_detail.html b/apps/funding/templates/funding/offer_detail.html index 638431fc7..f3484ed16 100755 --- a/apps/funding/templates/funding/offer_detail.html +++ b/apps/funding/templates/funding/offer_detail.html @@ -2,6 +2,7 @@ {% load url from future %} {% load i18n %} {% load funding_tags %} +{% load pagination_tags %} {% block titleextra %}{{ object }}{% endblock %} @@ -10,30 +11,28 @@ {% block body %}

{{ object }}

-
- {% funding object %} - {% offer_detail_head object %} +
{{ object.description|safe }}
- {% if object.state == 'running' %} +{% funding object %} +
+ {% offer_status object %} + {% offer_status_more object %} + {% if object.is_current %}
- -

{% trans "Support" %}

+

{% trans "Support the publication" %}

{% csrf_token %} {{ form.as_table }} - +
-
{% endif %} -
{{ object.description|safe }}
- -

Zobacz wszystkie zbiórki.

+

{% trans "See all fundraisers." %}

@@ -41,9 +40,11 @@

{% trans "Supporters" %}:

+{% with object.funding_payed.all as fundings %} - {% for funding in object.funding_payed.all %} + {% autopaginate fundings 10 %} + {% for funding in fundings %} - + {% endfor %}
{{ funding.payed_at.date }}
@@ -53,7 +54,7 @@ {% trans "Anonymous" %} {% endif %}
+{{ funding.amount }} zł
{{ funding.amount }} zł
{% for perk in funding.perks.all %} {{ perk.name }}{% if not forloop.last %},{% endif %} @@ -61,7 +62,9 @@
- + + {% paginate %} +{% endwith %}
{% endblock %} diff --git a/apps/funding/templates/funding/offer_list.html b/apps/funding/templates/funding/offer_list.html index 26f6a47bb..f9b9d54fc 100755 --- a/apps/funding/templates/funding/offer_list.html +++ b/apps/funding/templates/funding/offer_list.html @@ -2,30 +2,44 @@ {% load url from future %} {% load i18n %} {% load funding_tags %} +{% load pagination_tags %} -{% block titleextra %}{% trans "Support Wolne Lektury" %}{% endblock %} +{% block titleextra %}{% trans "All fundraisers" %}{% endblock %} + +{% block bodyid %}funding-offer-list{% endblock %} {% block body %} -

{% trans "Support Wolne Lektury" %}

+

{% trans "All fundraisers" %}

+ + +{% autopaginate object_list 10 %} +{% for offer in object_list %} +{% with is_win=offer.is_win is_current=offer.is_current %} -{% for funding in object_list %} - {% if funding.is_current %} + {% if is_current %}

{% trans "Current fundraiser:" %}

{% elif forloop.is_first %}

{% trans "Previous fundraisers:" %}

{% endif %} -
-

{{ funding.start }} – {{ funding.end }} - {% if not funding.is_current %} - ({% trans "funding closed" %}) - {% endif %} -

- {% funding funding link=1 %} - {% offer_detail_head funding %} + +
+ {% offer_status offer %}
- {% if funding.is_current and not forloop.is_last %} + + {% funding offer link=1 %} + + +
+ {% offer_status_more offer %} +
+ +
+ {% if is_current and not forloop.is_last %}

{% trans "Previous fundraisers:" %}

{% endif %} + +{% endwith %} {% endfor %} +{% paginate %} {% endblock %} diff --git a/apps/funding/templates/funding/snippets/any_remaining.html b/apps/funding/templates/funding/snippets/any_remaining.html new file mode 100755 index 000000000..86db70fd3 --- /dev/null +++ b/apps/funding/templates/funding/snippets/any_remaining.html @@ -0,0 +1,4 @@ +{% load i18n %} +{% url 'funding_wlfund' as wlfund %} +{% blocktrans %}Any remaining funds will be spent +on other books waiting to be published in the library.{% endblocktrans %} diff --git a/apps/funding/templates/funding/tags/funding.html b/apps/funding/templates/funding/tags/funding.html index dd25247f7..dbcb871df 100755 --- a/apps/funding/templates/funding/tags/funding.html +++ b/apps/funding/templates/funding/tags/funding.html @@ -1,24 +1,37 @@ {% load i18n %} {% load time_tags %} {% if offer %} - - {% if is_current %} - {% trans "Support a book:" %} - {% endif %} - {{ offer }} - - {% trans "missing" %}: {{ missing }} zł - {% trans "collected" %}: {{ sum }} - {% if is_current %} - {% trans "until fundraiser end" %}: - - +{% spaceless %} +
+ {% if link and is_current %} + + {% trans "Support a book!" %} {% endif %} - -
- + +
+{% endspaceless %} {% endif %} diff --git a/apps/funding/templates/funding/tags/offer_detail_head.html b/apps/funding/templates/funding/tags/offer_detail_head.html deleted file mode 100644 index 000b9b8a3..000000000 --- a/apps/funding/templates/funding/tags/offer_detail_head.html +++ /dev/null @@ -1,35 +0,0 @@ -{% load url from future %} -{% load i18n %} -{% if state == "running" %} -

- {% blocktrans with due=offer.due end=offer.end %}If the target is met - by {{ end }}, this book will be published by {{ due }}.{% endblocktrans %} -

-

- {% url 'funding_wlfund' as url %} - {% blocktrans %}Any excessive money will be transfered to the - Wolne Lektury Fund.{% endblocktrans %} -

-{% elif state == "win" %} - {% if offer.book %} -

{% trans "See the published book:" %} - {{ offer.book }}.

- {% else %} -

{% trans "Funding target has been met!" %}

-

{% trans "The book will be published by:" %} {{ offer.due }}. - {% if offer.redakcja_url %} - {% with url=offer.redakcja_url %} - {% blocktrans %}You can follow the work on the Editorial Platform.{% endblocktrans %} - {% endwith %} - {% endif %} -

- {% endif %} -{% elif state == "lose" %} -

{% trans "Funding target has not been met." %} - {% if offer.sum %} - {% url 'funding_wlfund' as url %} - {% blocktrans %}Collected funds have been transfered to the - Wolne Lektury Fund.{% endblocktrans %} - {% endif %} -

-{% endif %} diff --git a/apps/funding/templates/funding/tags/offer_status.html b/apps/funding/templates/funding/tags/offer_status.html new file mode 100755 index 000000000..998d942dc --- /dev/null +++ b/apps/funding/templates/funding/tags/offer_status.html @@ -0,0 +1,25 @@ +{% load i18n %} + +{% 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 %} +

+ {% else %} +

+ {% blocktrans with due=offer.due end=offer.end %}If the target is met + by {{ end }}, this book will be published by {{ due }}.{% endblocktrans %} +

+ {% endif %} +{% else %} + {% if offer.is_win %} +

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

+ {% else %} +

+ {% trans "The amount needed was not raised." %} +

+ {% endif %} +{% endif %} diff --git a/apps/funding/templates/funding/tags/offer_status_more.html b/apps/funding/templates/funding/tags/offer_status_more.html new file mode 100755 index 000000000..6291e9fb4 --- /dev/null +++ b/apps/funding/templates/funding/tags/offer_status_more.html @@ -0,0 +1,28 @@ +{% load i18n %} + +{% if offer.is_current %} +

+ {% include "funding/snippets/any_remaining.html" %} +

+{% else %} +

{{ offer.start }} – {{ offer.end }}

+ {% if offer.is_win %} +

+ {% if offer.book %} + {% 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 %} + {% endif %} + {% endif %} +

+ {% endif %} + + {% if offer.remaining %} +

{% include "funding/snippets/any_remaining.html" %}

+ {% endif %} +{% endif %} diff --git a/apps/funding/templates/funding/thanks.html b/apps/funding/templates/funding/thanks.html index fdf0ae6df..72b7c2970 100755 --- a/apps/funding/templates/funding/thanks.html +++ b/apps/funding/templates/funding/thanks.html @@ -2,7 +2,7 @@ {% load i18n %} {% load fnp_share %} -{% block titleextra %}{% trans "Thank you!" %}{% endblock %} +{% block titleextra %}{% trans "Thank you for your support!" %}{% endblock %} {% block body %} @@ -11,12 +11,25 @@ {% trans "Thank you for your support!" %} -{% url 'funding_current' as c %} -

{% blocktrans %}Your support will appear on the -current fundraiser page shortly.{% 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 %}

+{% else %} +

{% blocktrans with b=object.title due=offer.due end=offer.end %}Your + donation will be spent on publishing + the book {{ b }} if the full amount is raised by {{ end }}. + The book will then be published by {{ due }}.{% endblocktrans %}

+{% endif %} -

{% trans "Tell your friends about the fundraiser!" %}

+

{% include "funding/snippets/any_remaining.html" %}

+ +{% url 'funding_current' as current %} +

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

+ + +

{% trans "Tell your friends!" %}

{% share current _("I support Wolne Lektury.") %}

diff --git a/apps/funding/templates/funding/wlfund.html b/apps/funding/templates/funding/wlfund.html index da35943c3..6a405ad56 100755 --- a/apps/funding/templates/funding/wlfund.html +++ b/apps/funding/templates/funding/wlfund.html @@ -1,39 +1,49 @@ {% extends "base.html" %} {% load i18n %} -{% block titleextra %}{% trans "Wolne Lektury Fund" %}{% endblock %} +{% block titleextra %}{% trans "Remaining funds" %}{% endblock %} {% block body %} -

{% trans "Wolne Lektury Fund" %}

+

{% trans "Remaining funds" %}

+ +
+

{% blocktrans with r="http://redakcja.wolnelektury.pl/" %}If +the full amount needed for publishing a book is not raised in time, +the funds are spent on other books waiting for +publication. The same thing happens with any money remaining +from successful fundraisers.{% endblocktrans %}

+

{% trans "Spending these remaining funds is recorded in this table." %}

+
+ + + - - - {% for tag, entry in log %} {% if tag == 'spent' %} + - {% else %} - - - + {{ entry }} + + {% endif %} {% endfor %} diff --git a/apps/funding/templatetags/funding_tags.py b/apps/funding/templatetags/funding_tags.py index ae3b04f62..d50551a38 100755 --- a/apps/funding/templatetags/funding_tags.py +++ b/apps/funding/templatetags/funding_tags.py @@ -23,10 +23,16 @@ def funding(context, offer=None, link=False, add_class=""): } -@register.inclusion_tag("funding/tags/offer_detail_head.html") -def offer_detail_head(offer): +@register.inclusion_tag("funding/tags/offer_status.html") +def offer_status(offer): return { 'offer': offer, - 'state': offer.state(), } +@register.inclusion_tag("funding/tags/offer_status_more.html") +def offer_status_more(offer): + return { + 'offer': offer, + } + + diff --git a/apps/funding/views.py b/apps/funding/views.py index 4db8267ef..66c34a28f 100644 --- a/apps/funding/views.py +++ b/apps/funding/views.py @@ -121,6 +121,7 @@ class ThanksView(TemplateView): def get_context_data(self, *args, **kwargs): ctx = super(ThanksView, self).get_context_data(*args, **kwargs) + ctx['offer'] = Offer.current() ctx['funding_no_show_current'] = True return ctx diff --git a/apps/modeltranslation/fields.py b/apps/modeltranslation/fields.py index be942f6a5..fe413ce3e 100644 --- a/apps/modeltranslation/fields.py +++ b/apps/modeltranslation/fields.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from django.conf import settings from django.db.models.fields import Field, CharField +from django.utils.translation import string_concat from modeltranslation.utils import get_language, build_localized_fieldname @@ -44,12 +45,8 @@ class TranslationField(Field): # Copy the verbose name and append a language suffix (will e.g. in the # admin). This might be a proxy function so we have to check that here. - if hasattr(translated_field.verbose_name, '_proxy____unicode_cast'): - verbose_name = \ - translated_field.verbose_name._proxy____unicode_cast() - else: - verbose_name = translated_field.verbose_name - self.verbose_name = '%s [%s]' % (verbose_name, language) + self.verbose_name = string_concat(translated_field.verbose_name, + ' [%s]' % (language, )) def pre_save(self, model_instance, add): val = super(TranslationField, self).pre_save(model_instance, add) diff --git a/apps/wolnelektury_core/static/css/core.css b/apps/wolnelektury_core/static/css/core.css index b5e4432e4..514f8af3a 100644 --- a/apps/wolnelektury_core/static/css/core.css +++ b/apps/wolnelektury_core/static/css/core.css @@ -1,3 +1,3 @@ -@import url("screen.css"); -@import url("antiscreen.css") handheld; -@import url("antiscreen.css") only screen and (max-device-width:480px); +@import url(screen.css); +@import url(antiscreen.css) handheld; +@import url(antiscreen.css) only screen and (max-device-width:480px); diff --git a/apps/wolnelektury_core/static/img/green-pixel.png b/apps/wolnelektury_core/static/img/green-pixel.png deleted file mode 100644 index edb512d11..000000000 Binary files a/apps/wolnelektury_core/static/img/green-pixel.png and /dev/null differ diff --git a/apps/wolnelektury_core/static/img/progress-pixel.png b/apps/wolnelektury_core/static/img/progress-pixel.png new file mode 100644 index 000000000..5af1bfdfe Binary files /dev/null and b/apps/wolnelektury_core/static/img/progress-pixel.png differ diff --git a/wolnelektury/urls.py b/wolnelektury/urls.py index d78a94d71..696a8e87c 100644 --- a/wolnelektury/urls.py +++ b/wolnelektury/urls.py @@ -35,7 +35,7 @@ urlpatterns += patterns('', url(r'^ludzie/', include('social.urls')), url(r'^uzytkownik/', include('allauth.urls')), url(r'^czekaj/', include('waiter.urls')), - url(r'^fund/', include('funding.urls')), + url(r'^wesprzyj/', include('funding.urls')), # Admin panel url(r'^admin/catalogue/book/import$', 'catalogue.views.import_book', name='import_book'),
{% trans "Date" %}:
{% trans "Title" %}:
{% trans "Amount" %}:
{% trans "Balance" %}:
 
{{ amount }} zł
 
{{ entry.timestamp }}
{% trans "Money spent on publishing the book" %}: + + {{ entry.book }}
-{{ entry.amount }} zł
{{ entry.total }} zł
{% trans "Book" %}: - {{ entry.book }}
{{ entry.end }}
+{{ entry.wlfund }} zł
{{ entry.total }} zł
{% trans "Excessive money from fundraiser" %}: +
{% trans "Money remaining from the fundraiser for" %}: - {{ entry }}
{{ entry.total }} zł
+{{ entry.wlfund }} zł