changeset 5:9e720c6c5b6c

working on start page.
author casties
date Tue, 12 Feb 2013 18:15:05 +0100
parents 1a895905f7ca
children 9e4dba0a81e2
files MPIWGFeature.py css/mpiwg.css zpt/www/main_template.zpt
diffstat 3 files changed, 99 insertions(+), 82 deletions(-) [+]
line wrap: on
line diff
--- a/MPIWGFeature.py	Mon Feb 11 20:14:47 2013 +0100
+++ b/MPIWGFeature.py	Tue Feb 12 18:15:05 2013 +0100
@@ -57,6 +57,28 @@
             t = self.title
             
         return t
+    
+    def getUrl(self, baseUrl=None):
+        """returns URL to this feature"""
+        if baseUrl is None:
+            return self.absolute_url()
+
+        return '%s/%s'%(baseUrl, self.getId())
+            
+    def getPath(self, page, relative=True):
+        """returns path to template page"""
+        # get Language from MPIWGRoot
+        lang = self.getLang()
+        dir = getattr(self, lang, self.en)
+        if relative:
+            return '%s/%s/%s'%(self.getId(), dir.getId(), page)
+        
+        pt = getattr(dir, page)
+        return pt.absolute_url_path()
+
+    def getTeaserPath(self):
+        """returns the path to the teaser template"""
+        return self.getPath('teaser.pt')
 
     def getIntro(self, **args):
         """returns the intro as PageTemplate"""
@@ -66,13 +88,6 @@
         pt = getattr(dir, 'intro.pt')
         return pt(**args)
 
-    def getTeaserPath(self):
-        """returns the path to the teaser template"""
-        # get Language from MPIWGRoot
-        lang = self.getLang()
-        dir = getattr(self, lang, self.en)
-        return '%s/%s/teaser.pt'%(self.getId(),dir.getId())
-
     def getMain(self, **args):
         """returns the main part as PageTemplate"""
         # get Language from MPIWGRoot
--- a/css/mpiwg.css	Mon Feb 11 20:14:47 2013 +0100
+++ b/css/mpiwg.css	Tue Feb 12 18:15:05 2013 +0100
@@ -73,21 +73,21 @@
 
 h1 {
     color: #3b4186;
-    font-size: 15px;
+    font-size: 16px;
     font-weight: bold;
     margin: 10px 2px 10px 2px;
 }
 
 h2 {
     color: #3b4186;
-    font-size: 15px;
+    font-size: 16px;
     font-weight: normal;
     margin: 2px;
 }
 
 h3 {
     color: #3b4186;
-    font-size: 13px;
+    font-size: 14px;
     font-weight: normal;
     margin: 2px;
 }
@@ -296,53 +296,52 @@
  *  main section 
  */
 
