From: Michael Tremer Date: Sat, 29 Mar 2014 18:35:51 +0000 (+0100) Subject: Show latest unstable release on index page. X-Git-Url: http://git.ipfire.org/?p=people%2Fshoehn%2Fipfire.org.git;a=commitdiff_plain;h=0aab96e0801de6a12df78d86d859a79fc7714f79 Show latest unstable release on index page. --- diff --git a/templates/index.html b/templates/index.html index 95a678b..0fdbb20 100644 --- a/templates/index.html +++ b/templates/index.html @@ -131,6 +131,15 @@

{{ _("This is the latest release from %s.") % locale.format_date(latest_release.date, relative=False, shorter=True) }}

+ + {% if latest_release_unstable %} +
+ +

+ {{ latest_release_unstable.name }} +

+ {{ _("Testing release") }} + {% end %} {% end %} diff --git a/translations/de_DE/LC_MESSAGES/webapp.po b/translations/de_DE/LC_MESSAGES/webapp.po index fc01eba..6daeef6 100644 --- a/translations/de_DE/LC_MESSAGES/webapp.po +++ b/translations/de_DE/LC_MESSAGES/webapp.po @@ -7,10 +7,11 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-26 21:34+0100\n" +"POT-Creation-Date: 2014-03-29 19:34+0100\n" "PO-Revision-Date: 2014-03-26 21:38+0100\n" "Last-Translator: Michael Tremer \n" "Language-Team: LANGUAGE \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -1631,7 +1632,7 @@ msgstr "Informiere dich" #: templates/news.html:61 templates/planet/search.html:3 #: templates/planet/year.html:3 templates/planet/user.html:3 #: templates/planet/posting.html:3 templates/planet/index.html:3 -#: templates/planet/base.html:6 templates/index.html:159 +#: templates/planet/base.html:6 templates/index.html:168 msgid "IPFire Planet" msgstr "IPFire Planet" @@ -2025,7 +2026,7 @@ msgstr "Spenden" #: templates/static/getinvolved.html:120 templates/static/donation.html:3 #: templates/static/donation.html:8 templates/modules/menu.html:47 -#: templates/wishlist/donate.html:3 templates/wishlist/modules/wish.html:30 +#: templates/wishlist/donate.html:3 templates/wishlist/modules/wish.html:31 #: templates/download-splash.html:57 msgid "Donate" msgstr "Spenden" @@ -2293,26 +2294,9 @@ msgid "BIC-/SWIFT-Code" msgstr "BIC-/SWIFT-Code" #: templates/modules/donation-box.html:85 -#: templates/modules/donation-box.html:100 msgid "Reason for transfer" msgstr "Verwendungszweck" -#: templates/modules/donation-box.html:92 -msgid "bank transfer within Germany" -msgstr "Überweisung innerhalb Deutschlands" - -#: templates/modules/donation-box.html:95 -msgid "Bank account owner" -msgstr "Kontoinhaber" - -#: templates/modules/donation-box.html:96 -msgid "Bank account number" -msgstr "Kontonummer" - -#: templates/modules/donation-box.html:97 -msgid "Bank code" -msgstr "BLZ" - #: templates/modules/planet-entry.html:14 templates/planet/posting.html:28 msgid "Posted by" msgstr "Erstellt von" @@ -2510,47 +2494,47 @@ msgstr "Neuer" msgid "Terms & Conditions" msgstr "Allgemeine Bedingungen" -#: templates/wishlist/modules/wish.html:5 +#: templates/wishlist/modules/wish.html:6 msgid "Only a few days left!" msgstr "Nur noch wenige Tage!" -#: templates/wishlist/modules/wish.html:40 +#: templates/wishlist/modules/wish.html:41 msgid "funded" msgstr "gesammelt" -#: templates/wishlist/modules/wish.html:44 -#: templates/wishlist/modules/wish.html:54 +#: templates/wishlist/modules/wish.html:45 +#: templates/wishlist/modules/wish.html:55 #, python-format msgid "%s €" msgstr "%s €" -#: templates/wishlist/modules/wish.html:45 +#: templates/wishlist/modules/wish.html:46 msgid "donated" msgstr "gespendet" -#: templates/wishlist/modules/wish.html:52 +#: templates/wishlist/modules/wish.html:53 msgid "day to go" msgid_plural "days to go" msgstr[0] "Tag übrig" msgstr[1] "Tage übrig" -#: templates/wishlist/modules/wish.html:55 +#: templates/wishlist/modules/wish.html:56 msgid "to go" msgstr "noch" -#: templates/wishlist/modules/wish.html:58 +#: templates/wishlist/modules/wish.html:59 msgid "In progress" msgstr "In Entwicklung" -#: templates/wishlist/modules/wish.html:60 +#: templates/wishlist/modules/wish.html:61 msgid "Finished" msgstr "Beendet" -#: templates/wishlist/modules/wish.html:62 +#: templates/wishlist/modules/wish.html:63 msgid "Funding ended" msgstr "Sammlung beendet" -#: templates/wishlist/modules/wish.html:72 +#: templates/wishlist/modules/wish.html:73 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!" @@ -2577,7 +2561,7 @@ msgstr "Sammlung endet: %s" msgid "This funding runs until the goal is reached." msgstr "Dieses Funding läuft, bis das Ziel erreicht ist." -#: templates/wishlist/base.html:6 templates/index.html:180 +#: templates/wishlist/base.html:6 templates/index.html:189 msgid "IPFire Wishlist" msgstr "IPFire Wunschliste" @@ -2602,39 +2586,43 @@ msgstr "Mehr erfahren" msgid "This is the latest release from %s." msgstr "Dies ist das neueste Release vom %s." -#: templates/index.html:139 +#: templates/index.html:141 +msgid "Testing release" +msgstr "Test-Release" + +#: templates/index.html:148 msgid "What's new?" msgstr "Neuigkeiten" -#: templates/index.html:181 +#: templates/index.html:190 msgid "The IPFire Crowdfunding Platform" msgstr "Die IPFire Crowdfunding-Plattform" -#: templates/index.html:189 +#: templates/index.html:198 msgid "NEW" msgstr "NEU" -#: templates/index.html:192 +#: templates/index.html:201 #, 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:196 +#: templates/index.html:205 #, python-format msgid "%d%% funded" msgstr "%d%% gesammelt" -#: templates/index.html:220 +#: templates/index.html:229 msgid "Please support us with your donation!" msgstr "Unterstütze dieses Projekt mit deiner Spende!" -#: templates/index.html:233 +#: templates/index.html:242 msgid "IPFire Hardware Appliances & Consulting" msgstr "IPFire Hardware Appliances & Consulting" -#: templates/index.html:233 +#: templates/index.html:242 msgid "by Lightning Wire Labs" msgstr "von Lightning Wire Labs" @@ -2654,7 +2642,7 @@ msgstr "Dateiliste" msgid "No title given" msgstr "Kein Titel" -#: templates/base.html:89 +#: templates/base.html:76 msgid "IPFire is free software" msgstr "IPFire ist freie Software" @@ -2804,6 +2792,18 @@ msgstr "%(weekday)s, %(day)s. %(month_name)s" msgid "%(commas)s and %(last)s" msgstr "%(commas)s und %(last)s" +#~ msgid "bank transfer within Germany" +#~ msgstr "Überweisung innerhalb Deutschlands" + +#~ msgid "Bank account owner" +#~ msgstr "Kontoinhaber" + +#~ msgid "Bank account number" +#~ msgstr "Kontonummer" + +#~ msgid "Bank code" +#~ msgstr "BLZ" + #~ msgid "Choose an architecture:" #~ msgstr "Architektur auswählen:" diff --git a/translations/webapp.pot b/translations/webapp.pot index 6e3967f..e178a8b 100644 --- a/translations/webapp.pot +++ b/translations/webapp.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-26 21:34+0100\n" +"POT-Creation-Date: 2014-03-29 19:34+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1624,7 +1624,7 @@ msgstr "" #: templates/news.html:61 templates/planet/search.html:3 #: templates/planet/year.html:3 templates/planet/user.html:3 #: templates/planet/posting.html:3 templates/planet/index.html:3 -#: templates/planet/base.html:6 templates/index.html:159 +#: templates/planet/base.html:6 templates/index.html:168 msgid "IPFire Planet" msgstr "" @@ -2015,7 +2015,7 @@ msgstr "" #: templates/static/getinvolved.html:120 templates/static/donation.html:3 #: templates/static/donation.html:8 templates/modules/menu.html:47 -#: templates/wishlist/donate.html:3 templates/wishlist/modules/wish.html:30 +#: templates/wishlist/donate.html:3 templates/wishlist/modules/wish.html:31 #: templates/download-splash.html:57 msgid "Donate" msgstr "" @@ -2283,26 +2283,9 @@ msgid "BIC-/SWIFT-Code" msgstr "" #: templates/modules/donation-box.html:85 -#: templates/modules/donation-box.html:100 msgid "Reason for transfer" msgstr "" -#: templates/modules/donation-box.html:92 -msgid "bank transfer within Germany" -msgstr "" - -#: templates/modules/donation-box.html:95 -msgid "Bank account owner" -msgstr "" - -#: templates/modules/donation-box.html:96 -msgid "Bank account number" -msgstr "" - -#: templates/modules/donation-box.html:97 -msgid "Bank code" -msgstr "" - #: templates/modules/planet-entry.html:14 templates/planet/posting.html:28 msgid "Posted by" msgstr "" @@ -2500,47 +2483,47 @@ msgstr "" msgid "Terms & Conditions" msgstr "" -#: templates/wishlist/modules/wish.html:5 +#: templates/wishlist/modules/wish.html:6 msgid "Only a few days left!" msgstr "" -#: templates/wishlist/modules/wish.html:40 +#: templates/wishlist/modules/wish.html:41 msgid "funded" msgstr "" -#: templates/wishlist/modules/wish.html:44 -#: templates/wishlist/modules/wish.html:54 +#: templates/wishlist/modules/wish.html:45 +#: templates/wishlist/modules/wish.html:55 #, python-format msgid "%s €" msgstr "" -#: templates/wishlist/modules/wish.html:45 +#: templates/wishlist/modules/wish.html:46 msgid "donated" msgstr "" -#: templates/wishlist/modules/wish.html:52 +#: templates/wishlist/modules/wish.html:53 msgid "day to go" msgid_plural "days to go" msgstr[0] "" msgstr[1] "" -#: templates/wishlist/modules/wish.html:55 +#: templates/wishlist/modules/wish.html:56 msgid "to go" msgstr "" -#: templates/wishlist/modules/wish.html:58 +#: templates/wishlist/modules/wish.html:59 msgid "In progress" msgstr "" -#: templates/wishlist/modules/wish.html:60 +#: templates/wishlist/modules/wish.html:61 msgid "Finished" msgstr "" -#: templates/wishlist/modules/wish.html:62 +#: templates/wishlist/modules/wish.html:63 msgid "Funding ended" msgstr "" -#: templates/wishlist/modules/wish.html:72 +#: templates/wishlist/modules/wish.html:73 msgid "Share this wish with your friends and help us promote it!" msgstr "" @@ -2566,7 +2549,7 @@ msgstr "" msgid "This funding runs until the goal is reached." msgstr "" -#: templates/wishlist/base.html:6 templates/index.html:180 +#: templates/wishlist/base.html:6 templates/index.html:189 msgid "IPFire Wishlist" msgstr "" @@ -2591,39 +2574,43 @@ msgstr "" msgid "This is the latest release from %s." msgstr "" -#: templates/index.html:139 +#: templates/index.html:141 +msgid "Testing release" +msgstr "" + +#: templates/index.html:148 msgid "What's new?" msgstr "" -#: templates/index.html:181 +#: templates/index.html:190 msgid "The IPFire Crowdfunding Platform" msgstr "" -#: templates/index.html:189 +#: templates/index.html:198 msgid "NEW" msgstr "" -#: templates/index.html:192 +#: templates/index.html:201 #, python-format msgid "one day left" msgid_plural "%(num)s days left" msgstr[0] "" msgstr[1] "" -#: templates/index.html:196 +#: templates/index.html:205 #, python-format msgid "%d%% funded" msgstr "" -#: templates/index.html:220 +#: templates/index.html:229 msgid "Please support us with your donation!" msgstr "" -#: templates/index.html:233 +#: templates/index.html:242 msgid "IPFire Hardware Appliances & Consulting" msgstr "" -#: templates/index.html:233 +#: templates/index.html:242 msgid "by Lightning Wire Labs" msgstr "" @@ -2643,7 +2630,7 @@ msgstr "" msgid "No title given" msgstr "" -#: templates/base.html:89 +#: templates/base.html:76 msgid "IPFire is free software" msgstr "" diff --git a/webapp/backend/releases.py b/webapp/backend/releases.py index 0ed55d8..3e5b242 100644 --- a/webapp/backend/releases.py +++ b/webapp/backend/releases.py @@ -395,6 +395,17 @@ class Releases(Object): if ret: return Release(self.backend, ret.id, data=ret) + def get_latest_unstable(self): + ret = self.db.get("SELECT * FROM releases r1 \ + WHERE r1.published IS NOT NULL AND r1.published <= NOW() \ + AND stable = %s AND NOT EXISTS ( \ + SELECT * FROM releases r2 WHERE r2.stable = %s AND \ + r2.published IS NOT NULL AND r2.published >= r1.published \ + ) ORDER BY r1.published DESC LIMIT 1", False, True) + + if ret: + return Release(self.backend, ret.id, data=ret) + def get_stable(self): query = self.db.query("SELECT * FROM releases \ WHERE published IS NOT NULL AND published <= NOW() AND stable = TRUE \ diff --git a/webapp/handlers.py b/webapp/handlers.py index 20c21ae..9537ace 100644 --- a/webapp/handlers.py +++ b/webapp/handlers.py @@ -64,12 +64,14 @@ class IndexHandler(BaseHandler): # Get the latest release. latest_release = self.releases.get_latest() + latest_release_unstable = self.releases.get_latest_unstable() # 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, + latest_release_unstable=latest_release_unstable, wishlist_items=wishlist_items)