-{% extends "../base-1.html" %}
+{% extends "base-1.html" %}
{% block title %}{{ _("Donate") }}{% end block %}
<div class="row">
<div class="col-lg-10 col-md-10 col-lg-offset-1">
- {% module DonationBox() %}
-
- <p class="ac">
- <strong>{{ _("Did you know...?") }}</strong>
-
- {% if lang == "de" %}
- Du kannst die Implementierung deiner bevorzugten Funktion mit Hilfe einer Spende auf der
- <a href="http://wishlist.ipfire.org/">IPFire Wunschliste</a> unterstützen!
- {% else %}
- You can support the implementation of your favorite feature on the
- <a href="http://wishlist.ipfire.org/">IPFire wishlist</a>!
- {% end %}
- </p>
+ {% module DonationBox(show_wishlist_items=True) %}
</div>
</div>
<small>{{ _("The IPFire Crowdfunding Platform") }}</small>
</h3>
- <table class="table-wishlist-widget">
- {% for item in wishlist_items %}
- <tr>
- <td>
- {% if item.is_new() %}
- <span class="label label-success pull-right">{{ _("NEW") }}</span>
- {% elif item.remaining_days and item.remaining_days <= 10 %}
- <span class="pull-right">
- {{ _("one day left", "%(num)s days left", item.remaining_days) % { "num" : item.remaining_days } }}
- </span>
- {% else %}
- <span class="pull-right">
- {{ _("%d%% funded") % item.percentage }}
- </span>
- {% end %}
-
- <a href="http://wishlist.ipfire.org/wish/{{ item.slug }}" target="_blank">{{ item.title }}</a>
-
- <br class="separator-small">
-
- <div class="progress progress-small">
- <div class="progress-bar progress-{{ item.progressbar_colour }}" style="width: {{ "%.2f%%" % item.percentage_bar }};"></div>
- </div>
- </td>
- </tr>
- {% end %}
- </table>
+ {% module WishlistItems(wishlist_items) %}
{% end %}
</div>
</p>
</div>
</div>
+
+ {% if wishlist_items %}
+ <hr>
+
+ <div class="row">
+ <div class="col-md-12">
+ <p class="ac">
+ <strong>{{ _("Did you know...?") }}</strong>
+
+ {% if lang == "de" %}
+ Du kannst die Implementierung deiner bevorzugten Funktion mit Hilfe einer Spende auf der
+ <a href="http://wishlist.ipfire.org/">IPFire Wunschliste</a> unterstützen!
+ {% else %}
+ You can support the implementation of your favorite feature on the
+ <a href="http://wishlist.ipfire.org/">IPFire wishlist</a>!
+ {% end %}
+ </p>
+ <br class="separator">
+
+ {% module WishlistItems(wishlist_items) %}
+ </div>
+ </div>
+ {% end %}
</div>
--- /dev/null
+<table class="table-wishlist-widget">
+ {% for item in wishlist_items %}
+ <tr>
+ <td>
+ {% if item.is_new() %}
+ <span class="label label-success pull-right">{{ _("NEW") }}</span>
+ {% elif item.remaining_days and item.remaining_days <= 10 %}
+ <span class="pull-right">
+ {{ _("one day left", "%(num)s days left", item.remaining_days) % { "num" : item.remaining_days } }}
+ </span>
+ {% else %}
+ <span class="pull-right">
+ {{ _("%d%% funded") % item.percentage }}
+ </span>
+ {% end %}
+
+ <a href="http://wishlist.ipfire.org/wish/{{ item.slug }}" target="_blank">{{ item.title }}</a>
+
+ <br class="separator-small">
+
+ <div class="progress progress-small">
+ <div class="progress-bar progress-{{ item.progressbar_colour }}" style="width: {{ "%.2f%%" % item.percentage_bar }};"></div>
+ </div>
+ </td>
+ </tr>
+ {% end %}
+</table>
"TrackerPeerList" : TrackerPeerListModule,
"Wish" : WishModule,
"Wishlist" : WishlistModule,
+ "WishlistItems" : WishlistItemsModule,
},
xsrf_cookies = True,
)
(r"/support", tornado.web.RedirectHandler, { "url" : "/getinvolved" }),
(r"/features/.*", tornado.web.RedirectHandler, { "url" : "/features" }),
- (r"/donate", tornado.web.RedirectHandler, { "url" : "/donation" }),
+ # Donate
+ (r"/donate", DonateHandler),
+ (r"/donation", tornado.web.RedirectHandler, { "url" : "/donate" }),
# RSS feed
(r"/news.rss", RSSNewsHandler),
] + static_handlers)
# wishlist.ipfire.org
- self.add_handlers(r"wishlist\.ipfire\.org", [
+ self.add_handlers(r"wishlist(\.dev)?\.ipfire\.org", [
(r"/", WishlistIndexHandler),
(r"/closed", WishlistClosedHandler),
(r"/wish/(.*)/donate", WishDonateHandler),
mirrors = self.mirrors.get_for_location(peer)
self.render("geoip/index.html", addr=addr, peer=peer, mirrors=mirrors)
+
+
+class DonateHandler(BaseHandler):
+ def get(self):
+ # Interesting items from the wishlist.
+ wishlist_items = self.wishlist.get_hot_wishes()
+
+ self.render("donate.html", wishlist_items=wishlist_items)
def planet(self):
return self.handler.planet
+ @property
+ def wishlist(self):
+ return self.handler.wishlist
+
class AdvertisementModule(UIModule):
def render(self, where):
wish=wish, short=short, progress_bar=progress_bar)
+class WishlistItemsModule(UIModule):
+ def render(self, wishlist_items):
+ return self.render_string("modules/wishlist-items.html",
+ wishlist_items=wishlist_items)
+
+
class DonationBoxModule(UIModule):
- def render(self, reason_for_transfer=None):
+ def render(self, reason_for_transfer=None, show_wishlist_items=False):
if reason_for_transfer:
reason_for_transfer = "IPFire.org - %s" % reason_for_transfer
+ # Interesting items from the wishlist.
+ wishlist_items = []
+ if show_wishlist_items:
+ wishlist_items = self.wishlist.get_hot_wishes()
+
return self.render_string("modules/donation-box.html",
- reason_for_transfer=reason_for_transfer)
+ reason_for_transfer=reason_for_transfer, wishlist_items=wishlist_items)