changeset 90:c940af028112

add styles and meta-tags for search.
author casties
date Wed, 15 May 2013 18:48:36 +0200
parents 2f52650cb539
children d2f75c879335
files MPIWGProjects.py css/mpiwg.css zpt/feature/feature_template.zpt zpt/project/project_index_html.zpt zpt/project/project_template.zpt zpt/staff/member_index_html.zpt
diffstat 6 files changed, 233 insertions(+), 208 deletions(-) [+]
line wrap: on
line diff
--- a/MPIWGProjects.py	Wed May 15 15:56:53 2013 +0200
+++ b/MPIWGProjects.py	Wed May 15 18:48:36 2013 +0200
@@ -363,32 +363,38 @@
     #
     # templates
     #
-    project_html = PageTemplateFile('zpt/project/project_template', globals())
+    project_html = PageTemplateFile('zpt/project/project_index_html', globals())
     # edit templates
     edit_css = ImageFile('css/edit.css', globals())
     # make css refreshable for development
     edit_css.index_html = refreshingImageFileIndexHtml
     # user-accessible editing templates
+    edit_template = PageTemplateFile('zpt/project/edit_template', globals())
     security.declareProtected('View management screens', 'editBasic')
     editBasic = PageTemplateFile('zpt/project/edit_basic', globals())
+    security.declareProtected('View management screens', 'editDescription')
     editDescription = PageTemplateFile('zpt/project/edit_description', globals())
-    edit_template = PageTemplateFile('zpt/project/edit_template', globals())
+    security.declareProtected('View management screens', 'editRelatedProjectsForm')
     editRelatedProjectsForm = PageTemplateFile('zpt/project/edit_related_projects', globals())
     editRelatedProjectsError = PageTemplateFile('zpt/project/edit_related_projects_error', globals())
-    editImagesForm = PageTemplateFile('zpt/project/edit_images', globals())    
+    security.declareProtected('View management screens', 'editRelatedProjectsForm')
+    editRelatedProjectsForm = PageTemplateFile('zpt/project/edit_images', globals())    
+    security.declareProtected('View management screens', 'editPublicationsForm')
     editPublicationsForm = PageTemplateFile('zpt/project/edit_publications', globals())
+    security.declareProtected('View management screens', 'editInfoBlocksForm')
     editInfoBlocksForm = PageTemplateFile('zpt/project/edit_infoblocks', globals())
+    security.declareProtected('View management screens', 'editAdditionalPublicationsForm')
     editAdditionalPublicationsForm = PageTemplateFile('zpt/project/pubman/change_publications', globals())
+    security.declareProtected('View management screens', 'editAddAdditionalPublications')
     editAddAdditionalPublications = PageTemplateFile('zpt/project/pubman/add_publications', globals())
     security.declareProtected('View management screens', 'edit')
     edit = editDescription
     # management templates
+    security.declareProtected('View management screens', 'loadNewFileForm')
     loadNewFileForm = PageTemplateFile('zpt/project/manage_newfile', globals())
     description_only_html = PageTemplateFile('zpt/project/description_only_html', globals())
     # additional pages
     additional_publications_html = PageTemplateFile('zpt/project/pubman/show_publications', globals())
-    # TODO: remove compat
-    edit_MPIWGProject_main = edit_template
 
 
     def __init__(self, id, argv=None):
--- a/css/mpiwg.css	Wed May 15 15:56:53 2013 +0200
+++ b/css/mpiwg.css	Wed May 15 18:48:36 2013 +0200
@@ -27,7 +27,8 @@
 }
 
 /*  link-classes (with icons)  */
-a.internal {
+a.internal,
+a.more {
     background: url(../images/internal.png) center left no-repeat;
     padding-left: 10px;
 }
@@ -101,6 +102,7 @@
 }
 
 ul.inline {
+    display: inline;
     padding: 0;
     margin: 0;
 }
@@ -109,6 +111,10 @@
     display: inline;
 }
 
