changeset 25:1ccb542efa7e

Tweak the transparent pngs and backgrounds to finally work in all browsers
author Radomir Dopieralski <devel@sheep.art.pl>
date Thu, 05 Jun 2008 17:53:11 +0200
parents 10db1574d3d2
children 85107a8e502b
files mfact.py mfact/css/screen.css
diffstat 2 files changed, 65 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/mfact.py	Thu Jun 05 17:06:19 2008 +0200
+++ b/mfact.py	Thu Jun 05 17:53:11 2008 +0200
@@ -222,6 +222,65 @@
 </ul>"""
         return html
 
+    def html_stylesheets(self, d):
+        """ Assemble html head stylesheet links
+
+        @param d: parameter dictionary
+        @rtype: string
+        @return: stylesheets links
+        """
+        link = '<link rel="stylesheet" type="text/css" charset="%s" media="%s" href="%s">'
+
+        # Check mode
+        if d.get('print_mode'):
+            media = d.get('media', 'print')
+            stylesheets = getattr(self, 'stylesheets_' + media)
+        else:
+            stylesheets = self.stylesheets
+        usercss = self.request.user.valid and self.request.user.css_url
+
+        # Create stylesheets links
+        html = []
+        prefix = self.cfg.url_prefix_static
+        csshref = '%s/%s/css' % (prefix, self.name)
+        for media, basename in stylesheets:
+            href = '%s/%s.css' % (csshref, basename)
+            html.append(link % (self.stylesheetsCharset, media, href))
+
+            # Don't add user css url if it matches one of ours
+            if usercss and usercss == href:
+                usercss = None
+
+        # admin configurable additional css (farm or wiki level)
+        for media, csshref in self.request.cfg.stylesheets:
+            html.append(link % (self.stylesheetsCharset, media, csshref))
+
+        csshref = '%s/%s/css/msie.css' % (prefix, self.name)
+        html.append("""
+<!-- css only for MSIE browsers -->
+<!--[if IE 5]>
+   %s
+<![endif]-->
+""" % link % (self.stylesheetsCharset, 'all', csshref))
+        html.append("""
+<!-- css only for MSIE browsers -->
+<!--[if IE 5.5]>
+   %s
+<![endif]-->
+""" % link % (self.stylesheetsCharset, 'all', csshref))
+        html.append("""
+<!-- css only for MSIE browsers -->
+<!--[if IE 6]>
+   %s
+<![endif]-->
+""" % link % (self.stylesheetsCharset, 'all', csshref))
+
+        # Add user css url (assuming that user css uses same charset)
+        if usercss and usercss.lower() != "none":
+            html.append(link % (self.stylesheetsCharset, 'all', usercss))
+
+        return '\n'.join(html)
+
 def execute(request):
     """
     Generate and return a theme object
--- a/mfact/css/screen.css	Thu Jun 05 17:06:19 2008 +0200
+++ b/mfact/css/screen.css	Thu Jun 05 17:53:11 2008 +0200
@@ -2,7 +2,7 @@
 /** General layout **/
 
 html {
-    background: #fff url(../background_pattern.gif);
+    background: #fff url(../background_pattern.gif) 50% 0;
 }
 
 body {
@@ -14,7 +14,7 @@
 }
 
 div.outer-wrap {
-    background: url(../background_gradient.gif) repeat-x;
+    background: url(../background_gradient.gif) repeat-x 50% 0;
 }
 
 div.inner-wrap {
@@ -22,15 +22,9 @@
     margin: 0 auto;
 }
 
-#header {
-    position: relative;
-}
-
 form#searchform {
-    margin: 0;
-    position: absolute;
-    bottom: 64px;
-    right: 1.5em;
+    margin: 0.5em 1.5em;
+    float: right;
 }
 
 form#searchform input {
@@ -55,7 +49,7 @@
     padding: 14px 1.25em 0 1.25em;
     margin: 0;
     height: 40px;
-    background: url(../menu_bar.png) no-repeat;
+    background: url(/static/mfact/menu_bar.png) no-repeat;
 }
 ul#navibar li {
     display: inline;
@@ -76,7 +70,7 @@
 }
 
 div#content {
-    padding: 0.5em 32px;
+    padding: 0.5em 32px 1.5em 32px;
     background: url(../content_background.png) repeat-y;
     min-height: 360px;
 }