--- /dev/null
+{% extends "../base-1.html" %}
+
+{% block title %}{{ _("Closed wishes") }}{% end block %}
+
+{% block body %}
+ <div class="page-header">
+ <ul class="nav nav-pills pull-right">
+ <li>
+ <a href="/">{{ _("Wishes open for donation") }}</a>
+ </li>
+ </ul>
+
+ <h1>{{ _("Closed wishes") }}</h1>
+ </div>
+
+ {% if lang == "de" %}
+ <p>
+ Auf dieser Seite finden sich bereits ausgelaufene Sammlungen.
+ </p>
+ {% else %}
+ <p>
+ On this page, you will find all fundings that have already ended.
+ </p>
+ {% end %}
+
+ <hr>
+
+ {% if wishes %}
+ {{ modules.Wishlist(wishes) }}
+
+ <hr>
+
+ <ul class="pager">
+ {% if has_next %}
+ <li class="previous">
+ <a href="/closed?limit={{ limit }}&offset={{ offset + limit }}">← {{ _("Older") }}</a>
+ </li>
+ {% else %}
+ <li class="previous disabled">
+ <a href="#">← {{ _("Older") }}</a>
+ </li>
+ {% end %}
+
+ {% if has_previous %}
+ <li class="next">
+ <a href="/closed?limit={{ limit }}&offset={{ offset - limit }}">{{ _("Newer") }} →</a>
+ </li>
+ {% else %}
+ <li class="next disabled">
+ <a href="#">{{ _("Newer") }} →</a>
+ </li>
+ {% end %}
+ </ul>
+ {% end %}
+{% end %}
{% if wishes %}
{{ modules.Wishlist(wishes) }}
{% else %}
- <div class="alert alert-error">
+ <div class="alert alert-error ac">
{% if lang == "de" %}
- <strong>Es tut uns Leid!</strong>
+ <strong>Es tut uns Leid!</strong><br>
Derzeit finden keine Finanzierungen statt.
Wenn du das Projekt unterstützten möchtest, so
tätige eine <a href="http://www.ipfire.org/donation">Spende</a>.
{% else %}
- <strong>We are sorry!</strong>
+ <strong>We are sorry!</strong><br>
There are currently no running fundings.
If you want to contribute to the project, please
make a <a href="http://www.ipfire.org/donation">donation</a>.
<hr>
- {% if lang == "de" %}
- <p class="ac">
- Du hast eine Idee, oder glaubst ein wichtiges Feature fehlt
- und wäre ideal von der Community finanziert?
- Sende eine E-Mail an
- <a href="mailto:wishlist@ipfire.org">
- <i class="icon-envelope"></i> wishlist@ipfire.org
- </a>
- </p>
- {% else %}
- <p class="ac">
- Do you think we are missing a great feature that could be
- funded by the community? Write us an email about it to
- <a href="mailto:wishlist@ipfire.org">
- <i class="icon-envelope"></i> wishlist@ipfire.org
- </a>
- </p>
- {% end %}
+ <div class="row">
+ <div class="span4 ac">
+ {% if lang == "de" %}
+ Wenn du dich nicht entscheiden kannst für was
+ deine Spende verwendet werden soll, klicke
+ <a href="http://www.ipfire.org/donate">hier</a>.
+ {% else %}
+ In case you cannot decide for which feature
+ your donation should be used, click
+ <a href="http://www.ipfire.org/donate">here</a>.
+ {% end %}
+ </div>
- <hr>
+ <div class="span4 ac">
+ {% if lang == "de" %}
+ Du hast eine Idee, oder glaubst ein wichtiges Feature fehlt
+ und wäre ideal von der Community finanziert?
+ Sende eine E-Mail an:<br>
+ <i class="icon-envelope"></i> <a href="mailto:wishlist@ipfire.org">wishlist@ipfire.org</a>
+ {% else %}
+ Do you think we are missing a great feature that could be
+ funded by the community? Write us an email about it to:<br>
+ <i class="icon-envelope"></i> <a href="mailto:wishlist@ipfire.org">wishlist@ipfire.org</a>
+ {% end %}
+ </div>
- {% if lang == "de" %}
- <p class="ac">
- Wenn du dich nicht entscheiden kannst für was
- deine Spende verwendet werden soll, klicke
- <a href="http://www.ipfire.org/donate">hier</a>.
- </p>
- {% else %}
- <p class="ac">
- In case you cannot decide for which feature
- your donation should be used, click
- <a href="http://www.ipfire.org/donate">here</a>.
- </p>
- {% end %}
+ <div class="span4 ac">
+ {% if lang == "de" %}
+ Bereits abgelaufene Sammlungen finden sich
+ <a href="/closed">hier</a>.
+ {% else %}
+ Already closed fundings are to be found over
+ <a href="/closed">here</a>.
+ {% end %}
+ </div>
+ </div>
{% end block %}
{% if wish.remaining_days >= 0 %}
<p class="lead">{{ wish.remaining_days }}</p>
<p>{{ _("day to go", "days to go", wish.remaining_days) }}</p>
+ {% elif wish.status == "in_progress" %}
+ <p class="lead">{{ _("In progress") }}</p>
+ {% elif wish.status == "finished" %}
+ <p class="lead">{{ _("Finished") }}</p>
{% else %}
- <p class="lead">{{ _("Ended") }}</p>
+ <p class="lead">{{ _("Funding ended") }}</p>
{% end %}
</div>
</div>
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-02-01 18:09+0100\n"
+"POT-Creation-Date: 2013-02-02 18:28+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "Funding ends: %s"
msgstr "Sammlung endet: %s"
+#: templates/wishlist/closed.html:3 templates/wishlist/closed.html:13
+msgid "Closed wishes"
+msgstr "Beendete Wünsche"
+
+#: templates/wishlist/closed.html:9
+msgid "Wishes open for donation"
+msgstr "Noch laufende Wünsche"
+
+#: templates/wishlist/closed.html:36 templates/wishlist/closed.html:40
+msgid "Older"
+msgstr "Älter"
+
+#: templates/wishlist/closed.html:46 templates/wishlist/closed.html:50
+msgid "Newer"
+msgstr "Neuer"
+
#: templates/wishlist/modules/wish.html:6
msgid "Only a few days left!"
msgstr "Nur noch wenige Tage!"
msgstr[1] "Tage übrig"
#: templates/wishlist/modules/wish.html:49
-msgid "Ended"
+msgid "In progress"
+msgstr "In Entwicklung"
+
+#: templates/wishlist/modules/wish.html:51
+msgid "Finished"
msgstr "Beendet"
-#: templates/wishlist/modules/wish.html:59
+#: templates/wishlist/modules/wish.html:53
+msgid "Funding ended"
+msgstr "Sammlung beendet"
+
+#: templates/wishlist/modules/wish.html:63
msgid "Share this wish with your friends and help us promote it!"
msgstr ""
"Teile diesen Wunsch mit deinen Freunden und hilf diesen bekannter zu machen!"
msgid "%s to %s"
msgstr "%s nach %s"
-#: webapp/backend/wishlist.py:135
+#: webapp/backend/wishlist.py:153
msgid "Checkout this crowdfunding wish from #ipfire:"
msgstr ""
msgid "%(commas)s and %(last)s"
msgstr "%(commas)s und %(last)s"
+#~ msgid "Ended"
+#~ msgstr "Beendet"
+
#~ msgid "euro bank transfer"
#~ msgstr "Europa-Banküberweisung"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-02-01 18:09+0100\n"
+"POT-Creation-Date: 2013-02-02 18:28+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "Funding ends: %s"
msgstr ""
+#: templates/wishlist/closed.html:3 templates/wishlist/closed.html:13
+msgid "Closed wishes"
+msgstr ""
+
+#: templates/wishlist/closed.html:9
+msgid "Wishes open for donation"
+msgstr ""
+
+#: templates/wishlist/closed.html:36 templates/wishlist/closed.html:40
+msgid "Older"
+msgstr ""
+
+#: templates/wishlist/closed.html:46 templates/wishlist/closed.html:50
+msgid "Newer"
+msgstr ""
+
#: templates/wishlist/modules/wish.html:6
msgid "Only a few days left!"
msgstr ""
msgstr[1] ""
#: templates/wishlist/modules/wish.html:49
-msgid "Ended"
+msgid "In progress"
+msgstr ""
+
+#: templates/wishlist/modules/wish.html:51
+msgid "Finished"
+msgstr ""
+
+#: templates/wishlist/modules/wish.html:53
+msgid "Funding ended"
msgstr ""
-#: templates/wishlist/modules/wish.html:59
+#: templates/wishlist/modules/wish.html:63
msgid "Share this wish with your friends and help us promote it!"
msgstr ""
msgid "%s to %s"
msgstr ""
-#: webapp/backend/wishlist.py:135
+#: webapp/backend/wishlist.py:153
msgid "Checkout this crowdfunding wish from #ipfire:"
msgstr ""
# wishlist.ipfire.org
self.add_handlers(r"wishlist\.ipfire\.org", [
(r"/", WishlistIndexHandler),
+ (r"/closed", WishlistClosedHandler),
(r"/wish/(.*)/donate", WishDonateHandler),
(r"/wish/(.*)", WishHandler),
(r"/terms", WishlistTermsHandler),
if wish:
return Wish(self, wish.id)
- def get_all_by_query(self, query):
+ def get_all_by_query(self, query, *args):
wishes = []
- for row in self.db.query(query):
+ for row in self.db.query(query, *args):
wish = Wish(self, row.id, row)
wishes.append(wish)
def get_all_running(self):
return self.get_all_by_query("SELECT * FROM wishlist \
- WHERE DATE(NOW()) >= date_start AND DATE(NOW()) <= date_end AND published = 'Y'\
+ WHERE DATE(NOW()) >= date_start AND DATE(NOW()) <= date_end AND status = 'running' \
ORDER BY prio ASC, date_end ASC")
- def get_all_finished(self):
- return self.get_all_by_query("SELECT * FROM wishlist \
- WHERE DATE(NOW()) > date_end AND published = 'Y' ORDER BY date_end ASC")
+ def get_all_finished(self, limit=5, offset=None):
+ query = "SELECT * FROM wishlist WHERE DATE(NOW()) > date_end AND status IS NOT NULL \
+ ORDER BY date_end DESC"
+ args = []
+
+ if limit:
+ if offset:
+ query += " LIMIT %s,%s"
+ args += [limit, offset]
+ else:
+ query += " LIMIT %s"
+ args.append(limit)
+
+ return self.get_all_by_query(query, *args)
class Wish(object):
return self.percentage
+ @property
+ def status(self):
+ if self.data.status == "running" and not self.running:
+ return "closed"
+
+ return self.data.status
+
@property
def running(self):
if self.remaining_days < 0:
self.render("wishlist/index.html", wishes=wishes)
+class WishlistClosedHandler(BaseHandler):
+ def get(self):
+ limit = self.get_argument("limit", None)
+ offset = self.get_argument("offset", None)
+
+ try:
+ limit = int(limit)
+ except:
+ limit = 5
+
+ try:
+ offset = int(offset)
+ except:
+ offset = 0
+
+ wishes = self.wishlist.get_all_finished(limit=limit + 1, offset=offset)
+
+ if len(wishes) > limit:
+ wishes = wishes[:limit]
+ has_next = True
+ else:
+ has_next = False
+
+ if offset:
+ has_previous = True
+ else:
+ has_previous = False
+
+ self.render("wishlist/closed.html", wishes=wishes, limit=limit, offset=offset,
+ has_next=has_next, has_previous=has_previous)
+
+
class WishlistTermsHandler(BaseHandler):
def get(self):
return self.render("wishlist/terms.html")