From 918284e853fa227ffe88542afe10f6e2a66214de Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 8 Nov 2012 22:29:02 +0100 Subject: [PATCH] Update donation information. --- www/templates/index.html | 4 + www/templates/modules/donation-box.html | 178 ++++++++++--------- www/templates/static/donation.html | 4 +- www/templates/wishlist/index.html | 16 ++ www/templates/wishlist/modules/wish.html | 2 +- www/templates/wishlist/wish.html | 25 ++- www/translations/de_DE/LC_MESSAGES/webapp.po | 46 ++--- www/translations/webapp.pot | 44 ++--- www/webapp/backend/wishlist.py | 19 +- 9 files changed, 188 insertions(+), 150 deletions(-) diff --git a/www/templates/index.html b/www/templates/index.html index 91fa7b99..7ea5b06c 100644 --- a/www/templates/index.html +++ b/www/templates/index.html @@ -111,6 +111,10 @@ {% end %} + +

+ {{ _("Support this project with your donation!") }} +

diff --git a/www/templates/modules/donation-box.html b/www/templates/modules/donation-box.html index 7c5ba4af..a1a939f0 100644 --- a/www/templates/modules/donation-box.html +++ b/www/templates/modules/donation-box.html @@ -1,98 +1,100 @@ -
-
- -
-
- {% if lang == "de" %} -

- PayPal ist unser bevorzugter und gleichzeitig einfachster Weg zu spenden. - Dazu einfach auf den Button klicken und den gewünschten Betrag eingeben. -

+
+ +
+
+ {% if lang == "de" %} +

+ PayPal ist unser bevorzugter und gleichzeitig einfachster Weg zu spenden. + Dazu einfach auf den Button klicken und den gewünschten Betrag eingeben. +

-
-
- - - {% if reason_for_transfer %} - - {% end %} - - -
-
- {% else %} -

- PayPal is our preferred way to make donations. - Simply click on the donate button and type in the - amount of money you would like to donate. -

+
+
+ + + {% if reason_for_transfer %} + + {% end %} + + +
+
-
-
- - - {% if reason_for_transfer %} - - {% end %} - - -
-
- {% end %} -
-
-
+

+ Wenn du nicht per PayPal spenden möchtest, kannst du das auch per + Banküberweisung tun. Dazu einfach oben auf den Button klicken. +

+ {% else %} +

+ PayPal is our preferred way to make donations. + Simply click on the donate button and type in the + amount of money you would like to donate. +

-
-
- - {{ _("Bank Transfer") }} - +
+
+ + + {% if reason_for_transfer %} + + {% end %} + + +
+
+ +

+ If you are not keen on using PayPal, you can also donate by bank transfer. + Click on the button above to do so. +

+ {% end %}
-
-
- {% if lang == "de" %} -

- Ebenso ist eine Spende auf unser Bankkonto möglich. -

- {% else %} -

- It is also possible to transfer donations into - our bank account. -

- {% end %} -
-
-

{{ _("euro bank transfer") }}

-
- {{ _("IBAN") }}: DE86 4265 0150 1020 0768 89
- {{ _("BIC-/SWIFT-Code") }}: WELADED1REK - {% if reason_for_transfer %} -
- {{ _("Reason for transfer") }}: - {{ reason_for_transfer }} - {% end %} -
-
+
+ {% if lang == "de" %} +

+ Ebenso ist eine Spende auf unser Bankkonto möglich. +

+ {% else %} +

+ It is also possible to transfer donations into + our bank account. +

+ {% end %} -
-

{{ _("bank transfer within Germany") }}

-
- {{ _("Bank account owner") }}: Michael Tremer
- {{ _("Bank account number") }}: 1020076889
- {{ _("Bank code") }}: 426 501 50 - {% if reason_for_transfer %} -
- {{ _("Reason for transfer") }}: - {{ reason_for_transfer }} - {% end %} +
+
+

{{ _("euro bank transfer") }}

+
+ {{ _("IBAN") }}: DE86 4265 0150 1020 0768 89
+ {{ _("BIC-/SWIFT-Code") }}: WELADED1REK + {% if reason_for_transfer %} +
+ {{ _("Reason for transfer") }}: + {{ reason_for_transfer }} + {% end %}
-
+
+ +
+

{{ _("bank transfer within Germany") }}

+
+ {{ _("Bank account owner") }}: Michael Tremer
+ {{ _("Bank account number") }}: 1020076889
+ {{ _("Bank code") }}: 426 501 50 + {% if reason_for_transfer %} +
+ {{ _("Reason for transfer") }}: + {{ reason_for_transfer }} + {% end %} +
diff --git a/www/templates/static/donation.html b/www/templates/static/donation.html index 5c25fc83..3e1bd064 100644 --- a/www/templates/static/donation.html +++ b/www/templates/static/donation.html @@ -57,7 +57,9 @@
{{ modules.DonationBox() }} -
+
+ +
{{ _("Did you know...?") }} {% if lang == "de" %} diff --git a/www/templates/wishlist/index.html b/www/templates/wishlist/index.html index 4f278702..453b6b0f 100644 --- a/www/templates/wishlist/index.html +++ b/www/templates/wishlist/index.html @@ -73,4 +73,20 @@

