Author: rspivak
Date: Tue Nov  1 22:23:15 2005
New Revision: 28873

Added:
   z3lab/cpsblog/trunk/browser/skin/blogportal.py   (contents, props changed)
Modified:
   z3lab/cpsblog/trunk/browser/skin/blog.pt
   z3lab/cpsblog/trunk/browser/skin/configure.zcml
   z3lab/cpsblog/trunk/browser/skin/template.css
   z3lab/cpsblog/trunk/browser/skin/template.pt
Log:
- Added `navigation` right slot to main template and corresponding css
  styles.
- Added view for BlogPortal, currently it serves to get info if user
  is authenticated and is used in skin template.pt to decide display 
  user box or not.


Modified: z3lab/cpsblog/trunk/browser/skin/blog.pt
==============================================================================
--- z3lab/cpsblog/trunk/browser/skin/blog.pt    (original)
+++ z3lab/cpsblog/trunk/browser/skin/blog.pt    Tue Nov  1 22:23:15 2005
@@ -1,10 +1,16 @@
-<html metal:use-macro="views/standard_macros/page">
+<html metal:use-macro="views/@@standard_macros/page">
+  <div metal:fill-slot="header">
+    <metal:block use-macro="context/@@blogmenu_macros/mainmenu" />
+    <metal:block use-macro="context/@@blogmenu_macros/searchfield" />
+  </div>
+
   <body>
     <div metal:fill-slot="body">
-        <div class="blog">
-          <h1 tal:content="context/title">Blog Title</h1>
-          <div tal:content="structure context/description" />
-        </div>
+
+      <div class="blog">
+        <h1 tal:content="context/title">Blog Title</h1>
+        <div tal:content="structure context/description" />
+      </div>
 
         <div>
           <tal:block condition="exists: request/form/query">

Added: z3lab/cpsblog/trunk/browser/skin/blogportal.py
==============================================================================
--- (empty file)
+++ z3lab/cpsblog/trunk/browser/skin/blogportal.py      Tue Nov  1 22:23:15 2005
@@ -0,0 +1,14 @@
+# $Id$
+from zope.app.security.interfaces import IUnauthenticatedPrincipal
+
+class BlogPortalView(object):
+
+    authenticated = False
+
+    def __init__(self, context, request):
+        self.context, self.request = context, request
+
+        if IUnauthenticatedPrincipal.providedBy(self.request.principal):
+            self.authenticated = False
+        else:
+            self.authenticated = True

Modified: z3lab/cpsblog/trunk/browser/skin/configure.zcml
==============================================================================
--- z3lab/cpsblog/trunk/browser/skin/configure.zcml     (original)
+++ z3lab/cpsblog/trunk/browser/skin/configure.zcml     Tue Nov  1 22:23:15 2005
@@ -30,6 +30,15 @@
       class="cpsblog.browser.blogentry.BlogEntryView"
       />
 
+  <page
+      for="*"
+      name="blogportal"
+      class=".blogportal.BlogPortalView"
+      template="template.pt"
+      permission="zope.View"
+      layer="blog"
+      />
+
   <resource name="template.css" file="template.css" />
   <resource name="nuxeo.png" file="images/nuxeo.png" />
   <resource name="key-point_back.gif" file="images/key-point_back.gif" />

Modified: z3lab/cpsblog/trunk/browser/skin/template.css
==============================================================================
--- z3lab/cpsblog/trunk/browser/skin/template.css       (original)
+++ z3lab/cpsblog/trunk/browser/skin/template.css       Tue Nov  1 22:23:15 2005
@@ -164,7 +164,7 @@
 
 .blog-entry {
     margin-left: 0px;
-    margin-right: 230px;
+    margin-right: 240px;
     padding: 8px;
     border: 1px solid #ccc;
 }
@@ -192,7 +192,7 @@
     padding: 15px;
     margin-bottom: 1em;
     margin-left: 0px;