+/*
+ * table-like rows and columns
+ */
+
 div.rows {
     display: table;
 }
@@ -365,12 +371,14 @@
     padding-left: 21px;
 }
 
-div.box h2 {
+div.box h2,
+h2.line {
     /* more-links in title are right */
     position: relative;
 }
 
-div.box h2 a:link {
+div.box h2 a:link,
+h2.line a.more:link {
     /* more-links in title are right */
     position: absolute;
     right: 0;
@@ -503,6 +511,8 @@
 }
 
 div.tool.box div.searchbox div.extended {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 12px;
     text-align: right;
     padding: 5px 30px 5px 3px;
 }
--- a/zpt/feature/feature_template.zpt	Wed May 15 15:56:53 2013 +0200
+++ b/zpt/feature/feature_template.zpt	Wed May 15 18:48:36 2013 +0200
@@ -4,6 +4,9 @@
   <html xmlns="http://www.w3.org/1999/xhtml" metal:use-macro="here/main_template/macros/page">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<metal:block metal:fill-slot="head">
+  <meta name="description" content="feature"/> 
+</metal:block>
 </head>
 <body>
   <div class="center" metal:fill-slot="center">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/project/project_index_html.zpt	Wed May 15 18:48:36 2013 +0200
@@ -0,0 +1,202 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html metal:use-macro="here/pro_sec_template/macros/page">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<tal:block metal:fill-slot="title">
+  <title tal:content="string:${here/getNumber} ${here/getProjectTitle}" />
+</tal:block>
+<tal:block metal:fill-slot="head">
+  <meta name="description" content="project"/>
+  <tal:block 
+    tal:define="global proBaseUrl string:$root/${secmap/research}/projects;
+      global images here/getImageList;
+      global dept here/getDepartmentId;" />
+</head>
+<body>
+
+  <!-- middle column -->
+  <div class="center project" metal:fill-slot="center">
+    <!-- version header -->
+    <h2  tal:condition="not:here/isCurrentVersion">
+      This is an outdated version of this project! For the current version, please refer to 
+      <a tal:define="parentUrl python:here.aq_parent.getUrl(baseUrl=proBaseUrl)" 
+        tal:attributes="href parentUrl" tal:content="parentUrl"/>
+    </h2>
+    <tal:x tal:define="started here/getStartedAt" tal:condition="here/isArchivedProject">
+      <p>
+        (<span tal:condition="started" tal:content="string:$started-"/><span tal:condition="not:started">Completed:</span>
+        <span tal:content="here/getCompletedAt"/>)
+      </p>
+    </tal:x>
+    <!-- /version header -->
+
+    <h1 class="mpiwg-title" tal:content="here/getProjectTitle">History of Scientific Objectivity, 18th-19th Cs</h1>
+    <h3 class="authors mpiwg-authors">
+      <tal:block tal:repeat="person here/getResponsibleScientistsList">
+          <a class="mpiwg-author" 
+            tal:define="username person/username|nothing; key person/key|nothing;" 
+            tal:omit-tag="python:not username or not here.getStaffFolder().isActiveMember(key=key)"
+            tal:attributes="href string:$root/${secmap/staff}/members/$username" tal:content="person/name">
+            Name of responsible person
+          </a><tal:block tal:condition="not:repeat/person/end">, </tal:block>
+      </tal:block>
+    </h3>
+
+    <h3 class="authors" tal:define="others here/getInvolvedScholars" tal:condition="others">
+      Other involved scholars: <span tal:content="structure others">Scholars </span>
+    </h3>
+    <h3 class="authors" tal:define="partners here/getCooperationPartners" tal:condition="partners">
+      Cooperation Partners: <span tal:content="structure partners">Partners</span>
+    </h3>
+
+    <div class="description">
+      <!-- inline image -->
+      <div class="figure" tal:condition="images" tal:repeat="image python:images">
+        <div class="image">
+          <a tal:condition="image/width" tal:attributes="href python:image.getUrl()+'/showImage'" target="_blank"><img
+            tal:attributes="src image/getUrl" alt="" /></a>
+          <pre tal:condition="not:image/width">empty image</pre>
+        </div>
+        <div class="figcaption" tal:content="structure image/caption">J.-A.-D. Ingres: Mme Moitessier, 1856. Oel/Lw. 120 x 92,1
+          cm. London, National Gallery.</div>
+      </div>
+      <!-- inline image -->
+      <div tal:content="structure python:here.getDescription(filter=True)">Project description</div>
+    </div>
+
+  </div>
+
+  <!-- right column -->
+  <div class="sidebar" metal:fill-slot="sidebar">
+
+    <!-- this project is part of -->
+    <div class="sideblock"
+      tal:define="parents here/getSuperProjects;" tal:condition="parents">
+      <div class="project parent">
+        Part of:
+        <a tal:define="parent python:parents[-1]" tal:content="parent/getLabel"
+           tal:attributes="href python:parent.getUrl(baseUrl=proBaseUrl)+test(here.isArchivedProject(),'?showArchive=yes','')" />
+      </div>
+      <!-- end parent -->
+    </div>
+    <!-- sideblock -->
+
+    <!-- related projects -->
+    <div class="sideblock" tal:define="projects here/getRelatedProjectList" tal:condition="projects">
+      <h2>Related Projects</h2>
+      <div class="project" tal:repeat="project projects">
+        <a tal:attributes="href string:$proBaseUrl/${project/getProjectId}"
+          tal:content="project/getProjectLabel" />
+      </div>
+      <!-- end item -->
+    </div>
+    <!-- sideblock -->
+
+    <!-- related publications -->
+    <tal:block tal:define="publications here/getPublicationList">
+      <div class="sideblock" tal:condition="publications">
+        <h2>Related Publications</h2>
+        <tal:block tal:repeat="publication publications">
+          <div class="item" tal:define="bookid publication/getBookId" tal:condition="publication/text">
+            <tal:y condition="not:bookid">
+              <tal:x tal:define="img publication/publicationImage1 | nothing" tal:condition="img">
+                <a target="_blank" tal:attributes="href img/absolute_url"> <img width="150"
+                  tal:attributes="src img/absolute_url" />
+                </a>
+                <br />
+              </tal:x>
+              <a tal:define="link publication/link | nothing;" tal:omit-tag="not:link" tal:content="structure publication/text"
+                tal:attributes="href link" />
+            </tal:y>
+            <tal:y condition="bookid">
+              <tal:x
+                tal:define="book python:here.books[bookid]; bookurl python:book.getUrl(baseUrl=root+'/'+secmap['resources']+'/books')">
+                <a tal:attributes="href bookurl"><img width="150" tal:attributes="src book/getImageUrl" /></a>
+                <br />
+                <a tal:attributes="href bookurl" tal:content="structure publication/text" />
+              </tal:x>
+            </tal:y>
+            <tal:x tal:condition="python:hasattr(publication, 'description')">
+              <div tal:content="structure publication/description" />
+            </tal:x>
+          </div><!-- end item -->
+        </tal:block>
+      </div>
+      <!-- sideblock -->
+
+      <div class="sideblock" tal:condition="here/hasAdditionalPublications">
+        <h2>Additional Publications</h2>
+        <div class="item">
+          <a class="internal" tal:attributes="href python:here.getUrl(baseUrl=proBaseUrl)+'/additional_publications_html'">
+            Publications in the context of this project
+          </a>
+        </div>
+      </div>
+    </tal:block>
+    <!-- related publications -->
+
+    <!-- projects covered -->
+    <div class="sideblock"
+         tal:define="showArchive python:(request.get('showArchive','no')=='yes');
+                     children here/getSubProjects;"
+         tal:condition="children">
+      <h2>
+        Projects
+        <span class="proj_state">
+          <a href="?" tal:omit-tag="python:not (here.isArchivedProject() or showArchive)">current</a>
+          &nbsp; 
+          <a href="?showArchive=yes" tal:omit-tag="python:here.isArchivedProject() or showArchive">completed</a>
+        </span>
+      </h2>
+      <tal:y tal:repeat="child children">
+        <tal:x tal:condition="python:not (child.isArchivedProject() or showArchive)">
+          <div class="project">
+            <a tal:content="child/getLabel"
+              tal:attributes="href python:child.getUrl(baseUrl=proBaseUrl)" />
+          </div>
+        </tal:x>
+        <tal:x tal:condition="python:child.isArchivedProject() and (here.isArchivedProject() or showArchive)">
+          <div class="project inactive" tal:define="started child/getStartedAt">
+            <a tal:content="child/getLabel"
+              tal:attributes="href python:child.getUrl(baseUrl=proBaseUrl)" /> 
+            (<span tal:condition="started" tal:content="string:$started-"/><tal:x tal:condition="not:started">Completed: </tal:x><span tal:content="child/getCompletedAt"/>)
+          </div>
+        </tal:x>
+      </tal:y>
+    </div>
+    <!-- projects covered -->
+
+    <!-- custom info blocks -->
+    <div class="sideblock" tal:repeat="block here/getInfoBlockList">
+      <h2 tal:content="block/getTitle">Info block</h2>
+      <div class="item" tal:repeat="item block/getItems">
+        <a class="external" tal:attributes="href item/link" tal:omit-tag="not:item/link"
+           tal:content="structure item/text">
+          info item
+        </a>
+      </div>
+    </div>
+
+    <!-- related digital sources -->
+    <div class="sideblock" tal:define="sources here/getRelatedDigitalSources" tal:condition="sources">
+      <h2>OLD! Related digital sources</h2>
+      <div class="item" tal:content="structure sources">
+        digital sources
+      </div>
+    </div>
+
+    <!-- funding institutions -->
+    <div class="sideblock" tal:define="funding here/getFundingInstitutions" tal:condition="funding">
+      <h2>Funding Institutions</h2>
+      <div class="item" tal:content="structure funding">
+        Funding
+      </div>
+    </div>
+    <!-- sideblock -->
+
+  </div>
+  <!-- sidebar -->
+
+</body>
+</html>
\ No newline at end of file
--- a/zpt/project/project_template.zpt	Wed May 15 15:56:53 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,198 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
-      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html metal:use-macro="here/pro_sec_template/macros/page">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<tal:block metal:fill-slot="title">
-  <title tal:content="string:${here/getNumber} ${here/getProjectTitle}" />
-</tal:block>
-<tal:block metal:fill-slot="head"
-  tal:define="global proBaseUrl string:$root/${secmap/research}/projects;
-              global images here/getImageList;
-              global dept here/getDepartmentId;" />
-</head>
-<body>
-
-  <!-- middle column -->
-  <div class="center project" metal:fill-slot="center">
-    <!-- version header -->
-    <h2  tal:condition="not:here/isCurrentVersion">
-      This is an outdated version of this project! For the current version, please refer to 
-      <a tal:define="parentUrl python:here.aq_parent.getUrl(baseUrl=proBaseUrl)" 
-        tal:attributes="href parentUrl" tal:content="parentUrl"/>
-    </h2>
-    <tal:x tal:define="started here/getStartedAt" tal:condition="here/isArchivedProject">
-      <p>
-        (<span tal:condition="started" tal:content="string:$started-"/><span tal:condition="not:started">Completed:</span>
-        <span tal:content="here/getCompletedAt"/>)
-      </p>
-    </tal:x>
-    <!-- /version header -->
-
-    <h1 tal:content="here/getProjectTitle">History of Scientific Objectivity, 18th-19th Cs</h1>
-    <h3 class="authors">
-      <tal:block tal:repeat="person here/getResponsibleScientistsList">
-          <a tal:define="username person/username|nothing; key person/key|nothing;" 
-             tal:omit-tag="python:not username or not here.getStaffFolder().isActiveMember(key=key)"
-             tal:attributes="href string:$root/${secmap/staff}/members/$username" tal:content="person/name"> Name of
-            responsible person</a><tal:block tal:condition="not:repeat/person/end">, </tal:block>
-      </tal:block>
-    </h3>
-
-    <h3 class="authors" tal:define="others here/getInvolvedScholars" tal:condition="others">
-      Other involved scholars: <span tal:content="structure others">Scholars </span>
-    </h3>
-    <h3 class="authors" tal:define="partners here/getCooperationPartners" tal:condition="partners">
-      Cooperation Partners: <span tal:content="structure partners">Partners</span>
-    </h3>
-
-    <div class="description">
-      <!-- inline image -->
-      <div class="figure" tal:condition="images" tal:repeat="image python:images">
-        <div class="image">
-          <a tal:condition="image/width" tal:attributes="href python:image.getUrl()+'/showImage'" target="_blank"><img
-            tal:attributes="src image/getUrl" alt="" /></a>
-          <pre tal:condition="not:image/width">empty image</pre>
-        </div>
-        <div class="figcaption" tal:content="structure image/caption">J.-A.-D. Ingres: Mme Moitessier, 1856. Oel/Lw. 120 x 92,1
-          cm. London, National Gallery.</div>
-      </div>
-      <!-- inline image -->
-      <div tal:content="structure python:here.getDescription(filter=True)">Project description</div>
-    </div>
-
-  </div>
-
-  <!-- right column -->
-  <div class="sidebar" metal:fill-slot="sidebar">
-
-    <!-- this project is part of -->
-    <div class="sideblock"
-      tal:define="parents here/getSuperProjects;" tal:condition="parents">
-      <div class="project parent">
-        Part of:
-        <a tal:define="parent python:parents[-1]" tal:content="parent/getLabel"
-           tal:attributes="href python:parent.getUrl(baseUrl=proBaseUrl)+test(here.isArchivedProject(),'?showArchive=yes','')" />
-      </div>
-      <!-- end parent -->
-    </div>
-    <!-- sideblock -->
-
-    <!-- related projects -->
-    <div class="sideblock" tal:define="projects here/getRelatedProjectList" tal:condition="projects">
-      <h2>Related Projects</h2>
-      <div class="project" tal:repeat="project projects">
-        <a tal:attributes="href string:$proBaseUrl/${project/getProjectId}"
-          tal:content="project/getProjectLabel" />
-      </div>
-      <!-- end item -->
-    </div>
-    <!-- sideblock -->
-
-    <!-- related publications -->
-    <tal:block tal:define="publications here/getPublicationList">
-      <div class="sideblock" tal:condition="publications">
-        <h2>Related Publications</h2>
-        <tal:block tal:repeat="publication publications">
-          <div class="item" tal:define="bookid publication/getBookId" tal:condition="publication/text">
-            <tal:y condition="not:bookid">
-              <tal:x tal:define="img publication/publicationImage1 | nothing" tal:condition="img">
-                <a target="_blank" tal:attributes="href img/absolute_url"> <img width="150"
-                  tal:attributes="src img/absolute_url" />
-                </a>
-                <br />
-              </tal:x>
-              <a tal:define="link publication/link | nothing;" tal:omit-tag="not:link" tal:content="structure publication/text"
-                tal:attributes="href link" />
-            </tal:y>
-            <tal:y condition="bookid">
-              <tal:x
-                tal:define="book python:here.books[bookid]; bookurl python:book.getUrl(baseUrl=root+'/'+secmap['resources']+'/books')">
-                <a tal:attributes="href bookurl"><img width="150" tal:attributes="src book/getImageUrl" /></a>
-                <br />
-                <a tal:attributes="href bookurl" tal:content="structure publication/text" />
-              </tal:x>
-            </tal:y>
-            <tal:x tal:condition="python:hasattr(publication, 'description')">
-              <div tal:content="structure publication/description" />
-            </tal:x>
-          </div><!-- end item -->
-        </tal:block>
-      </div>
-      <!-- sideblock -->
-
-      <div class="sideblock" tal:condition="here/hasAdditionalPublications">
-        <h2>Additional Publications</h2>
-        <div class="item">
-          <a class="internal" tal:attributes="href python:here.getUrl(baseUrl=proBaseUrl)+'/additional_publications_html'">
-            Publications in the context of this project
-          </a>
-        </div>
-      </div>
-    </tal:block>
-    <!-- related publications -->
-
-    <!-- projects covered -->
-    <div class="sideblock"
-         tal:define="showArchive python:(request.get('showArchive','no')=='yes');
-                     children here/getSubProjects;"
-         tal:condition="children">
-      <h2>
-        Projects
-        <span class="proj_state">
-          <a href="?" tal:omit-tag="python:not (here.isArchivedProject() or showArchive)">current</a>
-          &nbsp; 
-          <a href="?showArchive=yes" tal:omit-tag="python:here.isArchivedProject() or showArchive">completed</a>
-        </span>
-      </h2>
-      <tal:y tal:repeat="child children">
-        <tal:x tal:condition="python:not (child.isArchivedProject() or showArchive)">
-          <div class="project">
-            <a tal:content="child/getLabel"
-              tal:attributes="href python:child.getUrl(baseUrl=proBaseUrl)" />
-          </div>
-        </tal:x>
-        <tal:x tal:condition="python:child.isArchivedProject() and (here.isArchivedProject() or showArchive)">
-          <div class="project inactive" tal:define="started child/getStartedAt">
-            <a tal:content="child/getLabel"
-              tal:attributes="href python:child.getUrl(baseUrl=proBaseUrl)" /> 
-            (<span tal:condition="started" tal:content="string:$started-"/><tal:x tal:condition="not:started">Completed: </tal:x><span tal:content="child/getCompletedAt"/>)
-          </div>
-        </tal:x>
-      </tal:y>
-    </div>
-    <!-- projects covered -->
-
-    <!-- custom info blocks -->
-    <div class="sideblock" tal:repeat="block here/getInfoBlockList">
-      <h2 tal:content="block/getTitle">Info block</h2>
-      <div class="item" tal:repeat="item block/getItems">
-        <a class="external" tal:attributes="href item/link" tal:omit-tag="not:item/link"
-           tal:content="structure item/text">
-          info item
-        </a>
-      </div>
-    </div>
-
-    <!-- related digital sources -->
-    <div class="sideblock" tal:define="sources here/getRelatedDigitalSources" tal:condition="sources">
-      <h2>OLD! Related digital sources</h2>
-      <div class="item" tal:content="structure sources">
-        digital sources
-      </div>
-    </div>
-
-    <!-- funding institutions -->
-    <div class="sideblock" tal:define="funding here/getFundingInstitutions" tal:condition="funding">
-      <h2>Funding Institutions</h2>
-      <div class="item" tal:content="structure funding">
-        Funding
-      </div>
-    </div>
-    <!-- sideblock -->
-
-  </div>
-  <!-- sidebar -->
-
-</body>
-</html>
\ No newline at end of file
--- a/zpt/staff/member_index_html.zpt	Wed May 15 15:56:53 2013 +0200
+++ b/zpt/staff/member_index_html.zpt	Wed May 15 18:48:36 2013 +0200
@@ -4,7 +4,8 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <metal:block metal:fill-slot="head">
-  <tal:x
+  <meta name="description" content="member"/>
+  <tal:block
     tal:define="global member options/member; global key member/getKey;
       global username member/getUsername; global content member/getContent;
       global baseUrl string:$root/${secmap/staff}/members/$username" />
@@ -20,7 +21,8 @@
       </tal:block>
       <!-- name and title -->
       <h1>
-        <span tal:replace="content/first_name" /> <span tal:replace="content/last_name" />
+        <span class="mpiwg-first_name" tal:content="content/first_name" /> 
+        <span class="mpiwg-last_name" tal:content="content/last_name" />
       </h1>
       <!-- status -->
       <h3 tal:content="content/status" />