changeset 409:35a43d0dc032

browser and server sides: display favicon
author souliane <souliane@mailoo.org>
date Mon, 17 Mar 2014 18:30:07 +0100
parents ee8ebfe23e16
children cb66dffdf9b2
files libervia_server/blog.py public/libervia.html public/sat_logo_16.png
diffstat 3 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libervia_server/blog.py	Mon Mar 17 16:33:05 2014 +0100
+++ b/libervia_server/blog.py	Mon Mar 17 18:30:07 2014 +0100
@@ -35,11 +35,12 @@
 
     ERROR_TEMPLATE = """
                 <html>
-                <head>
+                <head profile="http://www.w3.org/2005/10/profile">
+                    <link rel="icon" type="image/png" href="%(root)ssat_logo_16.png">
                     <title>MICROBLOG ERROR</title>
                 </head>
                 <body>
-                    <h1 style='text-align: center; color: red;'>%s</h1>
+                    <h1 style='text-align: center; color: red;'>%(message)s</h1>
                 </body>
                 </html>
                 """
@@ -52,13 +53,15 @@
 
     def render_GET(self, request):
         if not request.postpath:
-            return MicroBlog.ERROR_TEMPLATE % "You must indicate a nickname"
+            return MicroBlog.ERROR_TEMPLATE % {'root': '',
+                                               'message': "You must indicate a nickname"}
         else:
             prof_requested = request.postpath[0]
             #TODO: char check: only use alphanumerical chars + some extra(_,-,...) here
             prof_found = self.host.bridge.getProfileName(prof_requested)
             if not prof_found or prof_found == 'libervia':
-                return MicroBlog.ERROR_TEMPLATE % "Invalid nickname"
+                return MicroBlog.ERROR_TEMPLATE % {'root': '../' * len(request.postpath),
+                                                    'message': "Invalid nickname"}
             else:
                 def got_jid(pub_jid_s):
                     pub_jid = JID(pub_jid_s)
@@ -124,6 +127,7 @@
                 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
                 <link rel="alternate" type="application/atom+xml" href="%(base)s/atom.xml"/>
                 <link rel="stylesheet" type="text/css" href="%(root)scss/blog.css" />
+                <link rel="icon" type="image/png" href="%(root)ssat_logo_16.png">
                 <title>%(user)s's microblog</title>
             </head>
             <body>
@@ -197,5 +201,6 @@
         request.finish()
 
     def render_error_blog(self, error, request, profile):
-        request.write(MicroBlog.ERROR_TEMPLATE % "Can't access requested data")
+        request.write(MicroBlog.ERROR_TEMPLATE % {'root': '../' * len(request.postpath),
+                                                  'message': "Can't access requested data"})
         request.finish()
--- a/public/libervia.html	Mon Mar 17 16:33:05 2014 +0100
+++ b/public/libervia.html	Mon Mar 17 18:30:07 2014 +0100
@@ -17,10 +17,11 @@
 -->
 
 <html>
-<head>
+<head profile="http://www.w3.org/2005/10/profile">
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <meta name="pygwt:module" content="libervia">
 <link rel='stylesheet' href='libervia.css'>
+<link rel="icon" type="image/png" href="sat_logo_16.png">
 
 <title>Libervia</title>
 </head>
Binary file public/sat_logo_16.png has changed