From 55b162d6f1b307d6c983f0e4922d194f58735bb2 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 19 Feb 2013 12:11:05 +0100 Subject: [PATCH] Update planet to use the new layout. --- static/css/style.css | 12 +++ templates/modules/planet-entry.html | 32 +++---- templates/planet-main.html | 92 ------------------- templates/planet-user.html | 47 ---------- templates/planet/base.html | 10 ++ templates/planet/index.html | 40 ++++++++ .../posting.html} | 6 +- templates/planet/user.html | 53 +++++++++++ templates/rss.xml | 2 +- webapp/handlers_planet.py | 7 +- 10 files changed, 136 insertions(+), 165 deletions(-) delete mode 100644 templates/planet-main.html delete mode 100644 templates/planet-user.html create mode 100644 templates/planet/base.html create mode 100644 templates/planet/index.html rename templates/{planet-posting.html => planet/posting.html} (91%) create mode 100644 templates/planet/user.html diff --git a/static/css/style.css b/static/css/style.css index 883e6907..69cde609 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -15,6 +15,18 @@ body { text-align: center; } +.clear { + clear: both; +} + +.separator { + margin: 40px 0 39px; +} + +.img-padding { + padding: 10px; +} + table.table-fireinfo td.bar { width: 70%; } diff --git a/templates/modules/planet-entry.html b/templates/modules/planet-entry.html index 6cd520f7..d71d7ee7 100644 --- a/templates/modules/planet-entry.html +++ b/templates/modules/planet-entry.html @@ -1,22 +1,18 @@ -
-
- {% if show_avatar %} - - {{ entry.author.cn }} - - {% end %} +{% if show_avatar %} + + {{ entry.author.cn }} + +{% end %} -

- {{ entry.title }} -

+

+ {{ entry.title }} +

- {% raw entry.text %} +{% raw entry.text %} -

- {{ _("Posted by") }} {{ entry.author.cn }} - {{ _("on") }} {{ locale.format_date(entry.published, shorter=True) }} -

-
-
+

+ {{ _("Posted by") }} {{ entry.author.cn }} + {{ _("on") }} {{ locale.format_date(entry.published, shorter=True) }} +

-
+
diff --git a/templates/planet-main.html b/templates/planet-main.html deleted file mode 100644 index c124b6a9..00000000 --- a/templates/planet-main.html +++ /dev/null @@ -1,92 +0,0 @@ -{% extends "base-2.html" %} - -{% block title %}{{ _("IPFire Planet") }}{% end block %} - -{% block bodyA %} - - -
-
- {% if lang == "de" %} -

- Der IPFire Planet ist eine Plattform für alle - Personen, die in das Projekt involviert sind um mit der - Community in Kontakt zu bleiben und sie über neue Entwicklungen - zu informieren. -

-

- Um den Aufwand für die Entwickler in Maßen zu halten sind - alle Einträge nur auf Englisch verfügbar. -

- {% else %} -

- The IPFire Planet is a place for the people - who are involved in the project to tell the community about - new progress in the development or make some minor announcements. -

- {% end %} - -
-
-
- - {% for entry in entries %} - {% module PlanetEntry(entry) %} - {% end %} - -
-
- -
-
-{% end block %} - -{% block bodyB %} -
-
-

{{ _("Subscribe") }}

- - {% if lang == "de" %} - XXX GERMAN TEXT MISSING - {% else %} -

- Click on the button below to subscribe to the IPFire planet feed. - Add it to you favourite news reader and you will see new - posts immediately. -

- {% end %} - -

- - {{ _("Feed") }} - -

- -
-
-
- -
-
-

{{ _("People on the IPFire planet") }}

- -
-
-{% end %} diff --git a/templates/planet-user.html b/templates/planet-user.html deleted file mode 100644 index 1ba3f71d..00000000 --- a/templates/planet-user.html +++ /dev/null @@ -1,47 +0,0 @@ -{% extends "base-2.html" %} - -{% block title %}{{ _("IPFire Planet") }} - {{ author.cn }}{% end block %} - -{% block bodyA %} - - - {% if entries %} - {% for entry in entries %} - {% module PlanetEntry(entry, show_avatar=False) %} - {% end %} - -
-
- -
-
- {% else %} -

