[Zope-CVS] CVS: Products/PageDesign - zopetop_design.zexp:1.1
Shane Hathaway
shane@cvs.zope.org
Mon, 1 Jul 2002 14:28:42 -0400
Update of /cvs-repository/Products/PageDesign
In directory cvs.zope.org:/tmp/cvs-serv30591
Added Files:
zopetop_design.zexp
Log Message:
Added an example of page designs. The example is based on the ZopeTop sprint
(for Zope 3) and a couple of ideas of my own (the toolbar).
=== Added File Products/PageDesign/zopetop_design.zexp ===
ZEXP s S((U
OFS.FolderqUFolderqtqNt.}q(Utop_pageq(U tq(U'Products.PageTemplates.ZopePageTemplateqUZopePageTemplateqttQUbreadcrumbs.pyq (U vq
(U#Products.PythonScripts.PythonScriptqUPythonScriptqttQUdesignq
(U q(UProducts.PageDesign.PageDesignqU
PageDesignqttQUmetadata_boxq(U }q(hUZopePageTemplateqttQUhelp_boxq(U q(hUZopePageTemplateqttQUzopetop.cssq(U q(U OFS.ImageqUFileqttQUidqUzopetop_designqUformatItemDateq(U {q(hUPythonScriptqttQUdown.gifq (U q!(hUImageq"ttQUformatItemSizeq#(U |q$(hUPythonScriptq%ttQUtitleq&U U
search_boxq'(U ~q((hUZopePageTemplateq)ttQUup.gifq*(U q+(hUImageq,ttQUfolder_contentsq-(U zq.(hUZopePageTemplateq/ttQUexplorer_boxq0(U yq1(hUZopePageTemplateq2ttQU
expand.gifq3(U xq4(hUImageq5ttQUbox_templateq6(U uq7(hUZopePageTemplateq8ttQU_ownerq9(]q:U acl_usersq;aUshaneq<tq=Usidebox.gifq>(U q?(hUImageq@ttQU_objectsqA(}qB(U meta_typeqCU
Page TemplateqDhhU folderishqEK u}qF(hChDhh6hEK u}qG(hCUScript (Python)qHhUbreadcrumbs.pyqIhEK u}qJ(hCUImageqKhUcollapse.gifqLhEK u}qM(hChKhh3hEK u}qN(hChDhUexplorer_boxqOhEK u}qP(hChDhUfolder_contentsqQhEK u}qR(hChHhUformatItemDateqShEK u}qT(hChHhUformatItemSizeqUhEK u}qV(hChDhUmetadata_boxqWhEK u}qX(hChDhU
search_boxqYhEK u}qZ(hChKhh>hEK u}q[(hCUFileq\hhhEK u}q](hChKhh hEK u}q^(hChKhh*hEK u}q_(hCUPage Designq`hUdesignqahEK u}qb(hChDhUhelp_boxqchEK utqdU__ac_local_roles__qe}qfUshaneqg]qhUOwnerqiashL(U wqj(hUImageqkttQu. t ((U'Products.PageTemplates.ZopePageTemplateqUZopePageTemplateqtqNt.}q(Ucontent_typeqU text/htmlqU_textqT <html metal:define-macro="page">
<head>
<title>ZopeTop</title>
<link rel="stylesheet" href="zopetop.css" />
<script type='text/javascript'>
function switchbox(btn) {
btn.href = 'expand.gif';
}
</script>
</head>
<body>
<table class="window" cellpadding="0" cellspacing="0">
<tr valign="bottom" class="userbar">
<td class="zopelogo">
<img src="/p_/zopelogo_jpg" />
</td>
<td colspan="2" class="usermenu">
<div align="right"><table><tr>
<td align="center"><a href="#">[Wrench]<br />Configure</a></td>
<td align="center"><a href="#">[Typewriter]<br />Content</a></td>
<td align="center"><a href="#">[Eye]<br />Preview</a></td>
<td align="center"><a href="#">[Question]<br />Help</a></td>
<td> </td>
<td align="center"><a href="#">[Knob]<br />Preferences</a></td>
<td align="center"><a href="#">[Hat]<br />Session</a></td>
<td align="center">Logged in: <tal:name replace="user">User name</tal:name></td>
</tr></table></div>
</td>
</tr>
<tr>
<td rowspan="2" class="actions" valign="top">
<div tal:repeat="pane options/areas/global_panes|nothing" tal:content="structure pane" class="actionbox">
Global Actions
</div>
</td>
<td colspan="2" class="breadcrumbs" tal:content="structure here/breadcrumbs.py">
Bread > Crumbs
</td>
</tr>
<tr class="objectwindow">
<td class="objectview" valign="top">
<div metal:define-slot="main">
Object View
</div>
</td>
<td class="actions" valign="top">
<div tal:repeat="pane options/areas/object_panes|nothing" tal:content="structure pane" class="actionbox">
Object Actions
</div>
</td>
</tr>
</table>
</body>
</html>
qU_bind_namesq (cShared.DC.Scripts.Bindings
NameAssignments
q
oq}qU_asgnsq
}qUname_subpathqUtraverse_subpathqssbUtitleqU U__ac_local_roles__q}qUsprintq]qUOwnerqasUidqUtop_pageqUexpandqK u. v 5((U#Products.PythonScripts.PythonScriptqUPythonScriptqtqNt.}q(UPython_magicqU-
qUerrorsq)Uwarningsq)UScript_magicq KU_bodyq
T """
This script creates breadcrumb style navigation links.
It walks the REQUEST.PARENTS list of parents and creates
a hyperlink for each parent. It stops at the Examples folder.
"""
links=[]
for parent in context.REQUEST.PARENTS:
obj_id = parent.getId()
if not obj_id:
break
links.insert(0, """<a href="%s">%s</a>""" % (parent.absolute_url(), obj_id))
res = "/".join(links)
res = """<a href="%s">/</a>%s""" % (parent.absolute_url(), res)
return res
qU_codeqT c s d Z d S( Nc
s t } g } xz | | t d d D ]] }
| | d } | o Pn |
| d d d | | d | f q. W | d d | } d
| | d | f } | Sd S( Ns REQUESTs PARENTSs getIds inserti s <a href="%s">%s</a>s absolute_urls /s joins <a href="%s">/</a>%s( s _getattr_s _getattrs linkss contexts parents obj_ids res( s _getattr_s _getattrs linkss contexts parents obj_ids res( ( s Script (Python)s breadcrumbs.py s %0( s breadcrumbs.py( s breadcrumbs.py( ( s Script (Python)s <module> s q
U
func_defaultsqNU_bind_namesq(cShared.DC.Scripts.Bindings
NameAssignments
qoq}qU_asgnsq}q(Uname_containerqU containerqUname_m_selfqUscriptqUname_subpathqUtraverse_subpathqUname_contextqUcontextqusbU__ac_local_roles__q}qUamosq]q UOwnerq!asUidq"Ubreadcrumbs.pyq#U_paramsq$U U func_codeq%(cShared.DC.Scripts.Signature
FuncCode
q&oq'}q((Uco_varnamesq)(U _getattr_q*U_getattrq+Ulinksq,Ucontextq-Uparentq.Uobj_idq/Uresq0tUco_argcountq1K ubu. ((UProducts.PageDesign.PageDesignqU
PageDesignqtqNt.}q(U
_placementq(U q(UPersistenceqUPersistentMappingqttQU__ac_local_roles__q }q
Ushaneq]qUOwnerq
asUidqUdesignqUtemplate_idqUtop_pageqUtitleqUZopeTop Designqu. } ((U'Products.PageTemplates.ZopePageTemplateqUZopePageTemplateqtqNt.}q(Ucontent_typeqU text/htmlqU_textqT <div tal:define="box_title string:Metadata; box_id string:metadata">
<div metal:use-macro="here/box_template/macros/box">
<div metal:fill-slot="contents" class="boxcontent">
<form method="post" tal:attributes="value container/absolute_url">
<table>
<!--
<tr>
<td>Name</td>
<td>Value</td>
</tr>
-->
<tr tal:condition="exists:container/title">
<td>Title</td>
<td><input type="edit" size="10" name="title:string" tal:attributes="value container/title"></td>
</tr>
<!--
<tr>
<td># of objects</td>
<td tal:content="python:len(container.objectIds())">n</td>
</tr>
-->
<tr>
<td>Creator</td>
<td tal:define="owner container/owner_info" tal:content="owner/id"></td>
</tr>
<tr>
<td>Last Modified</td>
<td tal:content="container/formatItemDate"></td>
</tr>
<tr>
<td>Keywords</td>
<td>?</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="manage_changeProperties:method" value="Save Changes">
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
qU_bind_namesq (cShared.DC.Scripts.Bindings
NameAssignments
q
o}qU_asgnsq}q
Uname_subpathqUtraverse_subpathqssbUtitleqU U__ac_local_roles__q}qUsprintq]qUOwnerqasUidqUmetadata_boxqUexpandqK u. ((U'Products.PageTemplates.ZopePageTemplateqUZopePageTemplateqtqNt.}q(Ucontent_typeqU text/htmlqU_textqT <div tal:define="box_title string:Help; box_id string:help">
<div metal:use-macro="here/box_template/macros/box">
<div metal:fill-slot="contents" class="boxcontent">
<p>Voc est visualizando um objeto Folder.</p>
<p>Folders so os blocos de construo do Zope.
O objetivo de uma pasta conter outros
objetos, e organizar os objetos separando-os
em grupos diferentes.</p>
<p>Para maiores informaes,
consulte o <a href="http://www.zope.org/Documentation/ZopeBook/BasicObject.stx">Chapter 3: Using Basic Zope Objects</a>
do <a href="http://www.zope.org/Members/michel/ZB">Zope Book</a>.
</p>
</div>
</div>
</div>
qU_bind_namesq (cShared.DC.Scripts.Bindings
NameAssignments
q
oq}qU_asgnsq
}qUname_subpathqUtraverse_subpathqssbUtitleqU U__ac_local_roles__q}qUsprintq]qUOwnerqasUidqUhelp_boxqUexpandqK u. ((U OFS.ImageqUFileqtqNt.}q(UpreconditionqU Ucontent_typeqUtext/cssqUtitleqUZopeTop stylesheetq U__name__q
Uzopetop.cssqU_EtagSupport__etagqU
ts20554271.02q
UdataqT /****************************************************************
* generic
****************************************************************/
body {
font-family : Verdana, Arial, Geneva, Helvetica, sans-serif ;
font-size: 0.8em;
margin: 0;
padding: 0;
background-color: white;
font-family: Verdana, Helvetica, sans-serif;
font-size: 80%;
}
td {
font-size: 0.8em;
}
a {
color: blue;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
color: darkblue;
text-decoration: underline;
}
/****************************************************************
* specific
****************************************************************/
.userbar {
background-color: #6699cc;
color: white;
}
.zopelogo {
}
.usermenu {
text-align: right;
vertical-align: bottom;
padding: 0 0.5em;
}
.window {
padding: 0;
margin: 0;
border-collapse: separate;
width: 100%;
clear: both;
background-color: white;
}
.actions {
padding: 0.5em;
}
.actionbox {
margin-bottom: 1em;
border: 2px outset black;
width: 175px;
}
.objectwindow .actionbox {
float: right;
clear: right;
margin: 0.3em;
}
.objectwindow {
overflow: hidden;
}
.breadcrumbs {
width: 100%;
padding: 0 0.5em;
background-color: #c0c0c0;
}
.row_selected {
background-color: #e0e0e0;
}
.list_header {
background-color: #c0c0c0;
}
.column_header_up:after {
content: url("up.gif");
}
.column_header_down:after {
content: url("down.gif");
}
.boxtitle {
background-image: url("sidebox.gif");
background-repeat: none;
color: white;
text-weight: bold;
padding: 0 0.5em;
}
.boxcontrols {
float: right;
}
.boxcontent {
overflow: hidden;
width: 100%;
}
.hiddenboxcontent {
display: none;
}
/****************************************************************
* cosmetic
****************************************************************/
input {
border: 1px solid #6699cc;
background-color: white;
font-family : Verdana, Arial, Geneva, Helvetica, sans-serif ;
font-size: 0.8em;
}
select {
border: 1px solid #6699cc;
font-family : Verdana, Arial, Geneva, Helvetica, sans-serif ;
font-size: 0.8em;
}
qU__ac_local_roles__q}qUsprintq]qUOwnerqasUsizeqMu. { ((U#Products.PythonScripts.PythonScriptqUPythonScriptqtqNt.}q(UPython_magicqU-
qUerrorsq)Uwarningsq)UScript_magicq KU_bodyq
Uobject_date = context.bobobase_modification_time()
if object_date.isCurrentDay():
return object_date.strftime('%H:%M')
if object_date.isCurrentYear():
return object_date.strftime('%m-%d')
else:
return object_date.strftime('%Y-%m')
qU_codeqTY c s d Z d S( Nc s t } | t d } | | d o | | d d Sn | | d o | | d d Sn | | d d Sd S( Ns bobobase_modification_times isCurrentDays strftimes %H:%Ms
isCurrentYears %m-%ds %Y-%m( s _getattr_s _getattrs contexts object_date( s _getattr_s _getattrs contexts object_date( ( s Script (Python)s formatItemDate s
( s formatItemDate( s formatItemDate( ( s Script (Python)s <module> s q
U
func_defaultsqNU_bind_namesq(cShared.DC.Scripts.Bindings
NameAssignments
qoq}qU_asgnsq}q(Uname_containerqU containerqUname_contextqUcontextqUname_subpathqUtraverse_subpathqUname_m_selfqUscriptqusbU__ac_local_roles__q}qUsprintq]q UOwnerq!asUidq"UformatItemDateq#U_paramsq$U U func_codeq%(cShared.DC.Scripts.Signature
FuncCode
q&oq'}q((Uco_varnamesq)(U _getattr_q*U_getattrq+Ucontextq,Uobject_dateq-tUco_argcountq.K ubu. ((U OFS.ImageqUImageqtqNt.}q(UwidthqKUpreconditionqU Ucontent_typeqU image/gifqUtitleq U U__name__q
Udown.gifqUheightqKUdataq
U?GIF89a ! , hdat ;qU__ac_local_roles__q}qUsprintq]qUOwnerqasUsizeqK?u. | E((U#Products.PythonScripts.PythonScriptqUPythonScriptqtqNt.}q(UPython_magicqU-
qUerrorsq)Uwarningsq)UScript_magicq KU_bodyq
TC try:
size = context.getSize()
except:
try:
size = context.get_size()
except:
return ''
if size <= 1024:
return '1 Kb'
if size > 1024:
return '%s Kb' % (size / 1024)
if size > (1024*1024):
return '%s Mb' % (size / (1024*1024))
if size > (1024*1024*1024):
return '%s Gb' % (size / (1024*1024*1024))
qU_codeqT c s d Z d S( Nc s t } y | t d } Wn4 y | t d } Wn d Sn Xn X | d j o
d Sn | d j o
d | d Sn | d d j o d | d d Sn | d d d j o d | d d d Sn d S( Ns getSizes get_sizes i s 1 Kbs %s Kbs %s Mbs %s Gb( s _getattr_s _getattrs contexts size( s _getattr_s _getattrs contexts size( ( s Script (Python)s formatItemSize s ( s formatItemSize( s formatItemSize( ( s Script (Python)s <module> s q
U
func_defaultsqNU_bind_namesq(cShared.DC.Scripts.Bindings
NameAssignments
qoq}qU_asgnsq}q(Uname_containerqU containerqUname_m_selfqUscriptqUname_subpathqUtraverse_subpathqUname_contextqUcontextqusbU__ac_local_roles__q}qUsprintq]q UOwnerq!asUidq"UformatItemSizeq#U_paramsq$U U func_codeq%(cShared.DC.Scripts.Signature
FuncCode
q&oq'}q((Uco_varnamesq)(U _getattr_q*U_getattrq+Ucontextq,Usizeq-tUco_argcountq.K ubu. ~ (((U'Products.PageTemplates.ZopePageTemplateqUZopePageTemplateqtqNt.}q(Ucontent_typeqU text/htmlqU_textqU<div tal:define="box_title string:Search; box_id string:search">
<div metal:use-macro="here/box_template/macros/box">
<div metal:fill-slot="contents" class="boxcontent">
<p>Search for objects...</p>
</div>
</div>
</div>qU_bind_namesq (cShared.DC.Scripts.Bindings
NameAssignments
q
o}qU_asgnsq}q
Uname_subpathqUtraverse_subpathqssbUtitleqU U__ac_local_roles__q}qUsprintq]qUOwnerqasUidqU
search_boxqUexpandqK u. ((U OFS.ImageqUImageqtqNt.}q(UwidthqKUpreconditionqU Ucontent_typeqU image/gifqUtitleq U U__name__q
Uup.gifqUheightqKUdataq
U7GIF89a ! , { jZd[ ;qU__ac_local_roles__q}qUsprintq]qUOwnerqasUsizeqK7u. z M((U'Products.PageTemplates.ZopePageTemplateqUZopePageTemplateqtqNt.}q(Ucontent_typeqU text/htmlqU_textqT
<html metal:use-macro="here/top_page/macros/page">
<head>
<title tal:content="template/title">The title</title>
</head>
<body>
<div metal:fill-slot="main">
<SCRIPT TYPE="text/javascript">
function selectRow(obj) {
if (obj.className=="row_selected"){
obj.className = undefined;
}
else
{
obj.className="row_selected";
}
}
</SCRIPT>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td id="contentarea" valign="top">
<div>
<form action="http://127.0.0.1:9673/x3ng" method="post"></form>
<table width="100%" id="FolderContents" cellpadding="1" cellspacing="0">
<tr class="list_header" tal:define="items here/objectValues; b_start string:0; b_start request/b_start | b_start;Batch python:modules['ZTUtils'].Batch; global batch python:Batch(items, 30, int(b_start), orphan=0)" >
<td class="column_header_down"><a href="#"> </a></td>
<td class="column_header_down"><a href="#">Id</a></td>
<td class="column_header_down"><a href="#">Title</a></td>
<td class="column_header_down"><a href="#">Size</a></td>
<td class="column_header_down"><a href="#">Modified</a></td>
</tr>
<span tal:omit-tag="" tal:repeat="item batch">
<tr onclick="selectRow(this)">
<td align="center" tal:define="global icon item/getIcon|item/icon|nothing">
<span tal:omit-tag="" tal:condition="icon">
<a href="#" tal:attributes="href item/absolute_url">
<img src="" tal:attributes="src python:here.absolute_url() +'/'+ icon; alt item/Type|nothing" alt="Document" border="0"></a>
</span>
</td>
<td>
<a href="#" tal:attributes="href item/absolute_url"><span tal:omit-tag="" tal:content="item/getId">item</span></a>
</td>
<td>
<span tal:condition="item/title" tal:omit-tag="" tal:content="item/title">Title</span>
</td>
<td tal:content="string: ${item/formatItemSize}" tal:on-error="python: None">7,000 bytes</td>
<td tal:content="item/formatItemDate">2001-12-01 01:23:44</td>
</tr>
</span>
<tr>
<td colspan="5">
<div align="center"><a href="#"><<</a> <a href="#"><</a> 1-10 of 212 <a href="#">></a> <a href="#">>></a></div>
<div>
<span>
<input type="submit" name="folder_factories:method" value="New...">
</span>
<span>
<input type="submit" name="folder_rename_form:method" value="Rename">
<input type="submit" name="folder_cut:method" value="Cut">
<input type="submit" name="folder_copy:method" value="Copy">
</span>
<span>
<input type="submit" name="folder_delete:method" value="Delete">
</span>
<span>
<input type="submit" name="open_filter_form" value="Set View Filter">
</span>
</div>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
qU_bind_namesq (cShared.DC.Scripts.Bindings
NameAssignments
q
o}qU_asgnsq}q
Uname_subpathqUtraverse_subpathqssbUtitleqU U__ac_local_roles__q}qUshaneq]qUOwnerqasUidqUfolder_contentsqUexpandqK u. y <((U'Products.PageTemplates.ZopePageTemplateqUZopePageTemplateqtqNt.}q(Ucontent_typeqU text/htmlqU_textqU<div tal:define="box_title string:Explorer; box_id string:explorer">
<div metal:use-macro="here/box_template/macros/box">
<div metal:fill-slot="contents" class="boxcontent">
<p>Isso para ser o 'Explorer'... :-)</p>
</div>
</div>
</div>qU_bind_namesq (cShared.DC.Scripts.Bindings
NameAssignments
q
o}qU_asgnsq}q
Uname_subpathqUtraverse_subpathqssbUtitleqU U__ac_local_roles__q}qUsprintq]qUOwnerqasUidqUexplorer_boxqUexpandqK u. x ((U OFS.ImageqUImageqtqNt.}q(UwidthqKUpreconditionqU Ucontent_typeqU image/gifqUtitleq U U__name__q
U
expand.gifqUheightqKUdataq
UGIF89a !1*?0@R$7kv':?P` 1A>L[M\jlx!1J ! , : dihlp,6`RנּϦp"lR-2Bm utnxL ;qU__ac_local_roles__q}qUsprintq]qUOwnerqasUsizeqKu. u ((U'Products.PageTemplates.ZopePageTemplateqUZopePageTemplateqtqNt.}q(Ucontent_typeqU text/htmlqU_textqT <div metal:define-macro="box">
<div class="boxtitle" tal:define="box_title box_title|string:Title; box_id box_id|string:box">
<div class="boxcontrols">
<a href="#" tal:define="global collapsed python: request.SESSION.has_key(box_id)"
tal:attributes="href python: 'box_toggle?url=' + request['URL'] + '&box_id=' + box_id"
><img src="collapse.gif" border="0"
tal:attributes="src python: collapsed and 'expand.gif' or 'collapse.gif'" /></a>
</div>
<span tal:content="box_title">Title</span>
</div>
<div tal:condition="not: collapsed">
<div metal:define-slot="contents">
Box contents
</div>
</div>
</div>
qU_bind_namesq (cShared.DC.Scripts.Bindings
NameAssignments
q
o}qU_asgnsq}q
Uname_subpathqUtraverse_subpathqssbUtitleqU U__ac_local_roles__q}qUshaneq]qUOwnerqasUidqUbox_templateqUexpandqK u. ((U OFS.ImageqUImageqtqNt.}q(UwidthqKUpreconditionqU Ucontent_typeqU image/gifqUtitleq U U__name__q
Usidebox.gifqUheightqKUdataq
T GIF89a !1$Hk4O,Y+A3f>\(Pw/]:V1J%Jp':!Bc+U3f$7)R{#Eh7R0`.D&Ls;Y)Z ! , `!"e(,;pxtnp(%Ȥl:
(B&v;xX\)+ZhݐIŏ5598==@ACBFGJHN
RRUVX \[_`ccgfkosrvwx%z(|-26:>MQT]hlpt &./ǚdӦ'VpM,Zn2kIHڽ3,<̚Fje8PAY$$uMT"zp'c?*H`ʕu5|DKj^̘S'G~$Q&jو)̧X"I5NBn+ʰX*uLNŹjϬrqzqI-}o{p\T@mhȌRvj9MؽV4u&316uIzdLS0n
3G|[1]Wvl=+]4/Q^]|pgwȦ\~GhtUGp& Z[ɅaM+[!bmX`±|G"xAS[Zhݕဨ1YV^U'a+AF蛌%㈜8h"m٦,n)H|ˌbz8jf! ;qU__ac_local_roles__q}qUsprintq]qUOwnerqasUsizeqMu. w ((U OFS.ImageqUImageqtqNt.}q(UwidthqKUpreconditionqU Ucontent_!
typeqU image/gifqUtitleq U U__name__q
Ucollapse.gifqUheightqKUdataq
UGIF89a !1*?1AS$7lw':@Pa!1B?M\N\kly!1J ! , : dihlq&43-˽<:GD
$Vd=jҪzx
;qU__ac_local_roles__q}qUsprintq]qUOwnerqasUsizeqKu. ((UPersistenceqUPersistentMappingqtqNt.}qU
_containerq}q(Uglobal_panesq]q(Uexplorer_boxq U
search_boxq
eUobject_panesq]q(Uhelp_boxq
Umetadata_boxqeus.