2010-03-29 13:45:25 -05:00
|
|
|
<tal:comment replace="nothing">
|
|
|
|
This macro displays the content of the application portlet.
|
|
|
|
</tal:comment>
|
2011-09-18 08:00:05 -05:00
|
|
|
<metal:portlet define-macro="portlet"
|
2011-11-25 11:01:20 -06:00
|
|
|
tal:define="queryUrl python: '%s/ui/query' % tool.absolute_url();
|
2011-09-18 08:00:05 -05:00
|
|
|
toolUrl tool/absolute_url;
|
|
|
|
currentSearch req/search|nothing;
|
2011-11-25 11:01:20 -06:00
|
|
|
currentClass req/className|nothing;
|
2011-09-18 08:00:05 -05:00
|
|
|
contextObj tool/getPublishedObject;
|
|
|
|
rootClasses tool/getRootClasses">
|
2010-03-29 13:45:25 -05:00
|
|
|
|
2012-02-23 08:58:06 -06:00
|
|
|
<div class="portletContent" tal:condition="python: contextObj and contextObj.mayNavigate()">
|
|
|
|
<div class="portletTitle" tal:define="parent contextObj/getParent">
|
|
|
|
<span tal:replace="contextObj/Title"></span>
|
|
|
|
<div style="float:right" tal:condition="python: parent">
|
|
|
|
<a tal:attributes="href parent/absolute_url">
|
|
|
|
<img tal:attributes="src string: $appUrl/ui/gotoSource.png"/>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
2012-03-27 03:37:41 -05:00
|
|
|
<metal:phases use-macro="here/ui/portlet/macros/phases"/>
|
2012-02-23 08:58:06 -06:00
|
|
|
</div>
|
2011-09-18 08:00:05 -05:00
|
|
|
|
2012-02-23 08:58:06 -06:00
|
|
|
<tal:comment replace="nothing">One section for every searchable root class.</tal:comment>
|
|
|
|
<tal:section repeat="rootClass python: [rc for rc in rootClasses if tool.userMaySearch(rc)]">
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">A separator if required</tal:comment>
|
|
|
|
<div class="portletSep" tal:define="nb repeat/rootClass/number"
|
|
|
|
tal:condition="python: (nb == 1 and contextObj) or (nb != 1)"></div>
|
|
|
|
|
|
|
|
<div class="portletContent">
|
|
|
|
<tal:comment replace="nothing">Section title, with action icons</tal:comment>
|
|
|
|
<a tal:attributes="href python: '%s?className=%s' % (queryUrl, rootClass);
|
|
|
|
class python:test(not currentSearch and (currentClass==rootClass), 'portletCurrent', '')"
|
|
|
|
tal:content="structure python: _(rootClass + '_plural')">
|
|
|
|
</a>
|
|
|
|
<div style="float: right"
|
|
|
|
tal:define="addPermission python: '%s: Add %s' % (appName, rootClass);
|
|
|
|
userMayAdd python: user.has_permission(addPermission, appFolder);
|
|
|
|
createMeans python: tool.getCreateMeans(rootClass)">
|
|
|
|
<tal:comment replace="nothing">Create a new object from a web form</tal:comment>
|
|
|
|
<a tal:condition="python: ('form' in createMeans) and userMayAdd"
|
|
|
|
tal:attributes="href python: '%s/do?action=Create&className=%s' % (toolUrl, rootClass);
|
|
|
|
title python: _('query_create')">
|
|
|
|
<img tal:attributes="src string: $appUrl/ui/plus.png"/>
|
|
|
|
</a>
|
|
|
|
<tal:comment replace="nothing">Create (a) new object(s) by importing data</tal:comment>
|
|
|
|
<a tal:condition="python: ('import' in createMeans) and userMayAdd"
|
|
|
|
tal:attributes="href python: '%s/ui/import?className=%s' % (toolUrl, rootClass);
|
|
|
|
title python: _('query_import')">
|
|
|
|
<img tal:attributes="src string: $appUrl/ui/import.png"/>
|
|
|
|
</a>
|
|
|
|
<tal:comment replace="nothing">Search objects of this type</tal:comment>
|
|
|
|
<a tal:define="showSearch python: tool.getAttr('enableAdvancedSearchFor%s' % rootClass)"
|
|
|
|
tal:condition="showSearch"
|
|
|
|
tal:attributes="href python: '%s/ui/search?className=%s' % (toolUrl, rootClass);
|
|
|
|
title python: _('search_objects')">
|
|
|
|
<img tal:attributes="src string: $appUrl/ui/search.gif"/>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<tal:comment replace="nothing">Searches for this content type.</tal:comment>
|
2010-03-29 13:45:25 -05:00
|
|
|
<tal:searchOrGroup repeat="searchOrGroup python: tool.getSearches(rootClass)">
|
|
|
|
<tal:group condition="searchOrGroup/isGroup">
|
|
|
|
<tal:expanded define="group searchOrGroup;
|
2011-10-01 15:40:13 -05:00
|
|
|
expanded python: request.get(group['labelId'], 'collapsed') == 'expanded'">
|
2010-03-29 13:45:25 -05:00
|
|
|
<tal:comment replace="nothing">Group name</tal:comment>
|
|
|
|
<dt class="portletAppyItem portletGroup">
|
|
|
|
<img align="left" style="cursor:pointer"
|
|
|
|
tal:attributes="id python: '%s_img' % group['labelId'];
|
2011-11-25 11:01:20 -06:00
|
|
|
src python:test(expanded, 'ui/collapse.gif', 'ui/expand.gif');
|
2010-09-17 08:32:48 -05:00
|
|
|
onClick python:'toggleCookie(\'%s\')' % group['labelId']"/>
|
2010-03-29 13:45:25 -05:00
|
|
|
<span tal:replace="group/label"/>
|
|
|
|
</dt>
|
|
|
|
<tal:comment replace="nothing">Group searches</tal:comment>
|
|
|
|
<span tal:attributes="id group/labelId;
|
|
|
|
style python:test(expanded, 'display:block', 'display:none')">
|
|
|
|
<dt class="portletAppyItem portletSearch portletGroupItem" tal:repeat="search group/searches">
|
2011-11-25 11:01:20 -06:00
|
|
|
<a tal:attributes="href python: '%s?className=%s&search=%s' % (queryUrl, rootClass, search['name']);
|
2010-03-29 13:45:25 -05:00
|
|
|
title search/descr;
|
|
|
|
class python: test(search['name'] == currentSearch, 'portletCurrent', '');"
|
|
|
|
tal:content="structure search/label"></a>
|
|
|
|
</dt>
|
|
|
|
</span>
|
|
|
|
</tal:expanded>
|
|
|
|
</tal:group>
|
|
|
|
<dt tal:define="search searchOrGroup" tal:condition="not: searchOrGroup/isGroup"
|
|
|
|
class="portletAppyItem portletSearch">
|
|
|
|
|
2011-11-25 11:01:20 -06:00
|
|
|
<a tal:attributes="href python: '%s?className=%s&search=%s' % (queryUrl, rootClass, search['name']);
|
2010-03-29 13:45:25 -05:00
|
|
|
title search/descr;
|
|
|
|
class python: test(search['name'] == currentSearch, 'portletCurrent', '');"
|
|
|
|
tal:content="structure search/label"></a>
|
|
|
|
</dt>
|
2012-02-23 08:58:06 -06:00
|
|
|
</tal:searchOrGroup>
|
2010-03-29 13:45:25 -05:00
|
|
|
</tal:section>
|
2011-09-18 08:00:05 -05:00
|
|
|
</metal:portlet>
|
2010-08-05 11:23:17 -05:00
|
|
|
|
|
|
|
<tal:comment replace="nothing">
|
|
|
|
This macro displays, within the portlet, the navigation tree for the
|
|
|
|
currently shown object, made of phases and contained pages.
|
|
|
|
</tal:comment>
|
2012-03-27 03:37:41 -05:00
|
|
|
<table metal:define-macro="phases"
|
|
|
|
tal:define="phases contextObj/getAppyPhases|nothing;
|
2011-10-06 09:27:58 -05:00
|
|
|
singlePhase python: len(phases) == 1;
|
2011-09-18 08:00:05 -05:00
|
|
|
page python: req.get('page', 'main')"
|
2012-03-27 03:37:41 -05:00
|
|
|
tal:condition="python: phases" width="100%">
|
2010-08-05 11:23:17 -05:00
|
|
|
<tal:phase repeat="phase phases">
|
|
|
|
<tal:comment replace="nothing">The box containing phase-related information</tal:comment>
|
2012-03-27 08:49:41 -05:00
|
|
|
<tr tal:define="singlePage python: len(phase['pages']) == 1">
|
2010-08-05 11:23:17 -05:00
|
|
|
<td tal:define="label python:'%s_phase_%s' % (contextObj.meta_type, phase['name']);
|
2011-10-06 09:27:58 -05:00
|
|
|
status phase/phaseStatus;
|
2012-03-27 03:37:41 -05:00
|
|
|
phaseCss python: (status == 'Current') and ' phaseSelected' or '';"
|
2011-10-06 09:27:58 -05:00
|
|
|
tal:attributes="class python: not singlePhase and 'phase%s' % phaseCss or ''">
|
2012-03-27 03:37:41 -05:00
|
|
|
<tal:comment replace="nothing">The title of the phase</tal:comment>
|
2012-03-27 08:49:41 -05:00
|
|
|
<div class="portletGroup" tal:condition="python: not singlePhase and not singlePage"
|
2012-03-27 03:37:41 -05:00
|
|
|
tal:content="structure python: _(label)">
|
|
|
|
</div>
|
|
|
|
<tal:comment replace="nothing">The page(s) within the phase</tal:comment>
|
2012-03-27 08:49:41 -05:00
|
|
|
<table width="100%" cellpadding="0">
|
2012-03-27 03:37:41 -05:00
|
|
|
<tal:page repeat="aPage phase/pages">
|
|
|
|
<tal:comment replace="nothing">1st line: page name and icons</tal:comment>
|
2012-03-27 08:49:41 -05:00
|
|
|
<tr valign="top" tal:condition="python: not (singlePhase and singlePage)">
|
2012-03-27 03:37:41 -05:00
|
|
|
<td tal:attributes="class python: test(aPage == page, 'portletCurrent portletPage', 'portletPage')">
|
|
|
|
<a tal:attributes="href python: contextObj.getUrl(page=aPage)"
|
|
|
|
tal:content="structure python: _('%s_page_%s' % (contextObj.meta_type, aPage))">
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
<td align="right">
|
|
|
|
<img title="Edit" style="cursor:pointer"
|
|
|
|
tal:attributes="onClick python: 'href: window.location=\'%s\'' % contextObj.getUrl(mode='edit', page=aPage);
|
|
|
|
src string: $appUrl/ui/edit.gif"
|
|
|
|
tal:condition="python: contextObj.allows('Modify portal content') and phase['pagesInfo'][aPage]['showOnEdit']"/>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tal:comment replace="nothing">2nd line: links</tal:comment>
|
|
|
|
<tal:links define="links python: phase['pagesInfo'][aPage].get('links')" tal:condition="links">
|
|
|
|
<tr tal:repeat="link links">
|
|
|
|
<td><a tal:content="link/title" tal:attributes="href link/url"></a></td>
|
2010-08-05 11:23:17 -05:00
|
|
|
</tr>
|
2012-03-27 03:37:41 -05:00
|
|
|
</tal:links>
|
|
|
|
</tal:page>
|
|
|
|
</table>
|
2010-08-05 11:23:17 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tal:comment replace="nothing">The down arrow pointing to the next phase (if any)</tal:comment>
|
|
|
|
<tr tal:condition="python: phase['name'] != phases[-1]['name']">
|
2011-11-25 11:01:20 -06:00
|
|
|
<td> <img tal:attributes="src string: $appUrl/ui/nextPhase.png"/></td>
|
2010-08-05 11:23:17 -05:00
|
|
|
</tr>
|
|
|
|
</tal:phase>
|
|
|
|
</table>
|