Added the possibility to define POD templates for any search result (Pod field with param view='search'), bugfix while getting default value for a Ref field, added Computed fields that computes a ZPT macro given as a string to param 'method', added the possibility to define a global style mapping for every Pod field, stopped to generate a field-specific set of i18n labels for pod output formats, carry portal_status_message even through page redirections, added 'deprecatedAddRemove' tags in generated configure.zcml, onEdit can now return a customized message, added possibility to normalize strings for other usages than 'fileName', in appy.shared.utils.normalizeString (for alpha and alphanum usages)
This commit is contained in:
parent
38f71be89a
commit
90553381a3
18 changed files with 250 additions and 59 deletions
13
gen/plone25/skin/callMacro.pt
Normal file
13
gen/plone25/skin/callMacro.pt
Normal file
|
@ -0,0 +1,13 @@
|
|||
<tal:comment replace="nothing">
|
||||
This page allows to call any macro from Python code, for example.
|
||||
</tal:comment>
|
||||
<tal:call tal:define="macroName options/macroName;
|
||||
page python: options['page'];
|
||||
contextObj python: options['contextObj'];
|
||||
tool python: contextObj.getTool();
|
||||
layoutType python:'view';
|
||||
putils python: contextObj.plone_utils;
|
||||
portal python: contextObj.portal_url.getPortalObject();
|
||||
portal_url python: contextObj.portal_url();">
|
||||
<metal:callMacro use-macro="python: page.macros[macroName]"/>
|
||||
</tal:call>
|
|
@ -141,7 +141,7 @@
|
|||
params['filterValue'] = filterWidget.value;
|
||||
}
|
||||
}
|
||||
askAjaxChunk(hookId,'GET',objectUrl,'macros','queryResult',params);
|
||||
askAjaxChunk(hookId,'GET',objectUrl, 'result', 'queryResult', params);
|
||||
}
|
||||
|
||||
function askObjectHistory(hookId, objectUrl, startNumber) {
|
||||
|
@ -244,12 +244,13 @@
|
|||
createCookie(cookieId, newState);
|
||||
}
|
||||
// Function that allows to generate a document from a pod template.
|
||||
function generatePodDocument(contextUid, fieldName, podFormat) {
|
||||
function generatePodDocument(contextUid, fieldName, podFormat, queryData) {
|
||||
var theForm = document.getElementsByName("podTemplateForm")[0];
|
||||
theForm.objectUid.value = contextUid;
|
||||
theForm.fieldName.value = fieldName;
|
||||
theForm.podFormat.value = podFormat;
|
||||
theForm.askAction.value = "False";
|
||||
theForm.queryData.value = queryData;
|
||||
var askActionWidget = document.getElementById(contextUid + '_' + fieldName);
|
||||
if (askActionWidget && askActionWidget.checked) {
|
||||
theForm.askAction.value = "True";
|
||||
|
@ -376,6 +377,7 @@
|
|||
<input type="hidden" name="fieldName"/>
|
||||
<input type="hidden" name="podFormat"/>
|
||||
<input type="hidden" name="askAction"/>
|
||||
<input type="hidden" name="queryData"/>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
@ -536,6 +538,7 @@
|
|||
</tal:comment>
|
||||
<div metal:define-macro="header"
|
||||
tal:define="showCommonInfo python: layoutType == 'view';
|
||||
showWorkflow python: tool.getAttr('showWorkflowFor' + contextObj.meta_type);
|
||||
hasHistory contextObj/hasHistory;
|
||||
historyExpanded python: tool.getCookieValue('appyHistory', default='collapsed') == 'expanded';
|
||||
creator contextObj/Creator"
|
||||
|
@ -717,7 +720,7 @@
|
|||
<metal:message define-macro="message" i18n:domain="plone" >
|
||||
<tal:comment replace="nothing">Single message from portal_status_message request key</tal:comment>
|
||||
<div tal:define="msg request/portal_status_message | nothing"
|
||||
tal:condition="msg" class="portalMessage" tal:content="msg" i18n:translate=""></div>
|
||||
tal:condition="msg" class="portalMessage" tal:content="structure msg" i18n:translate=""></div>
|
||||
|
||||
<tal:comment replace="nothing">Messages added via plone_utils</tal:comment>
|
||||
<tal:messages define="messages putils/showPortalMessages" condition="messages">
|
||||
|
|
|
@ -34,9 +34,20 @@
|
|||
</tal:newSearch>
|
||||
</legend>
|
||||
|
||||
<tal:comment replace="nothing">Display here POD templates if required.</tal:comment>
|
||||
<table align="right" cellpadding="0" cellspacing="0"
|
||||
tal:define="widgets python: tool.getResultPodFields(contentType);
|
||||
layoutType python:'view'"
|
||||
tal:condition="python: objs and widgets">
|
||||
<tr><td tal:define="contextObj python: objs[0]"
|
||||
tal:repeat="widget widgets">
|
||||
<metal:pod use-macro="here/skyn/widgets/show/macros/field"/>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
<table cellpadding="0" cellspacing="0" width="100%"><tr>
|
||||
<td tal:define="descr python: tool.translate(searchDescr)"
|
||||
tal:condition="python: searchName and descr">
|
||||
tal:condition="python: searchName and descr.strip()">
|
||||
<span class="discreet" tal:content="descr"></span><br/><br/>
|
||||
</td>
|
||||
<td align="right" width="25%">
|
|
@ -25,8 +25,7 @@
|
|||
appName appFolder/getId;
|
||||
phaseInfo python: contextObj.getAppyPhases(currentOnly=True, layoutType='view');
|
||||
page request/page|python:'main';
|
||||
phase phaseInfo/name;
|
||||
showWorkflow python: tool.getAttr('showWorkflowFor' + contextObj.meta_type)">
|
||||
phase phaseInfo/name;">
|
||||
<metal:prologue use-macro="here/skyn/page/macros/prologue"/>
|
||||
<metal:show use-macro="here/skyn/page/macros/show"/>
|
||||
<metal:footer use-macro="here/skyn/page/macros/footer"/>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</tal:askAction>
|
||||
<img tal:repeat="podFormat python: tool.getPodInfo(contextObj, name)['formats']"
|
||||
tal:attributes="src string: $portal_url/skyn/${podFormat}.png;
|
||||
onClick python: 'generatePodDocument(\'%s\',\'%s\',\'%s\')' % (contextObj.UID(), name, podFormat);
|
||||
onClick python: 'generatePodDocument(\'%s\',\'%s\',\'%s\',\'%s\')' % (contextObj.UID(), name, podFormat, tool.getQueryInfo());
|
||||
title podFormat/capitalize"
|
||||
style="cursor:pointer"/>
|
||||
</metal:view>
|
||||
|
|
|
@ -239,8 +239,9 @@
|
|||
refUids python: [o.UID() for o in contextObj.getAppyRefs(name)['objects']];
|
||||
isBeingCreated python: contextObj.isTemporary() or ('/portal_factory/' in contextObj.absolute_url())">
|
||||
|
||||
<select tal:attributes="name rname; size widget/height;
|
||||
multiple python: isMultiple and 'multiple' or ''">
|
||||
<select tal:attributes="name rname;
|
||||
size python: test(isMultiple, widget['height'], '');
|
||||
multiple python: test(isMultiple, 'multiple', '')">
|
||||
<option tal:condition="not: isMultiple" i18n:translate="choose_a_value"></option>
|
||||
<tal:ref repeat="refObj allObjects">
|
||||
<option tal:define="uid python: contextObj.getReferenceUid(refObj)"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
layout The layout object that will dictate how object content
|
||||
will be rendered.
|
||||
Options:
|
||||
contextMacro The base on folder containing the macros to call for
|
||||
contextMacro The base folder containing the macros to call for
|
||||
rendering the elements within the layout.
|
||||
Defaults to portal.skyn
|
||||
</tal:comment>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue