margin-bottom: 100px;
}
+.progress-small {
+ margin-top: 6px;
+ height: 6px;
+}
+
@media (min-width: 768px) and (max-width: 979px) {
body {
padding-top: 0;
.well-white {
background-color: white;
}
+
+.table-wishlist-widget {
+ width: 100%;
+}
+
+.table-wishlist-widget td.progress-bar {
+ width: 40%;
+}
<hr>
+ {% if wishlist_items %}
+ <h4>
+ <a href="http://wishlist.ipfire.org">{{ _("IPFire Wishlist") }}</a>
+ <small>{{ _("The IPFire Crowdfunding Platform") }}</small>
+ </h4>
+
+ <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 <= 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="bar {{ item.progressbar_colour }}" style="width: {{ "%.2f%%" % item.percentage_bar }};"></div>
+ </div>
+ </td>
+ </tr>
+ {% end %}
+ </table>
+
+ <hr>
+ {% end %}
+
<div class="row-fluid">
<div class="span10">
<a href="/donate"><strong>{{ _("Please support us with your donation!") }}</strong></a>
</div>
</div>
</div>
+ </div>
+ </div>
+ <br class="separator">
+
+ <div class="row">
+ <div class="span8 offset2">
<div class="well well-white">
<h4>
{{ _("IPFire Hardware Appliances & Consulting") }} <small>{{ _("by Lightning Wire Labs") }}</small>
</h4>
- <br>
-
- {% if lang == "de" %}
- <p>
- Lightning Wire Labs bietet mit IPFire vorinstallierte Hardware-Appliances an.
- Dazu bieten sie professionellen Service & Support durch qualifizierte Consultants.
- </p>
- {% else %}
- <p>
- Lightning Wire Labs offers hardware appliances that come pre-installed
- with the latest version of IPFire.
- They also provide professional services & support through their certified consultants.
- </p>
- {% end %}
+ <div class="row-fluid">
+ <div class="span6">
+ {% if lang == "de" %}
+ <p>
+ Lightning Wire Labs bietet mit IPFire vorinstallierte Hardware-Appliances an.
+ Dazu bieten sie professionellen Service & Support durch qualifizierte Consultants.
+ </p>
+ {% else %}
+ <p>
+ Lightning Wire Labs offers hardware appliances that come pre-installed
+ with the latest version of IPFire.
+ They also provide professional services & support through their certified consultants.
+ </p>
+ {% end %}
+ </div>
- <hr>
+ <div class="span6 ac">
+ <a href="http://www.lightningwirelabs.com/products/ipfire/appliances" target="_blank">
+ <img src="{{ static_url("images/LWL/appliance-eco.jpg") }}" alt="Appliance Eco">
+ </a>
+ </div>
+ </div>
<div class="ac">
<a href="http://www.lightningwirelabs.com/products/ipfire/appliances" target="_blank">
<img src="{{ static_url("images/LWL/appliance-pro.jpg") }}" alt="Appliance Professional">
</a>
- <br>
- <a href="http://www.lightningwirelabs.com/products/ipfire/appliances" target="_blank">
- <img src="{{ static_url("images/LWL/appliance-eco.jpg") }}" alt="Appliance Eco">
- </a>
</div>
<hr>
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-07-22 10:42+0200\n"
-"PO-Revision-Date: 2013-02-19 12:38+0100\n"
+"POT-Creation-Date: 2013-07-22 11:43+0200\n"
+"PO-Revision-Date: 2013-07-22 11:44+0100\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Poedit 1.5.4\n"
#: webapp/handlers_news.py:43 webapp/ui_modules.py:76
msgid "Unknown author"
msgid "%s to %s"
msgstr "%s nach %s"
-#: webapp/backend/wishlist.py:153
+#: webapp/backend/wishlist.py:187
msgid "Checkout this crowdfunding wish from #ipfire:"
msgstr ""
msgid "Newer"
msgstr "Neuer"
-#: templates/wishlist/base.html:6
+#: templates/wishlist/base.html:6 templates/index.html:175
msgid "IPFire Wishlist"
msgstr "IPFire Wunschliste"
msgid "What's new?"
msgstr "Neuigkeiten"
-#: templates/index.html:175
+#: templates/index.html:176
+msgid "The IPFire Crowdfunding Platform"
+msgstr "Die IPFire Crowdfunding-Plattform"
+
+#: templates/index.html:184
+msgid "NEW"
+msgstr "NEU"
+
+#: templates/index.html:187
+#, python-format
+msgid "one day left"
+msgid_plural "%(num)s days left"
+msgstr[0] "noch ein Tag"
+msgstr[1] "noch %(num)s Tage"
+
+#: templates/index.html:191
+#, python-format
+msgid "%d%% funded"
+msgstr "%d%% gesammelt"
+
+#: templates/index.html:212
msgid "Please support us with your donation!"
msgstr "Unterstütze dieses Projekt mit deiner Spende!"
-#: templates/index.html:189
+#: templates/index.html:232
msgid "IPFire Hardware Appliances & Consulting"
msgstr "IPFire Hardware Appliances & Consulting"
-#: templates/index.html:189
+#: templates/index.html:232
msgid "by Lightning Wire Labs"
msgstr "von Lightning Wire Labs"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-07-22 10:42+0200\n"
+"POT-Creation-Date: 2013-07-22 11:43+0200\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 "%s to %s"
msgstr ""
-#: webapp/backend/wishlist.py:153
+#: webapp/backend/wishlist.py:187
msgid "Checkout this crowdfunding wish from #ipfire:"
msgstr ""
msgid "Newer"
msgstr ""
-#: templates/wishlist/base.html:6
+#: templates/wishlist/base.html:6 templates/index.html:175
msgid "IPFire Wishlist"
msgstr ""
msgid "What's new?"
msgstr ""
-#: templates/index.html:175
+#: templates/index.html:176
+msgid "The IPFire Crowdfunding Platform"
+msgstr ""
+
+#: templates/index.html:184
+msgid "NEW"
+msgstr ""
+
+#: templates/index.html:187
+#, python-format
+msgid "one day left"
+msgid_plural "%(num)s days left"
+msgstr[0] ""
+msgstr[1] ""
+
+#: templates/index.html:191
+#, python-format
+msgid "%d%% funded"
+msgstr ""
+
+#: templates/index.html:212
msgid "Please support us with your donation!"
msgstr ""
-#: templates/index.html:189
+#: templates/index.html:232
msgid "IPFire Hardware Appliances & Consulting"
msgstr ""
-#: templates/index.html:189
+#: templates/index.html:232
msgid "by Lightning Wire Labs"
msgstr ""
return self.get_all_by_query(query, *args)
+ def get_hot_wishes(self, limit=3):
+ query = "SELECT * FROM wishlist \
+ WHERE status = %s AND DATE(NOW()) BETWEEN date_start AND date_end AND ( \
+ ((UNIX_TIMESTAMP() - UNIX_TIMESTAMP(date_start)) <= 864000) \
+ OR ((UNIX_TIMESTAMP(date_end) - UNIX_TIMESTAMP()) <= 1209600) \
+ OR ((donated / goal) >= 0.9) \
+ OR (goal >= 3000) \
+ ) ORDER BY prio ASC, date_end ASC LIMIT %s"
+
+ return self.get_all_by_query(query, "running", limit)
+
class Wish(object):
def __init__(self, wishlist, id, data=None):
self.__data = data
+ def __repr__(self):
+ return "<%s %s>" % (self.__class__.__name__, self.title)
+
def __cmp__(self, other):
return cmp(self.date_end, other.date_end)
def title(self):
return self.data.title
+ @property
+ def title_short(self):
+ if len(self.title) > 30:
+ return "%s..." % self.title[:30]
+
+ return self.title
+
@property
def slug(self):
return self.data.slug
return self.percentage
+ @property
+ def progressbar_colour(self):
+ if self.is_new():
+ return "bar-success"
+
+ if self.percentage >= 90:
+ return "bar-danger"
+
+ return "bar-warning"
+
@property
def status(self):
if self.data.status == "running" and not self.running:
remaining = self.date_end - today
return remaining.days
+ def is_new(self):
+ return self.running_days <= 10
+
def get_tweet(self, locale):
_ = locale.translate
# Get the latest release.
latest_release = self.releases.get_latest()
+ # Interesting items from the wishlist.
+ wishlist_items = self.wishlist.get_hot_wishes()
+
return self.render("index.html", latest_news=latest_news,
- planet_posts=planet_posts, latest_release=latest_release)
+ planet_posts=planet_posts, latest_release=latest_release,
+ wishlist_items=wishlist_items)
class StaticHandler(BaseHandler):