[Treepkg-commits] r462 - in www: . htdocs htdocs/styles htdocs/templates

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Oct 21 17:26:38 CEST 2010


Author: teichmann
Date: 2010-10-21 17:26:37 +0200 (Thu, 21 Oct 2010)
New Revision: 462

Added:
   www/htdocs/
   www/htdocs/.htaccess
   www/htdocs/index.py
   www/htdocs/styles/
   www/htdocs/styles/default.css
   www/htdocs/templates/
   www/htdocs/templates/index.html
   www/rsync-htdocs.sh
Log:
Initial check in of the treepkh website 
http://treepkg.wald.intevation.org/
No real content, yet.


Added: www/htdocs/.htaccess
===================================================================
--- www/htdocs/.htaccess	2010-10-21 14:02:29 UTC (rev 461)
+++ www/htdocs/.htaccess	2010-10-21 15:26:37 UTC (rev 462)
@@ -0,0 +1,4 @@
+AddHandler mod_python .py
+DirectoryIndex index.py
+PythonHandler mod_python.publisher
+#PythonDebug On

Added: www/htdocs/index.py
===================================================================
--- www/htdocs/index.py	2010-10-21 14:02:29 UTC (rev 461)
+++ www/htdocs/index.py	2010-10-21 15:26:37 UTC (rev 462)
@@ -0,0 +1,61 @@
+# -*- coding: UTF-8 -*-
+#
+
+from mod_python import psp
+
+import re
+import urllib
+
+PROJECT = "Tree Packager"
+
+GROUP_DOMAIN = re.compile(r"([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_\.-]+)$")
+BACKGROUND   = re.compile(r'background="([^"]+)"')
+
+def __group_domain(hostname):
+    m = GROUP_DOMAIN.match(hostname)
+    return m and m.groups() or ("", "")
+
+def __fetch(req, url):
+    try:
+        f = urllib.urlopen(url)
+        try:
+            return f.read()
+        finally:
+            f.close()
+    except:
+        req.log_error("Cannot open url %s" % repr(url))
+        return ""
+
+def __rebase(contents, domain):
+    contents = contents \
+        .replace('href="/', 'href="http://%s/' % domain) \
+        .replace('src="/',  'src="http://%s/'  % domain)
+
+    return BACKGROUND.sub(
+        lambda m: 'style="background-image: url(http://%s/%s)"' % (domain, m.group(1)), 
+        contents)
+
+def index(req):
+    req.content_type = 'text/html;charset=utf-8'
+    template = psp.PSP(req, filename='templates/index.html')
+
+    group, domain = __group_domain(req.hostname)
+
+    project_summary = __rebase(__fetch(
+        req, "http://%s/export/projhtml.php?group_name=%s" % (domain, group)),
+        domain)
+
+    project_title = __fetch(
+        req, "http://%s/export/projtitl.php?group_name=%s" % (domain, group))
+
+    project_news = __rebase(__fetch(
+        req, "http://%s/export/projnews.php?group_name=%s" % (domain, group)),
+        domain)
+    
+    template.run({
+        'domain'         : domain,
+        'project_name'   : PROJECT,
+        'project_title'  : project_title,
+        'project_summary': project_summary,
+        'project_news'   : project_news
+    })