-div.content {
-    /* float: left; */
-    width: 900px;
+div.main {
+}
+
+div.main div.row {
+	/* set font-size to ignore whitespace */
+	font-size: 0;
 }
 
-div.main {
-    /* float: left; */
-    width: 720px;
-    background-color: #FFFFFF;
-    margin-bottom: 10px;
-    padding-right: 10px;
-    font-size: 12px;
+div.main div.block {
+	display: inline-block;
+	width: 286px;
+	vertical-align: top;
+	/* reset font-size */
+	font-size: 12px;
+	line-height: 1.5;
+	margin-left: 21px;
 }
-
-div.main div.center {
-    /* float: left; */
-    width: 460px;
-    padding: 20px;
+div.main div.block:first-child {
+	/* first block has no left margin */
+	margin-left: 0;
 }
 
-
-div.center, div.center_wide {
-    line-height: 1.6;
+div.main div.block h2 {
+	position: relative;
+    padding-bottom: 3px;
+    margin-top: 18px;
+    border-bottom: 3px solid #dccbae;
 }
-div.center ul {
-    list-style: none;
-    margin-left: 0;
-    padding: 0;
-}
-
-div.center li {
-    margin-bottom: 10px;
+div.main div.block h2 a:link {
+	/* more-links in title are right */
+	position: absolute;
+	right: 0;
+	/* more-links in title are small */
+	font-size: 12px;
 }
 
-
-div.main div.center_wide {
-    /* float: left; */
-    width: 710px;
-/*    padding: 20px 0 0 20px; */
-    padding: 20px;
+div.main div.block div.item {
+	padding-top: 5px;
+	padding-bottom: 3px;
+	border-bottom: 1px solid #dccbae;
 }
 
-
-
-
-
-
+div.main div.block b {
+	/* bold is blue */
+	color: #3b4186;
+}
 
 /*
  * subnavigation
--- a/zpt/www/main_template.zpt	Mon Feb 11 20:14:47 2013 +0100
+++ b/zpt/www/main_template.zpt	Tue Feb 12 18:15:05 2013 +0100
@@ -1,27 +1,33 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" metal:define-macro="page" 
-      tal:define="root here/MPIWGrootURL|here/en/MPIWGrootURL; 
+<html xmlns="http://www.w3.org/1999/xhtml" metal:define-macro="page"
+  tal:define="root here/MPIWGrootURL|here/en/MPIWGrootURL; 
                   crumbs template/getBreadcrumbs | nothing;
                   section here/getSection | nothing;
                   sections here/getSections | nothing;
-                  secmap python:{
-                  'institute':'institute',
-                  'staff':'staff',
-                  'research':'research',
-                  'resources':'resources',
-                  'news':'news',
-                  'lang':'en'};
+                  lang here/getLang | nothing;
+                  allsecs python:{'en':{
+                    'institute':'institute',
+                    'staff':'staff',
+                    'research':'research',
+                    'resources':'resources',
+                    'news':'news'},
+                  'de':{
+                    'institute':'institut',
+                    'staff':'mitarbeiter',
+                    'research':'forschung',
+                    'resources':'ressourcen',
+                    'news':'aktuelles'}};
+                  secmap python:allsecs[lang];
                   subsection python:template.getSubSection(crumbs=crumbs);
                   ">
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title metal:define-slot="title">Max Planck Institute for the History of Science</title>
-    <link rel="stylesheet" type="text/css" tal:attributes="href string:$root/mpiwg_css"/>
-    <link rel="shortcut icon" href="http://www.mpiwg-berlin.mpg.de/favicon.ico"/>
-    <tal:block metal:define-slot="head"/>
-
-  </head>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title metal:define-slot="title">Max Planck Institute for the History of Science</title>
+<link rel="stylesheet" type="text/css" tal:attributes="href string:$root/mpiwg_css" />
+<link rel="shortcut icon" href="http://www.mpiwg-berlin.mpg.de/favicon.ico" />
+<tal:block metal:define-slot="head" />
+</head>
 <body>
   <div tal:condition="exists:here/mpiwg_test" tal:replace="structure here/mpiwg_test" />
   <div id="wrapper">
@@ -46,10 +52,8 @@
       </div>
     </div>
 
-    <metal:block metal:define-slot="featureslot" />
-
     <div class="content" metal:define-slot="content">
-      <div class="leftbox">
+      <div class="leftbox" metal:define-slot="leftbox">
         <div class="subnav" metal:define-slot="subnav">
           <tal:block tal:condition="crumbs" tal:repeat="subnav python:here.subNav(here)">
             <div tal:attributes="class python:test(subnav[0]==subsection,'sn_on','sn_off')">
@@ -59,29 +63,28 @@
         </div>
         <div class="subnavbox" metal:define-slot="subnavbox"></div>
       </div>
-      <!-- leftbox -->
+      <!-- /leftbox -->
       <div class="main" metal:define-slot="main">
 
         <div class="center" metal:define-slot="center"></div>
-        <!-- center -->
+        <!-- /center -->
 
         <div class="sidebar" metal:define-slot="sidebar"></div>
-        <!-- sidebar -->
+        <!-- /sidebar -->
+
+      </div>
+      <!-- /main -->
 
-        <div class="footer">
-          <div class="services">
-            <div class="serviceprint">
-              <a href="javascript:window.print()">Print</a>
-            </div>
-            <div class="serviceforward">
-              <a tal:attributes="href python:'mailto:?subject=MPIWG%%20%s&body=%s'%(here.title,here.absolute_url())">Forward</a>
-            </div>
-            <!-- <div class="servicepdf"><a href="">Download PDF</a></div> -->
+      <!-- <div class="footer">
+        <div class="services">
+          <div class="serviceprint">
+            <a href="javascript:window.print()">Print</a>
+          </div>
+          <div class="serviceforward">
+            <a tal:attributes="href python:'mailto:?subject=MPIWG%%20%s&body=%s'%(here.title,here.absolute_url())">Forward</a>
           </div>
         </div>
-      </div>
-      <!-- main -->
-
+      </div> -->
       <div class="boilerplate">
         <div class="legal">
           <a tal:attributes="href string:$root/resources/intranet.html">Intranet</a> | <a href="https://webmail.mpiwg-berlin.mpg.de"