From 64d26cbfbbbe6467bb565fb0953c88188f7c0eb8 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 3 Dec 2009 10:40:42 +0100 Subject: [PATCH] template: Created base layout and substitute only required areas. --- application/handlers.py | 2 +- templates/{template.html => base.html} | 36 ++++++---- templates/login.html | 97 +++++++------------------- templates/logout.html | 66 +++--------------- 4 files changed, 55 insertions(+), 146 deletions(-) rename templates/{template.html => base.html} (64%) diff --git a/application/handlers.py b/application/handlers.py index b808eab..393ad0c 100644 --- a/application/handlers.py +++ b/application/handlers.py @@ -26,5 +26,5 @@ class MainHandler(BaseHandler): class HomeHandler(BaseHandler): def get(self): - self.render("template.html", title="Testsite", slogan="Security now!", + self.render("base.html", title="Testsite", slogan="Security now!", footer=self.footer(), user=self.current_user) diff --git a/templates/template.html b/templates/base.html similarity index 64% rename from templates/template.html rename to templates/base.html index 86bab6f..40f5741 100644 --- a/templates/template.html +++ b/templates/base.html @@ -4,7 +4,7 @@ - {{ _("IPFire Webconsole") }} - {{ title }} + {% block title %}{{ _("IPFire Webconsole") }} - {{ title }}{% end block %} @@ -17,24 +17,26 @@
- -
- {{ _("Logged in as:") }} {{ user }} - {{ _("Logout") }} -
+ {% block menu %} + +
+ {{ _("Logged in as:") }} {{ user }} + {{ _("Logout") }} +
+ {% end block %}

{{ _("IPFire Webconsole") }}

-

{{ slogan }}

+

{% block slogan %}{{ slogan }}{% end block %}

@@ -52,7 +54,11 @@
- + {% block main %} +
+ +
+ {% end block %}
diff --git a/templates/login.html b/templates/login.html index a341946..4711e41 100644 --- a/templates/login.html +++ b/templates/login.html @@ -1,76 +1,27 @@ - - - - - - - {{ _("Login") }} - +{% extends "base.html" %} - -
-
- -
-
-
-

{{ _("IPFire Webconsole") }}

-
-
-

{{ _("Please login") }}

-
-
-
+{% block title %}{{ _("Login") }}{% end block %} +{% block slogan %}{{ _("Please login") }}{% end block %} -
-
-
-
-
-
-
-
-
+{% block menu %}{% end block %} -
-
-
-
- {{ xsrf_form_html() }} - - - - - - - - - - - - -
{{ _("User") }}
{{ _("Password") }}
- -
-
-
-
-
-
- -
-
- -
-
-
-
-
- - +{% block main %} +
+ {{ xsrf_form_html() }} + + + + + + + + + + + + +
{{ _("User") }}
{{ _("Password") }}
+ +
+
+{% end block %} diff --git a/templates/logout.html b/templates/logout.html index d70689f..04d9e00 100644 --- a/templates/logout.html +++ b/templates/logout.html @@ -1,60 +1,12 @@ - - - - - - - {{ _("Logout") }} - +{% extends "base.html" %} - -
-
- -
-
-
-

{{ _("IPFire Webconsole") }}

-
-
-

{{ _("Logout") }}

-
-
-
+{% block title %}{{ _("Logout") }}{% end block %} +{% block slogan %}{{ _("Logout") }}{% end block %} -
-
-
-
-
-
-
-
-
+{% block menu %}{% end block %} -
-
-
-

{{ _("You have been sucessfully logged out.") }}

-
-

{{ _("Relogin" ) }}

-
-
-
- -
-
- -
-
-
-
-
- - +{% block main %} +

{{ _("You have been sucessfully logged out.") }}

+
+

{{ _("Relogin" ) }}

+{% end block %} -- 2.39.2