2010-03-29 13:45:25 -05:00
|
|
|
<tal:comment replace="nothing">
|
|
|
|
This macro displays the content of the application portlet.
|
|
|
|
</tal:comment>
|
|
|
|
<metal:portletContent define-macro="portletContent"
|
2010-08-05 11:23:17 -05:00
|
|
|
tal:define="queryUrl python: '%s/skyn/query' % appFolder.absolute_url();
|
|
|
|
currentSearch request/search|nothing;
|
|
|
|
currentType request/type_name|nothing;
|
2010-09-17 08:32:48 -05:00
|
|
|
contextObj python: tool.getPublishedObject()">
|
2010-03-29 13:45:25 -05:00
|
|
|
<tal:comment replace="nothing">Portlet title, with link to tool.</tal:comment>
|
|
|
|
<dt class="portletHeader">
|
2010-10-14 07:43:56 -05:00
|
|
|
<tal:comment replace="nothing">For the Manager, clicking on the portlet
|
2010-03-29 13:45:25 -05:00
|
|
|
title allows to see all root objects in the database.</tal:comment>
|
|
|
|
<table cellpadding="0" cellspacing="0" width="100%">
|
|
|
|
<tr>
|
2010-09-20 04:33:54 -05:00
|
|
|
<td tal:define="titleIsClickable python: member.has_role('Manager') and rootClasses">
|
|
|
|
<a tal:condition="titleIsClickable"
|
2010-10-14 07:43:56 -05:00
|
|
|
tal:attributes="href python:'%s?type_name=%s' % (queryUrl, ','.join(rootClasses))"
|
2011-01-17 07:49:56 -06:00
|
|
|
tal:content="structure python: tool.translate(appName)"></a>
|
2010-09-20 04:33:54 -05:00
|
|
|
<span tal:condition="not: titleIsClickable"
|
2011-01-17 07:49:56 -06:00
|
|
|
tal:replace="structure python: tool.translate(appName)"/>
|
2010-03-29 13:45:25 -05:00
|
|
|
</td>
|
|
|
|
<td align="right">
|
|
|
|
<img style="cursor:pointer"
|
|
|
|
tal:condition="python: member.has_role('Manager')"
|
2010-09-17 08:32:48 -05:00
|
|
|
tal:attributes="onClick python: 'href: window.location=\'%s\'' % tool.getUrl(page='main', nav='');
|
2010-03-29 13:45:25 -05:00
|
|
|
title python: tool.translate('%sTool' % appName);
|
|
|
|
src string:$portal_url/skyn/appyConfig.gif"/>
|
|
|
|
</td>
|
|
|
|
</dt>
|
|
|
|
|
2010-12-17 07:46:55 -06:00
|
|
|
<tal:publishedObject condition="python: contextObj and contextObj.mayNavigate()">
|
2010-11-26 10:30:46 -06:00
|
|
|
<dt class="portletAppyItem portletCurrent"><b tal:content="contextObj/Title"></b></dt>
|
2010-08-05 11:23:17 -05:00
|
|
|
<dt class="portletAppyItem"><metal:phases use-macro="here/skyn/portlet/macros/phases"/></dt>
|
|
|
|
</tal:publishedObject>
|
2010-03-29 13:45:25 -05:00
|
|
|
|
|
|
|
<tal:comment replace="nothing">Create a section for every root class.</tal:comment>
|
2010-10-14 07:43:56 -05:00
|
|
|
<tal:section repeat="rootClass rootClasses">
|
2010-03-29 13:45:25 -05:00
|
|
|
<tal:comment replace="nothing">Section title, with action icons</tal:comment>
|
2010-09-20 04:33:54 -05:00
|
|
|
<dt tal:condition="python: tool.userMaySearch(rootClass)"
|
|
|
|
tal:attributes="class python:test((repeat['rootClass'].number()==1) and not contextObj, 'portletAppyItem', 'portletAppyItem portletSep')">
|
2010-03-29 13:45:25 -05:00
|
|
|
<table width="100%" cellspacing="0" cellpadding="0" class="no-style-table">
|
|
|
|
<tr>
|
|
|
|
<td>
|
2010-10-14 07:43:56 -05:00
|
|
|
<a tal:attributes="href python: '%s?type_name=%s' % (queryUrl, rootClass);
|
2010-03-29 13:45:25 -05:00
|
|
|
class python:test(not currentSearch and (currentType==rootClass), 'portletCurrent', '')"
|
2011-01-17 07:49:56 -06:00
|
|
|
tal:content="structure python: tool.translate(rootClass + '_plural')"></a>
|
2010-03-29 13:45:25 -05:00
|
|
|
</td>
|
|
|
|
<td align="right"
|
|
|
|
tal:define="addPermission python: '%s: Add %s' % (appName, rootClass);
|
2010-09-20 04:33:54 -05:00
|
|
|
userMayAdd python: member.has_permission(addPermission, appFolder);
|
2010-03-29 13:45:25 -05:00
|
|
|
createMeans python: tool.getCreateMeans(rootClass)">
|
|
|
|
<tal:comment replace="nothing">Create a new object from a web form</tal:comment>
|
|
|
|
<img style="cursor:pointer"
|
|
|
|
tal:condition="python: ('form' in createMeans) and userMayAdd"
|
|
|
|
tal:attributes="onClick python: 'href: window.location=\'%s/skyn/do?action=Create&type_name=%s\'' % (appFolder.absolute_url(), rootClass);
|
|
|
|
src string: $portal_url/skyn/plus.png;
|
|
|
|
title python: tool.translate('query_create')"/>
|
|
|
|
<tal:comment replace="nothing">Create (a) new object(s) by importing data</tal:comment>
|
|
|
|
<img style="cursor:pointer"
|
|
|
|
tal:condition="python: ('import' in createMeans) and userMayAdd"
|
|
|
|
tal:attributes="onClick python: 'href: window.location=\'%s/skyn/import?type_name=%s\'' % (appFolder.absolute_url(), rootClass);
|
|
|
|
src string: $portal_url/skyn/import.png;
|
|
|
|
title python: tool.translate('query_import')"/>
|
2010-10-14 07:43:56 -05:00
|
|
|
<tal:comment replace="nothing">Search objects of this type</tal:comment>
|
2010-03-29 13:45:25 -05:00
|
|
|
<img style="cursor:pointer"
|
2010-10-14 07:43:56 -05:00
|
|
|
tal:define="showSearch python: tool.getAttr('enableAdvancedSearchFor%s' % rootClass)"
|
2010-03-29 13:45:25 -05:00
|
|
|
tal:condition="showSearch"
|
2010-10-14 07:43:56 -05:00
|
|
|
tal:attributes="onClick python: 'href: window.location=\'%s/skyn/search?type_name=%s\'' % (appFolder.absolute_url(), rootClass);
|
2010-03-29 13:45:25 -05:00
|
|
|
src string: $portal_url/skyn/search.gif;
|
|
|
|
title python: tool.translate('search_objects')"/>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</dt>
|
|
|
|
<tal:comment replace="nothing">Searches for this content type.</tal:comment>
|
|
|
|
<tal:searchOrGroup repeat="searchOrGroup python: tool.getSearches(rootClass)">
|
|
|
|
<tal:group condition="searchOrGroup/isGroup">
|
|
|
|
<tal:expanded define="group searchOrGroup;
|
|
|
|
expanded python: tool.getCookieValue(group['labelId'], default='collapsed') == 'expanded'">
|
|
|
|
<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'];
|
|
|
|
src python:test(expanded, 'skyn/collapse.gif', 'skyn/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">
|
2010-10-14 07:43:56 -05:00
|
|
|
<a tal:attributes="href python: '%s?type_name=%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">
|
|
|
|
|
2010-10-14 07:43:56 -05:00
|
|
|
<a tal:attributes="href python: '%s?type_name=%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>
|
|
|
|
</tal:searchOrGroup>
|
|
|
|
</tal:section>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">
|
|
|
|
Greyed transparent zone that is deployed on the
|
|
|
|
whole screen when a popup is displayed.
|
|
|
|
</tal:comment>
|
|
|
|
<div id="appyGrey" class="appyGrey"></div>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Popup for confirming an action</tal:comment>
|
|
|
|
<div id="confirmActionPopup" class="appyPopup">
|
|
|
|
<form id="confirmActionForm" method="post">
|
|
|
|
<div align="center">
|
2010-10-14 07:43:56 -05:00
|
|
|
<p id="appyConfirmText"></p>
|
|
|
|
<input type="hidden" name="actionType"/>
|
|
|
|
<input type="hidden" name="action"/>
|
2010-09-17 08:32:48 -05:00
|
|
|
<input type="button" onClick="doConfirm()"
|
2010-03-29 13:45:25 -05:00
|
|
|
tal:attributes="value python:tool.translate('yes')"/>
|
2010-09-17 08:32:48 -05:00
|
|
|
<input type="button" value="No" onClick="closePopup('confirmActionPopup')"
|
2010-03-29 13:45:25 -05:00
|
|
|
tal:attributes="value python:tool.translate('no')"/>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</metal:portletContent>
|
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>
|
|
|
|
<metal:phases define-macro="phases">
|
2010-09-17 08:32:48 -05:00
|
|
|
<table tal:define="phases contextObj/getAppyPhases|nothing;
|
2010-08-05 11:23:17 -05:00
|
|
|
page python: request.get('page', 'main')"
|
|
|
|
tal:condition="python: phases and not ((len(phases)==1) and len(phases[0]['pages'])==1)"
|
2010-09-13 14:04:10 -05:00
|
|
|
cellspacing="1" cellpadding="2" 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>
|
|
|
|
<tr>
|
|
|
|
<td tal:define="label python:'%s_phase_%s' % (contextObj.meta_type, phase['name']);
|
|
|
|
displayLink python: (phase['phaseStatus'] != 'Future') and ('/portal_factory' not in contextObj.absolute_url()) and (len(phase['pages']) == 1)"
|
2010-08-12 04:56:42 -05:00
|
|
|
tal:attributes="class python: (len(phases) > 1) and ('appyPhase step%s' % phase['phaseStatus']) or 'appyPhase'">
|
2010-09-13 14:04:10 -05:00
|
|
|
<div class="portletGroup" tal:condition="python: len(phases) > 1">
|
2010-09-17 08:32:48 -05:00
|
|
|
|
|
|
|
<tal:comment replace="nothing">A single page in the phase</tal:comment>
|
|
|
|
<table tal:condition="displayLink" cellpadding="0" cellspacing="0" width="100%">
|
|
|
|
<tr tal:define="pageName python: phase['pages'][0]">
|
|
|
|
<td><a tal:attributes="href python: contextObj.getUrl(page=pageName)"
|
2011-01-17 07:49:56 -06:00
|
|
|
tal:content="structure python: tool.translate(label)"></a>
|
2010-09-17 08:32:48 -05:00
|
|
|
</td>
|
|
|
|
<td align="right">
|
|
|
|
<img title="Edit" i18n:domain="plone" i18n:attributes="title" style="cursor:pointer"
|
|
|
|
tal:attributes="onClick python: 'href: window.location=\'%s\'' % contextObj.getUrl(mode='edit', page=pageName);
|
|
|
|
src string: $portal_url/skyn/edit.gif"
|
2010-10-19 03:47:42 -05:00
|
|
|
tal:condition="python: member.has_permission('Modify portal content', contextObj) and phase['pagesInfo'][pageName]['showOnEdit']"/>
|
2010-09-17 08:32:48 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<tal:comment replace="nothing">Several pages in the phase</tal:comment>
|
2011-01-17 07:49:56 -06:00
|
|
|
<span tal:condition="not: displayLink" tal:replace="structure python: tool.translate(label)"/>
|
2010-09-13 14:04:10 -05:00
|
|
|
</div>
|
|
|
|
<div class="portletMenu">
|
2010-09-17 08:32:48 -05:00
|
|
|
<table cellpadding="0" cellspacing="0" width="100%"
|
2010-08-05 11:23:17 -05:00
|
|
|
tal:condition="python: len(phase['pages']) > 1">
|
|
|
|
<tr tal:repeat="aPage phase/pages" valign="top">
|
|
|
|
<td tal:attributes="class python: test(aPage == page, 'portletCurrent portletPageItem', 'portletPageItem')">
|
2010-09-17 08:32:48 -05:00
|
|
|
<a tal:attributes="href python: contextObj.getUrl(page=aPage)"
|
2010-08-05 11:23:17 -05:00
|
|
|
tal:content="structure python: tool.translate('%s_page_%s' % (contextObj.meta_type, aPage))">
|
|
|
|
</a>
|
|
|
|
</td>
|
2010-09-02 09:16:08 -05:00
|
|
|
<td align="right">
|
2010-09-17 08:32:48 -05:00
|
|
|
<img title="Edit" i18n:domain="plone" i18n:attributes="title" style="cursor:pointer"
|
|
|
|
tal:attributes="onClick python: 'href: window.location=\'%s\'' % contextObj.getUrl(mode='edit', page=aPage);
|
|
|
|
src string: $portal_url/skyn/edit.gif"
|
2010-10-19 03:47:42 -05:00
|
|
|
tal:condition="python: member.has_permission('Modify portal content', contextObj) and phase['pagesInfo'][aPage]['showOnEdit']"/>
|
2010-08-05 11:23:17 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2010-09-13 14:04:10 -05:00
|
|
|
</div>
|
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']">
|
|
|
|
<td> <img tal:attributes="src string: $portal_url/skyn/nextPhase.png"/></td>
|
|
|
|
</tr>
|
|
|
|
</tal:phase>
|
|
|
|
</table>
|
|
|
|
</metal:phases>
|