{% end %} + +
+ + {% if lang == "de" %} +

+ Wenn du dich nicht entscheiden kannst für was + deine Spende verwendet werden soll, klicke + hier. +

+ {% else %} +

+ In case you cannot decide for which feature + your donation should be used, click + here. +

+ {% end %} {% end block %} diff --git a/www/templates/wishlist/modules/wish.html b/www/templates/wishlist/modules/wish.html index db4391ee..6c2d575b 100644 --- a/www/templates/wishlist/modules/wish.html +++ b/www/templates/wishlist/modules/wish.html @@ -16,7 +16,7 @@ {% end %}
-
+
diff --git a/www/templates/wishlist/wish.html b/www/templates/wishlist/wish.html index d6b50204..9281b2a7 100644 --- a/www/templates/wishlist/wish.html +++ b/www/templates/wishlist/wish.html @@ -9,18 +9,17 @@ {{ modules.Wishlist([wish,], short=True) }} -
-
    -
  • - - {{ _("Launched: %s") % wish.date_start }} -
  • -
  • - - {{ _("Funding ends: %s") % wish.date_end }} -
  • -
-
- {{ wish.description }} + +
+ +

+ + {{ _("Launched: %s") % wish.date_start }} + + • + + + {{ _("Funding ends: %s") % wish.date_end }} +

