[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/ZMI/www - view_macros.pt:1.7
Jim Fulton
jim@zope.com
Fri, 20 Dec 2002 18:00:28 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZMI/www
In directory cvs.zope.org:/tmp/cvs-serv5764/lib/python/Zope/App/ZMI/www
Modified Files:
view_macros.pt
Log Message:
Refactored the way browser menus are made available to views.
- Added a new view, view_get_menu, for accessing menus.
From zpt, do something like:
tal:repeat="view context/@@view_get_menu/zmi_views"
- Changed existing templates to get the "zmi_views" menu this way.
- Added a new "zmi_actions" and incorporated it into the default skin.
See "view_macros.pt".
- Ripped out the no-longer-needed ZMIViews utility.
=== Zope3/lib/python/Zope/App/ZMI/www/view_macros.pt 1.6 => 1.7 ===
--- Zope3/lib/python/Zope/App/ZMI/www/view_macros.pt:1.6 Thu Dec 12 15:37:39 2002
+++ Zope3/lib/python/Zope/App/ZMI/www/view_macros.pt Fri Dec 20 18:00:27 2002
@@ -27,16 +27,32 @@
tal:content="string: ${breadcrumb/name} / "
>name</a> </span>
- <table metal:define-macro="zmi_tabs"><tr>
- <td tal:repeat="view views/standard_macros/getZMIViews">
+ <table metal:define-macro="zmi_tabs"
+ frame="void" border="1" cellpadding="5"><tr>
+ <td tal:repeat="view context/@@view_get_menu/zmi_views">
<a href="" tal:attributes="href view/action" tal:content="view/title">
label</a>
- <tal:block condition="not: repeat/view/end">'</tal:block>
</td>
</tr></table>
<div metal:define-slot="body">
<p>Body here</p>
+ </div>
+
+ <div metal:define-macro="actions_menu"
+ tal:define="actions context/@@view_get_menu/zmi_actions"
+ tal:condition="actions"
+ >
+ Actions:
+ <ul>
+ <li tal:repeat="action actions">
+ <a href="."
+ tal:attributes="href action/action"
+ tal:content="action/title"
+ >Do something
+ </a>
+ </li>
+ </ul>
</div>
<div metal:define-macro="logged_user">