Added: www/htdocs/styles/default.css
===================================================================
--- www/htdocs/styles/default.css	2010-10-21 14:02:29 UTC (rev 461)
+++ www/htdocs/styles/default.css	2010-10-21 15:26:37 UTC (rev 462)
@@ -0,0 +1,32 @@
+body {
+    margin-top: 3;
+    margin-left: 3;
+    margin-right: 3;
+    margin-bottom: 3;
+    background: #01004e;
+}
+ol,ul,p,body,td,tr,th,form { font-family: verdana,arial,helvetica,sans-serif; font-size:small;
+    color: #333333; }
+
+h1 { font-size: x-large; font-family: verdana,arial,helvetica,sans-serif; }
+h2 { font-size: large; font-family: verdana,arial,helvetica,sans-serif; }
+h3 { font-size: medium; font-family: verdana,arial,helvetica,sans-serif; }
+h4 { font-size: small; font-family: verdana,arial,helvetica,sans-serif; }
+h5 { font-size: x-small; font-family: verdana,arial,helvetica,sans-serif; }
+h6 { font-size: xx-small; font-family: verdana,arial,helvetica,sans-serif; }
+
+pre,tt { font-family: courier,sans-serif }
+
+a:link { text-decoration:none }
+a:visited { text-decoration:none }
+a:active { text-decoration:none }
+a:hover { text-decoration:underline; color:red }
+
+.titlebar { color: black; text-decoration: none; font-weight: bold; }
+a.tablink { color: black; text-decoration: none; font-weight: bold; font-size: x-small; }
+a.tablink:visited { color: black; text-decoration: none; font-weight: bold; font-size: x-small; }
+a.tablink:hover { text-decoration: none; color: black; font-weight: bold; font-size: x-small; }
+a.tabsellink { color: black; text-decoration: none; font-weight: bold; font-size: x-small; }
+a.tabsellink:visited { color: black; text-decoration: none; font-weight: bold; font-size: x-small; }
+a.tabsellink:hover { text-decoration: none; color: black; font-weight: bold; font-size: x-small; }
+

Added: www/htdocs/templates/index.html
===================================================================
--- www/htdocs/templates/index.html	2010-10-21 14:02:29 UTC (rev 461)
+++ www/htdocs/templates/index.html	2010-10-21 15:26:37 UTC (rev 462)
@@ -0,0 +1,147 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional"
+  "http://www.w3.org/TR/html4/loose.dtd">
+<% 
+from cgi import escape
+from xml.sax.saxutils import quoteattr
+
+def image(img):
+    return quoteattr("http://%s/themes/gforge/images/%s" % (domain, img))
+#
+%>
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <title><%= project_name %></title>
+    <link rel="stylesheet" type="text/css" href="styles/default.css">
+  </head>
+  <body>
+    <table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><a href="/"><img src=<%= image("logo.png") %>border="0" alt="" width="198" height="52" /></a></td>
+      </tr>
+    </table>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+
+  <tr>
+    <td>&nbsp;</td>
+    <td colspan="3"></td>
+  <tr>
+    <td>&nbsp;</td>
+    <td colspan="3"></td>
+    </tr>
+
+    <!-- start tabs -->
+
+  <tr>
+    <td align="left" bgcolor="#E0E0E0" width="9"><img src=<%= image("tabs/topleft.png") %> height="9" width="9" alt="" ></td>
+    <td bgcolor="#E0E0E0" width="30"><img src=<%= image("clear.png") %> width="30" height="1" alt="" ></td>
+    <td bgcolor="#E0E0E0"><img src=<%= image("clear.png") %> width="1" height="1" alt="" ></td>
+    <td bgcolor="#E0E0E0" width="30"><img src=<%= image("tabs/clear.png") %> width="30" height="1" alt="" ></td>
+    <td align="right" bgcolor="#E0E0E0" width="9"><img src=<%= image("tabs/topright.png") %> height="9" width="9" alt="" ></td>
+  </tr>
+
+  <tr>
+      <!-- Outer body row -->
+
+      <td bgcolor="#E0E0E0">
+          <img src=<%= image("clear.png") %> width="10" height="1" alt="">
+      </td>
+
+      <td valign="top" width="99%" bgcolor="#E0E0E0" colspan="3">
+          <!-- Inner Tabs / Shell -->
+          <table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                  <td align="left" bgcolor="#FFFFFF" width="9">
+                      <img src=<%= image("tabs/topleft-inner.png") %> height="9" width="9" alt="">
+                  </td>
+                  <td bgcolor="#FFFFFF">
+                      <img src=<%= image("clear.png") %> width="1" height="1" alt="">
+                  </td>
+                  <td align="right" bgcolor="#FFFFFF" width="9">
+                      <img src=<%= image("tabs/topright-inner.png") %> height="9" width="9" alt="">
+                  </td>
+              </tr>
+              <tr>
+                  <td bgcolor="#FFFFFF">
+                      <img src=<%= image("clear.png") %> width="10" height="1" alt="">
+                  </td>
+                  <td valign="top" width="99%" bgcolor="white">
+                      <!-- whole page table -->
+                      <table width="100%" cellpadding="5" cellspacing="0" border="0">
+                          <tr>
+                              <td width="65%" valign="top">
+                                  <%= project_title %>
+                                  <hr>
+                                  <h3>FILL ME!</h3>
+                                  <hr>
+                                  <%= project_news %>
+                              </td>
+                              <td width="35%" valign="top">
+                                  <table cellspacing="0" cellpadding="1" width="100%" border="0" bgcolor="#D5D5D7">
+                                      <tr>
+                                          <td>
+                                              <table cellspacing="0" cellpadding="2" width="100%" border="0" bgcolor="#EAECEF">
+                                                  <tr style="background-color:#d5d5d7" align="center">
+                                                      <td colspan="2">
+                                                          <span class="titlebar">Project Summary</span>
+                                                      </td>
+                                                  </tr>
+                                                  <tr align="left">
+                                                      <td colspan="2"><%= project_summary %></td>
+                                                  </tr>
+                                              </table>
+                                          </td>
+                                      </tr>
+                                  </table>
+                              </td>
+                          </tr>
+                      </table>
+                      <p>
+                          <!-- end main body row -->
+                      </p>
+                  </td>
+                  <td width="10" bgcolor="#FFFFFF">
+                      <img src=<%= image("clear.png") %> width="2" height="1" alt="">
+                  </td>
+              </tr>
+              <tr>
+                  <td align="left" bgcolor="#E0E0E0" width="9">
+                      <img src=<%= image("tabs/bottomleft-inner.png") %> height="11" width="11" alt="">
+                  </td>
+
+                  <td bgcolor="#FFFFFF">
+                      <img src=<%= image("clear.png") %> width="1" height="1" alt="">
+                  </td>
+                  <td align="right" bgcolor="#E0E0E0" width="9">
+                      <img src=<%= image("tabs/bottomright-inner.png") %> height="11" width="11" alt="">
+                  </td>
+              </tr>
+          </table><!-- end inner body row -->
+      </td>
+
+      <td width="10" bgcolor="#E0E0E0">
+          <img src=<%= image("clear.png") %> width="2" height="1" alt="">
+      </td>
+  </tr>
+  <tr>
+      <td align="left" bgcolor="#E0E0E0" width="9">
+          <img src=<%= image("tabs/bottomleft.png") %> height="9" width="9" alt="">
+      </td>
+      <td bgcolor="#E0E0E0" colspan="3">
+
+          <img src=<%= image("clear.png") %> width="1" height="1" alt="">
+      </td>
+      <td align="right" bgcolor="#E0E0E0" width="9">
+          <img src=<%= image("tabs/bottomright.png") %> height="9" width="9" alt="">
+      </td>
+  </tr>
+</table>
+
+  <!-- PLEASE LEAVE "Powered By GForge" on your site -->
+  <br />
+  <center>
+  <a href="http://gforge.org/"><img src="http://gforge.org/themes/gforge5/images/pow-gforge.png" 
+      alt="Powered By GForge Collaborative Development Environment" border="0" /></a>
+  </center>
+  </body>
+</html>

Added: www/rsync-htdocs.sh
===================================================================
--- www/rsync-htdocs.sh	2010-10-21 14:02:29 UTC (rev 461)
+++ www/rsync-htdocs.sh	2010-10-21 15:26:37 UTC (rev 462)
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+cd `dirname "$0"` && rsync -rvPC --exclude '*.swp' --delete htdocs/ $USER at treepkg.wald.intevation.org:/treepkg/htdocs/


Property changes on: www/rsync-htdocs.sh
___________________________________________________________________
Name: svn:executable
   + *



More information about the Treepkg-commits mailing list