-    margin-right: 230px;
+    margin-right: 240px;
 }
 
 .blog:before {
@@ -216,4 +216,25 @@
     margin: -15px;
     height: 8px;
     background: transparent url("key-point_br.gif") scroll no-repeat bottom 
right ;
-}
\ No newline at end of file
+}
+
+#navigation {
+    float: right;
+    top: 106;
+    right: 10;
+    width: 220px;
+    border: 1px solid #ccc;
+}
+
+#navigation-title {
+    background: #ccc;
+    padding: 4px;
+}
+
+#navigation a {
+    padding: 4px;
+}
+
+#navigation-menu-item {
+    margin: 2px;
+}

Modified: z3lab/cpsblog/trunk/browser/skin/template.pt
==============================================================================
--- z3lab/cpsblog/trunk/browser/skin/template.pt        (original)
+++ z3lab/cpsblog/trunk/browser/skin/template.pt        Tue Nov  1 22:23:15 2005
@@ -4,12 +4,13 @@
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
   </metal:block>
 
+
 <html xmlns="http://www.w3.org/1999/xhtml";
       xml:lang="en"
       lang="en"
       i18n:domain="blog">
 
-  <head>
+  <head metal:define-macro="head">
     <title metal:define-slot="title">Blog</title>
 
     <style type="text/css" media="all"
@@ -40,39 +41,51 @@
 
   <body>
 
-    <div id="header">
+    <div id="header" metal:define-macro="header">
       <h1>
         <a href=""
            tal:attributes="href 
string:${context/@@absolute_url}/++site++">logo</a>
       </h1>
-      <metal:block define-slot="header">
-        <metal:block use-macro="context/@@blogmenu_macros/mainmenu" />
-        <metal:block use-macro="context/@@blogmenu_macros/searchfield" />
-      </metal:block>
+      <metal:block define-slot="header" />
     </div>
 
-    <div id="breadcrumbs" metal:define-macro="breadcrumbs">
-      <span tal:omit-tag="" i18n:translate="">Location:&nbsp;</span>
-      <tal:block repeat="breadcrumb context/@@absolute_url/breadcrumbs">
-        <tal:block condition="python: not path('repeat/breadcrumb/end') and 
not path('repeat/breadcrumb/start')">
-          /<a href=""
+    <metal:slot define-slot="breadcrumbs">
+      <div id="breadcrumbs" metal:define-macro="breadcrumbs">
+        <div tal:omit-tag="" i18n:translate="">Location:</div>&nbsp;<tal:block
+           repeat="breadcrumb context/@@absolute_url/breadcrumbs"
+          ><a href=""
+              tal:condition="repeat/breadcrumb/start"
+              tal:attributes="
+              href string:${breadcrumb/url}/@@index.html"
+              i18n:translate="">[top]</a>
+          <a href=""
+             tal:condition="not:repeat/breadcrumb/start"
              tal:content="string:${breadcrumb/name}"
-             tal:attributes="href string:${breadcrumb/url}">breadcrumb item</a>
-        </tal:block>
-      </tal:block>
-    </div>
-
-
-    <div id="workspace" metal:define-macro="workspace">
-      <div metal:define-slot="entry" id="entry"></div>
+             tal:attributes="
+             href string:${breadcrumb/url}/@@index.html">
+            breadcrumb item</a> / </tal:block>
+      </div>
+    </metal:slot>
 
-      <div>
-        <metal:block define-slot="body">
-          This is the content
-        </metal:block>
+    <div metal:define-macro="navigation" id="navigation"
+         tal:condition="context/@@blogportal/authenticated">
+      <div id="navigation-title" tal:content="request/principal/title">
+        User
+      </div>
+      <div id="navigation-menu-item">
+        <a href="@@profile.html">Profile</a>
       </div>
+      <div id="navigation-menu-item">
+        <a href="@@logout.html">Logout</a>
+      </div>
+      <br />
+      <metal:block define-slot="nav_boxes" />
     </div>
 
+    <metal:block define-slot="body">
+      This is the content
+    </metal:block>
+
     <div id="footer" metal:define-macro="footer" />
 
   </body>
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to