{% end block %} diff --git a/www/translations/de_DE/LC_MESSAGES/webapp.po b/www/translations/de_DE/LC_MESSAGES/webapp.po index b3d28196..a18759a8 100644 --- a/www/translations/de_DE/LC_MESSAGES/webapp.po +++ b/www/translations/de_DE/LC_MESSAGES/webapp.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-11-02 13:12+0100\n" +"POT-Creation-Date: 2012-11-08 21:41+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -641,7 +641,7 @@ msgid "About IPFire" msgstr "Über IPFire" #: templates/base-feature.html:9 templates/static/features/security.html:3 -#: templates/static/features/security.html:9 templates/index.html:118 +#: templates/static/features/security.html:9 templates/index.html:122 msgid "Security" msgstr "Sicherheit" @@ -925,44 +925,44 @@ msgstr "Seeders" msgid "Error" msgstr "Error" -#: templates/modules/donation-box.html:5 +#: templates/modules/donation-box.html:4 msgid "Donate with PayPal or Credit Card" msgstr "Mit PayPal oder Kreditkarte spenden" -#: templates/modules/donation-box.html:53 -msgid "Bank Transfer" -msgstr "Banküberweisung" +#: templates/modules/donation-box.html:7 +msgid "Donate by Bank Transfer" +msgstr "Per Banküberweisung spenden" -#: templates/modules/donation-box.html:71 +#: templates/modules/donation-box.html:74 msgid "euro bank transfer" msgstr "Europa-Banküberweisung" -#: templates/modules/donation-box.html:73 +#: templates/modules/donation-box.html:76 msgid "IBAN" msgstr "IBAN" -#: templates/modules/donation-box.html:74 +#: templates/modules/donation-box.html:77 msgid "BIC-/SWIFT-Code" msgstr "BIC-/SWIFT-Code" -#: templates/modules/donation-box.html:77 -#: templates/modules/donation-box.html:91 +#: templates/modules/donation-box.html:80 +#: templates/modules/donation-box.html:94 msgid "Reason for transfer" msgstr "Verwendungszweck" -#: templates/modules/donation-box.html:84 +#: templates/modules/donation-box.html:87 msgid "bank transfer within Germany" msgstr "Überweisung innerhalb Deutschlands" -#: templates/modules/donation-box.html:86 +#: templates/modules/donation-box.html:89 msgid "Bank account owner" msgstr "Kontoinhaber" -#: templates/modules/donation-box.html:87 +#: templates/modules/donation-box.html:90 msgid "Bank account number" msgstr "Kontonummer" -#: templates/modules/donation-box.html:88 +#: templates/modules/donation-box.html:91 msgid "Bank code" msgstr "BLZ" @@ -1302,15 +1302,15 @@ msgstr "Impressum" msgid "Donation" msgstr "Spende" -#: templates/static/donation.html:61 +#: templates/static/donation.html:63 msgid "Did you know...?" msgstr "Schon gewusst?" -#: templates/static/donation.html:77 +#: templates/static/donation.html:79 msgid "How do we use financial support?" msgstr "Wofür werden Spenden eingesetzt?" -#: templates/static/donation.html:129 +#: templates/static/donation.html:131 msgid "Research & Development" msgstr "Forschung & Entwicklung" @@ -1326,15 +1326,19 @@ msgstr "Neu!" msgid "What's new?" msgstr "Neuigkeiten" -#: templates/index.html:135 +#: templates/index.html:116 +msgid "Support this project with your donation!" +msgstr "Unterstütze dieses Projekt mit deiner Spende!" + +#: templates/index.html:139 msgid "Flexibility" msgstr "Flexibilität" -#: templates/index.html:152 +#: templates/index.html:156 msgid "Open Source" msgstr "Open Source" -#: templates/index.html:169 +#: templates/index.html:173 msgid "Read more" msgstr "Mehr erfahren" diff --git a/www/translations/webapp.pot b/www/translations/webapp.pot index 48de2119..f7986937 100644 --- a/www/translations/webapp.pot +++ b/www/translations/webapp.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-11-02 13:12+0100\n" +"POT-Creation-Date: 2012-11-08 21:41+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -632,7 +632,7 @@ msgid "About IPFire" msgstr "" #: templates/base-feature.html:9 templates/static/features/security.html:3 -#: templates/static/features/security.html:9 templates/index.html:118 +#: templates/static/features/security.html:9 templates/index.html:122 msgid "Security" msgstr "" @@ -916,44 +916,44 @@ msgstr "" msgid "Error" msgstr "" -#: templates/modules/donation-box.html:5 +#: templates/modules/donation-box.html:4 msgid "Donate with PayPal or Credit Card" msgstr "" -#: templates/modules/donation-box.html:53 -msgid "Bank Transfer" +#: templates/modules/donation-box.html:7 +msgid "Donate by Bank Transfer" msgstr "" -#: templates/modules/donation-box.html:71 +#: templates/modules/donation-box.html:74 msgid "euro bank transfer" msgstr "" -#: templates/modules/donation-box.html:73 +#: templates/modules/donation-box.html:76 msgid "IBAN" msgstr "" -#: templates/modules/donation-box.html:74 +#: templates/modules/donation-box.html:77 msgid "BIC-/SWIFT-Code" msgstr "" -#: templates/modules/donation-box.html:77 -#: templates/modules/donation-box.html:91 +#: templates/modules/donation-box.html:80 +#: templates/modules/donation-box.html:94 msgid "Reason for transfer" msgstr "" -#: templates/modules/donation-box.html:84 +#: templates/modules/donation-box.html:87 msgid "bank transfer within Germany" msgstr "" -#: templates/modules/donation-box.html:86 +#: templates/modules/donation-box.html:89 msgid "Bank account owner" msgstr "" -#: templates/modules/donation-box.html:87 +#: templates/modules/donation-box.html:90 msgid "Bank account number" msgstr "" -#: templates/modules/donation-box.html:88 +#: templates/modules/donation-box.html:91 msgid "Bank code" msgstr "" @@ -1293,15 +1293,15 @@ msgstr "" msgid "Donation" msgstr "" -#: templates/static/donation.html:61 +#: templates/static/donation.html:63 msgid "Did you know...?" msgstr "" -#: templates/static/donation.html:77 +#: templates/static/donation.html:79 msgid "How do we use financial support?" msgstr "" -#: templates/static/donation.html:129 +#: templates/static/donation.html:131 msgid "Research & Development" msgstr "" @@ -1317,15 +1317,19 @@ msgstr "" msgid "What's new?" msgstr "" -#: templates/index.html:135 +#: templates/index.html:116 +msgid "Support this project with your donation!" +msgstr "" + +#: templates/index.html:139 msgid "Flexibility" msgstr "" -#: templates/index.html:152 +#: templates/index.html:156 msgid "Open Source" msgstr "" -#: templates/index.html:169 +#: templates/index.html:173 msgid "Read more" msgstr "" diff --git a/www/webapp/backend/wishlist.py b/www/webapp/backend/wishlist.py index 8a055412..d3b7a26d 100644 --- a/www/webapp/backend/wishlist.py +++ b/www/webapp/backend/wishlist.py @@ -16,7 +16,7 @@ class Wishlist(object): return Databases().webapp def get(self, slug): - wish = self.db.get("SELECT id FROM wishlist WHERE slug = %s", slug) + wish = self.db.get("SELECT * FROM wishlist WHERE slug = %s", slug) if wish: return Wish(self, wish.id) @@ -25,27 +25,27 @@ class Wishlist(object): wishes = [] for row in self.db.query(query): - wish = Wish(self, row.id) + wish = Wish(self, row.id, row) wishes.append(wish) return wishes def get_all_running(self): - return self.get_all_by_query("SELECT id FROM wishlist \ + return self.get_all_by_query("SELECT * FROM wishlist \ WHERE DATE(NOW()) >= date_start AND DATE(NOW()) <= date_end AND published = 'Y'\ ORDER BY prio ASC, date_end ASC") def get_all_finished(self): - return self.get_all_by_query("SELECT id FROM wishlist \ + return self.get_all_by_query("SELECT * FROM wishlist \ WHERE DATE(NOW()) > date_end AND published = 'Y' ORDER BY date_end ASC") class Wish(object): - def __init__(self, wishlist, id): + def __init__(self, wishlist, id, data=None): self.wishlist = wishlist self.id = id - self.__data = None + self.__data = data def __cmp__(self, other): return cmp(self.date_end, other.date_end) @@ -90,6 +90,13 @@ class Wish(object): def percentage(self): return (self.donated / self.goal) * 100 + @property + def percentage_bar(self): + if self.percentage > 100: + return 100 + + return self.percentage + @property def running(self): if self.remaining_days < 0: -- 2.39.2