{{ _("%s did not write any posts, yet.") % author.cn }}

- {% end %} -{% end block %} - -{% block bodyB %} -
- {{ author.cn }} -
- - - {{ escape(author.cn) }} - -
- - {{ _("Mail") }} - -
-{% end block %} diff --git a/templates/planet/base.html b/templates/planet/base.html new file mode 100644 index 00000000..be96d4ff --- /dev/null +++ b/templates/planet/base.html @@ -0,0 +1,10 @@ +{% extends "../base.html" %} + +{% block header %} +
+
+

{{ _("IPFire Planet") }}

+

{{ _("The official blog of the IPFire team") }}

+
+
+{% end header %} diff --git a/templates/planet/index.html b/templates/planet/index.html new file mode 100644 index 00000000..94dcabfb --- /dev/null +++ b/templates/planet/index.html @@ -0,0 +1,40 @@ +{% extends "base.html" %} + +{% block title %}{{ _("IPFire Planet") }}{% end block %} + +{% block body %} +
+

+ The IPFire Planet is a place for the people + who are involved in the project to tell the community about + new progress in the development or make some minor announcements. +

+ +

+ + Subscribe to our RSS feed to stay up to date. + +

+
+ +
+ + {% for entry in entries %} + {% module PlanetEntry(entry) %} + {% end %} + +
+
+ +
+
+{% end block %} diff --git a/templates/planet-posting.html b/templates/planet/posting.html similarity index 91% rename from templates/planet-posting.html rename to templates/planet/posting.html index 4c089500..c4e97242 100644 --- a/templates/planet-posting.html +++ b/templates/planet/posting.html @@ -1,12 +1,12 @@ -{% extends "planet-user.html" %} +{% extends "user.html" %} {% block title %}{{ _("IPFire Planet") }} - {{ entry.title }}{% end block %} {% block bodyA %}
diff --git a/templates/planet/user.html b/templates/planet/user.html new file mode 100644 index 00000000..82387c11 --- /dev/null +++ b/templates/planet/user.html @@ -0,0 +1,53 @@ +{% extends "base.html" %} + +{% block title %}{{ _("IPFire Planet") }} - {{ author.cn }}{% end block %} + +{% block body %} +
+
+ {% block bodyA %} + + + {% if entries %} + {% for entry in entries %} + {% module PlanetEntry(entry, show_avatar=False) %} + {% end %} + +
+
+ +
+
+ {% else %} +

{{ _("%s did not write any posts, yet.") % author.cn }}

+ {% end %} + {% end block %} +
+ + +
+{% end block %} diff --git a/templates/rss.xml b/templates/rss.xml index 67115358..1d6ee4b3 100644 --- a/templates/rss.xml +++ b/templates/rss.xml @@ -16,7 +16,7 @@ {{ item.date.strftime("%a, %d %b %Y %H:%M:%S +0200") }} diff --git a/webapp/handlers_planet.py b/webapp/handlers_planet.py index dcd82ec2..f3e27036 100644 --- a/webapp/handlers_planet.py +++ b/webapp/handlers_planet.py @@ -27,8 +27,7 @@ class PlanetMainHandler(PlanetBaseHandler): entries = self.planet.get_entries(offset=offset, limit=limit) - self.render("planet-main.html", entries=entries, - authors=self.planet.get_authors(), + self.render("planet/index.html", entries=entries, offset=offset + limit, limit=limit) @@ -44,7 +43,7 @@ class PlanetUserHandler(PlanetBaseHandler): entries = self.planet.get_entries_by_author(author.uid, offset=offset, limit=limit) - self.render("planet-user.html", author=author, entries=entries, + self.render("planet/user.html", author=author, entries=entries, offset=offset + limit, limit=limit, rss_url="/user/%s/rss" % author.uid) @@ -55,5 +54,5 @@ class PlanetPostingHandler(PlanetBaseHandler): if not entry: raise tornado.web.HTTPError(404) - self.render("planet-posting.html", + self.render("planet/posting.html", author=entry.author, entry=entry) -- 2.47.3