Eradicated Flavour and PodTemplate classes (for the latter, use Pod fields instead); Added a code analyser; Groups can now be slaves in master/slaves relationships; Refs have more params (show a confirmation popup before adding an object, add an object without creation form); Code for Refs has been refactored to comply with the new way to organize Types; Added a WebDAV client library.
This commit is contained in:
parent
9f4db88bdf
commit
990e16c6e7
47 changed files with 1006 additions and 1297 deletions
|
@ -11,7 +11,7 @@
|
|||
response request/RESPONSE;
|
||||
member context/portal_membership/getAuthenticatedMember;
|
||||
portal context/portal_url/getPortalObject;
|
||||
portal_url context/portal_url/getPortalPath;
|
||||
portal_url python: context.portal_url();
|
||||
template python: contextObj.getPageTemplate(portal.skyn, page);
|
||||
dummy python: response.setHeader('Content-Type','text/html;;charset=utf-8');
|
||||
dummy2 python: response.setHeader('Expires', 'Mon, 11 Dec 1975 12:05:05 GMT');
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
layoutType python:'edit';
|
||||
layout python: contextObj.getPageLayout(layoutType);
|
||||
tool contextObj/getTool;
|
||||
flavour python: tool.getFlavour(contextObj);
|
||||
appFolder tool/getAppFolder;
|
||||
appName appFolder/getId;
|
||||
page request/page|python:'main';
|
||||
|
|
|
@ -16,8 +16,7 @@
|
|||
tal:define="appFolder context/getParentNode;
|
||||
contentType request/type_name;
|
||||
tool python: portal.get('portal_%s' % appFolder.id.lower());
|
||||
flavour python: tool.getFlavour(contentType);
|
||||
importElems python: flavour.getImportElements(contentType);
|
||||
importElems python: tool.getImportElements(contentType);
|
||||
global allAreImported python:True">
|
||||
|
||||
<div metal:use-macro="here/skyn/page/macros/prologue"/>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<metal:queryResults define-macro="queryResult"
|
||||
tal:define="tool python: contextObj;
|
||||
contentType request/type_name;
|
||||
flavourNumber python: int(request['flavourNumber']);
|
||||
startNumber request/startNumber|python:'0';
|
||||
startNumber python: int(startNumber);
|
||||
searchName request/search;
|
||||
|
@ -12,13 +11,13 @@
|
|||
sortOrder request/sortOrder| python:'asc';
|
||||
filterKey request/filterKey| python:'';
|
||||
filterValue request/filterValue | python:'';
|
||||
queryResult python: tool.executeQuery(contentType, flavourNumber, searchName, startNumber, remember=True, sortBy=sortKey, sortOrder=sortOrder, filterKey=filterKey, filterValue=filterValue);
|
||||
queryResult python: tool.executeQuery(contentType, searchName, startNumber, remember=True, sortBy=sortKey, sortOrder=sortOrder, filterKey=filterKey, filterValue=filterValue);
|
||||
objs queryResult/objects;
|
||||
totalNumber queryResult/totalNumber;
|
||||
batchSize queryResult/batchSize;
|
||||
ajaxHookId python:'queryResult';
|
||||
navBaseCall python: 'askQueryResult(\'%s\',\'%s\',\'%s\',\'%s\',\'%s\',**v**)' % (ajaxHookId, tool.absolute_url(), contentType, flavourNumber, searchName);
|
||||
newSearchUrl python: '%s/skyn/search?type_name=%s&flavourNumber=%d' % (tool.getAppFolder().absolute_url(), contentType, flavourNumber);">
|
||||
navBaseCall python: 'askQueryResult(\'%s\',\'%s\',\'%s\',\'%s\',**v**)' % (ajaxHookId, tool.absolute_url(), contentType, searchName);
|
||||
newSearchUrl python: '%s/skyn/search?type_name=%s&' % (tool.getAppFolder().absolute_url(), contentType);">
|
||||
|
||||
<tal:result condition="objs">
|
||||
|
||||
|
@ -91,7 +90,7 @@
|
|||
|
||||
<tal:comment replace="nothing">Mandatory column "Title"/"Name"</tal:comment>
|
||||
<td id="field_title"><a
|
||||
tal:define="navInfo python:'search.%s:%d.%s.%d.%d' % (contentType, flavourNumber, searchName, repeat['obj'].number()+startNumber, totalNumber);"
|
||||
tal:define="navInfo python:'search.%s.%s.%d.%d' % (contentType, searchName, repeat['obj'].number()+startNumber, totalNumber);"
|
||||
tal:content="obj/Title" tal:attributes="href python: obj.getUrl(nav=navInfo, page='main')"></a></td>
|
||||
|
||||
<tal:comment replace="nothing">Columns corresponding to other fields</tal:comment>
|
||||
|
@ -125,7 +124,7 @@
|
|||
<tr>
|
||||
<tal:comment replace="nothing">Edit the element</tal:comment>
|
||||
<td class="noPadding">
|
||||
<a tal:define="navInfo python:'search.%s:%d.%s.%d.%d' % (contentType, flavourNumber, searchName, repeat['obj'].number()+startNumber, totalNumber);"
|
||||
<a tal:define="navInfo python:'search.%s.%s.%d.%d' % (contentType, searchName, repeat['obj'].number()+startNumber, totalNumber);"
|
||||
tal:attributes="href python: obj.getUrl(mode='edit', page='main', nav=navInfo)"
|
||||
tal:condition="python: member.has_permission('Modify portal content', obj)">
|
||||
<img title="Edit" i18n:domain="plone" i18n:attributes="title"
|
||||
|
|
|
@ -122,11 +122,11 @@
|
|||
|
||||
/* The functions below wrap askAjaxChunk for getting specific content through
|
||||
an Ajax request. */
|
||||
function askQueryResult(hookId, objectUrl, contentType, flavourNumber,
|
||||
searchName, startNumber, sortKey, sortOrder, filterKey) {
|
||||
function askQueryResult(hookId, objectUrl, contentType, searchName,
|
||||
startNumber, sortKey, sortOrder, filterKey) {
|
||||
// Sends an Ajax request for getting the result of a query.
|
||||
var params = {'type_name': contentType, 'flavourNumber': flavourNumber,
|
||||
'search': searchName, 'startNumber': startNumber};
|
||||
var params = {'type_name': contentType, 'search': searchName,
|
||||
'startNumber': startNumber};
|
||||
if (sortKey) params['sortKey'] = sortKey;
|
||||
if (sortOrder) params['sortOrder'] = sortOrder;
|
||||
if (filterKey) {
|
||||
|
@ -208,11 +208,9 @@
|
|||
theForm.submit();
|
||||
}
|
||||
function onDeleteObject(objectUid) {
|
||||
if (confirm(delete_confirm)) {
|
||||
f = document.getElementById('deleteForm');
|
||||
f.objectUid.value = objectUid;
|
||||
f.submit();
|
||||
}
|
||||
f = document.getElementById('deleteForm');
|
||||
f.objectUid.value = objectUid;
|
||||
askConfirm('form', 'deleteForm', delete_confirm);
|
||||
}
|
||||
function toggleCookie(cookieId) {
|
||||
// What is the state of this boolean (expanded/collapsed) cookie?
|
||||
|
@ -241,10 +239,9 @@
|
|||
createCookie(cookieId, newState);
|
||||
}
|
||||
// Function that allows to generate a document from a pod template.
|
||||
function generatePodDocument(contextUid, templateUid, fieldName, podFormat) {
|
||||
function generatePodDocument(contextUid, fieldName, podFormat) {
|
||||
var theForm = document.getElementsByName("podTemplateForm")[0];
|
||||
theForm.objectUid.value = contextUid;
|
||||
theForm.templateUid.value = templateUid;
|
||||
theForm.fieldName.value = fieldName;
|
||||
theForm.podFormat.value = podFormat;
|
||||
theForm.askAction.value = "False";
|
||||
|
@ -255,7 +252,10 @@
|
|||
theForm.submit();
|
||||
}
|
||||
// Functions for opening and closing a popup
|
||||
function openPopup(popupId) {
|
||||
function openPopup(popupId, msg) {
|
||||
// Put the message into the popup
|
||||
var confirmElem = document.getElementById('appyConfirmText');
|
||||
confirmElem.innerHTML = msg;
|
||||
// Open the popup
|
||||
var popup = document.getElementById(popupId);
|
||||
// Put it at the right place on the screen
|
||||
|
@ -276,19 +276,35 @@
|
|||
greyed.style.display = "none";
|
||||
}
|
||||
// Function triggered when an action needs to be confirmed by the user
|
||||
function askConfirm(formId) {
|
||||
// Store the ID of the form to send if the users confirms.
|
||||
function askConfirm(actionType, action, msg) {
|
||||
/* Store the actionType (send a form, call an URL or call a script) and the
|
||||
related action, and shows the confirm popup. If the user confirms, we
|
||||
will perform the action. */
|
||||
var confirmForm = document.getElementById('confirmActionForm');
|
||||
confirmForm.actionFormId.value = formId;
|
||||
openPopup("confirmActionPopup");
|
||||
confirmForm.actionType.value = actionType;
|
||||
confirmForm.action.value = action;
|
||||
openPopup("confirmActionPopup", msg);
|
||||
}
|
||||
// Function triggered when an action confirmed by the user must be performed
|
||||
function doConfirm() {
|
||||
// The user confirmed: retrieve the form to send and send it.
|
||||
// The user confirmed: perform the required action.
|
||||
closePopup('confirmActionPopup');
|
||||
var confirmForm = document.getElementById('confirmActionForm');
|
||||
var actionFormId = confirmForm.actionFormId.value;
|
||||
var actionForm = document.getElementById(actionFormId);
|
||||
actionForm.submit();
|
||||
var actionType = confirmForm.actionType.value;
|
||||
var action = confirmForm.action.value;
|
||||
if (actionType == 'form') {
|
||||
// We must submit the form whose id is in "action"
|
||||
document.getElementById(action).submit();
|
||||
}
|
||||
else if (actionType == 'url') {
|
||||
// We must go to the URL defined in "action"
|
||||
window.location = action;
|
||||
}
|
||||
else if (actionType == 'script') {
|
||||
// We must execute Javascript code in "action"
|
||||
eval(action);
|
||||
}
|
||||
|
||||
}
|
||||
// Function that shows or hides a tab. p_action is 'show' or 'hide'.
|
||||
function manageTab(tabId, action) {
|
||||
|
@ -344,10 +360,8 @@
|
|||
</form>
|
||||
<tal:comment replace="nothing">Global form for generating a document from a pod template.</tal:comment>
|
||||
<form name="podTemplateForm" method="post"
|
||||
tal:attributes="action python: flavour.absolute_url() + '/generateDocument'">
|
||||
tal:attributes="action python: tool.absolute_url() + '/generateDocument'">
|
||||
<input type="hidden" name="objectUid"/>
|
||||
<tal:comment replace="nothing">templateUid is given if class-wide pod, fieldName and podFormat are given if podField.</tal:comment>
|
||||
<input type="hidden" name="templateUid"/>
|
||||
<input type="hidden" name="fieldName"/>
|
||||
<input type="hidden" name="podFormat"/>
|
||||
<input type="hidden" name="askAction"/>
|
||||
|
@ -384,31 +398,6 @@
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
<tal:comment replace="nothing">
|
||||
This macro lists the POD templates that are available. It is used by macro "header" below.
|
||||
</tal:comment>
|
||||
<div metal:define-macro="listPodTemplates" class="appyPod" tal:condition="podTemplates"
|
||||
tal:define="podTemplates python: flavour.getAvailablePodTemplates(contextObj, phase);">
|
||||
<tal:podTemplates define="maxShownTemplates python: flavour.getMaxShownTemplates(contextObj)">
|
||||
<tal:comment replace="nothing">Display templates as links if a few number of templates must be shown</tal:comment>
|
||||
<span class="discreet" tal:condition="python: len(podTemplates)<=maxShownTemplates"
|
||||
tal:repeat="podTemplate podTemplates">
|
||||
<a style="cursor: pointer"
|
||||
tal:define="podFormat podTemplate/getPodFormat"
|
||||
tal:attributes="onclick python: 'generatePodDocument(\'%s\',\'%s\', \'\', \'\')' % (contextObj.UID(), podTemplate.UID())" >
|
||||
<img tal:attributes="src string: $portal_url/skyn/$podFormat.png"/>
|
||||
<span tal:replace="podTemplate/Title"/>
|
||||
</a>
|
||||
</span>
|
||||
<tal:comment replace="nothing">Display templates as a list if a lot of templates must be shown</tal:comment>
|
||||
<select tal:condition="python: len(podTemplates)>maxShownTemplates">
|
||||
<option value="" tal:content="python: tool.translate('choose_a_doc')"></option>
|
||||
<option tal:repeat="podTemplate podTemplates" tal:content="podTemplate/Title"
|
||||
tal:attributes="onclick python: 'generatePodDocument(\'%s\',\'%s\', \'\', \'\')' % (contextObj.UID(), podTemplate.UID())" />
|
||||
</select>
|
||||
</tal:podTemplates>
|
||||
</div>
|
||||
|
||||
<tal:comment replace="nothing">
|
||||
This macro displays an object's history. It is used by macro "header" below.
|
||||
</tal:comment>
|
||||
|
@ -460,7 +449,7 @@
|
|||
<th align="left" width="70%" tal:content="python: tool.translate('previous_value')"></th>
|
||||
</tr>
|
||||
<tr tal:repeat="change event/changes/items" valign="top">
|
||||
<td tal:content="python: tool.translate(change[1][1])"></td>
|
||||
<td tal:content="structure python: tool.translate(change[1][1])"></td>
|
||||
<td tal:define="appyValue python: contextObj.getFormattedFieldValue(change[0], change[1][0]);
|
||||
appyType python:contextObj.getAppyType(change[0], asDict=True);
|
||||
severalValues python: (appyType['multiplicity'][1] > 1) or (appyType['multiplicity'][1] == None)">
|
||||
|
@ -482,13 +471,13 @@
|
|||
This macro displays an object's state(s). It is used by macro "header" below.
|
||||
</tal:comment>
|
||||
<metal:states define-macro="states"
|
||||
tal:define="showAllStatesInPhase python: flavour.getAttr('showAllStatesInPhaseFor' + contextObj.meta_type);
|
||||
tal:define="showAllStatesInPhase python: tool.getAttr('showAllStatesInPhaseFor' + contextObj.meta_type);
|
||||
states python: contextObj.getAppyStates(phase, currentOnly=not showAllStatesInPhase)"
|
||||
tal:condition="python: test(showAllStatesInPhase, len(states)>1, True)">
|
||||
<table>
|
||||
<tr>
|
||||
<tal:state repeat="stateInfo states">
|
||||
<td tal:attributes="class python: 'appyState step' + stateInfo['stateStatus']"
|
||||
<td tal:attributes="class python: 'appyState step%sState' % stateInfo['stateStatus']"
|
||||
tal:content="python: tool.translate(contextObj.getWorkflowLabel(stateInfo['name']))">
|
||||
</td>
|
||||
<td tal:condition="python: stateInfo['name'] != states[-1]['name']">
|
||||
|
@ -512,7 +501,7 @@
|
|||
<table>
|
||||
<tr>
|
||||
<tal:comment replace="nothing">Input field allowing to enter a comment before triggering a transition</tal:comment>
|
||||
<td tal:define="showCommentsField python:flavour.getAttr('showWorkflowCommentFieldFor'+contextObj.meta_type)"
|
||||
<td tal:define="showCommentsField python:tool.getAttr('showWorkflowCommentFieldFor'+contextObj.meta_type)"
|
||||
align="right" tal:condition="showCommentsField">
|
||||
<span tal:content="python: tool.translate('workflow_comment')" class="discreet"></span>
|
||||
<input type="text" id="comment" name="comment" size="35"/>
|
||||
|
@ -520,7 +509,7 @@
|
|||
|
||||
<tal:comment replace="nothing">Buttons for triggering transitions</tal:comment>
|
||||
<td align="right" tal:repeat="transition transitions">
|
||||
<input type="button" class="context"
|
||||
<input type="button" class="appyButton"
|
||||
tal:attributes="value python: tool.translate(transition['name']);
|
||||
onClick python: 'triggerTransition(\'%s\')' % transition['id'];"/>
|
||||
</td>
|
||||
|
@ -556,7 +545,7 @@
|
|||
<td colspan="2" class="discreet" tal:content="descrLabel"/>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="documentByLine">
|
||||
<td class="documentByLine" colspan="2">
|
||||
<tal:comment replace="nothing">Creator and last modification date</tal:comment>
|
||||
<tal:comment replace="nothing">Plus/minus icon for accessing history</tal:comment>
|
||||
<tal:accessHistory condition="hasHistory">
|
||||
|
@ -580,8 +569,6 @@
|
|||
<span i18n:translate="box_last_modified" i18n:domain="plone"></span>
|
||||
<span tal:replace="python:contextObj.restrictedTraverse('@@plone').toLocalizedTime(contextObj.ModificationDate(),long_format=1)"></span>
|
||||
</td>
|
||||
<td valign="top"><metal:pod use-macro="here/skyn/page/macros/listPodTemplates"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tal:comment replace="nothing">Object history</tal:comment>
|
||||
<tr tal:condition="hasHistory">
|
||||
|
@ -631,7 +618,7 @@
|
|||
masterValue.push(idField);
|
||||
}
|
||||
else {
|
||||
if (idField[0] == '(') {
|
||||
if ((idField[0] == '(') || (idField[0] == '[')) {
|
||||
// There are multiple values, split it
|
||||
var subValues = idField.substring(1, idField.length-1).split(',');
|
||||
for (var k=0; k < subValues.length; k++){
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
contextObj python: tool.getPublishedObject()">
|
||||
<tal:comment replace="nothing">Portlet title, with link to tool.</tal:comment>
|
||||
<dt class="portletHeader">
|
||||
<tal:comment replace="nothing">If there is only one flavour, clicking on the portlet
|
||||
<tal:comment replace="nothing">For the Manager, clicking on the portlet
|
||||
title allows to see all root objects in the database.</tal:comment>
|
||||
<table cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td tal:define="titleIsClickable python: member.has_role('Manager') and rootClasses">
|
||||
<a tal:condition="titleIsClickable"
|
||||
tal:attributes="href python:'%s?type_name=%s&flavourNumber=1' % (queryUrl, ','.join(rootClasses))"
|
||||
tal:attributes="href python:'%s?type_name=%s' % (queryUrl, ','.join(rootClasses))"
|
||||
tal:content="python: tool.translate(appName)"></a>
|
||||
<span tal:condition="not: titleIsClickable"
|
||||
tal:replace="python: tool.translate(appName)"/>
|
||||
|
@ -37,16 +37,14 @@
|
|||
</tal:publishedObject>
|
||||
|
||||
<tal:comment replace="nothing">Create a section for every root class.</tal:comment>
|
||||
<tal:section repeat="rootClass rootClasses"
|
||||
define="flavourNumber python:1;
|
||||
flavour python: tool.getFlavour('Dummy_%d' % flavourNumber)">
|
||||
<tal:section repeat="rootClass rootClasses">
|
||||
<tal:comment replace="nothing">Section title, with action icons</tal:comment>
|
||||
<dt tal:condition="python: tool.userMaySearch(rootClass)"
|
||||
tal:attributes="class python:test((repeat['rootClass'].number()==1) and not contextObj, 'portletAppyItem', 'portletAppyItem portletSep')">
|
||||
<table width="100%" cellspacing="0" cellpadding="0" class="no-style-table">
|
||||
<tr>
|
||||
<td>
|
||||
<a tal:attributes="href python: '%s?type_name=%s&flavourNumber=%s' % (queryUrl, rootClass, flavourNumber);
|
||||
<a tal:attributes="href python: '%s?type_name=%s' % (queryUrl, rootClass);
|
||||
class python:test(not currentSearch and (currentType==rootClass), 'portletCurrent', '')"
|
||||
tal:content="python: tool.translate(rootClass + '_plural')"></a>
|
||||
</td>
|
||||
|
@ -66,11 +64,11 @@
|
|||
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')"/>
|
||||
<tal:comment replace="nothing">Search objects of this type (todo: update flavourNumber)</tal:comment>
|
||||
<tal:comment replace="nothing">Search objects of this type</tal:comment>
|
||||
<img style="cursor:pointer"
|
||||
tal:define="showSearch python: flavour.getAttr('enableAdvancedSearchFor%s' % rootClass)"
|
||||
tal:define="showSearch python: tool.getAttr('enableAdvancedSearchFor%s' % rootClass)"
|
||||
tal:condition="showSearch"
|
||||
tal:attributes="onClick python: 'href: window.location=\'%s/skyn/search?type_name=%s&flavourNumber=1\'' % (appFolder.absolute_url(), rootClass);
|
||||
tal:attributes="onClick python: 'href: window.location=\'%s/skyn/search?type_name=%s\'' % (appFolder.absolute_url(), rootClass);
|
||||
src string: $portal_url/skyn/search.gif;
|
||||
title python: tool.translate('search_objects')"/>
|
||||
</td>
|
||||
|
@ -94,7 +92,7 @@
|
|||
<span tal:attributes="id group/labelId;
|
||||
style python:test(expanded, 'display:block', 'display:none')">
|
||||
<dt class="portletAppyItem portletSearch portletGroupItem" tal:repeat="search group/searches">
|
||||
<a tal:attributes="href python: '%s?type_name=%s&flavourNumber=%s&search=%s' % (queryUrl, rootClass, flavourNumber, search['name']);
|
||||
<a tal:attributes="href python: '%s?type_name=%s&search=%s' % (queryUrl, rootClass, search['name']);
|
||||
title search/descr;
|
||||
class python: test(search['name'] == currentSearch, 'portletCurrent', '');"
|
||||
tal:content="structure search/label"></a>
|
||||
|
@ -105,7 +103,7 @@
|
|||
<dt tal:define="search searchOrGroup" tal:condition="not: searchOrGroup/isGroup"
|
||||
class="portletAppyItem portletSearch">
|
||||
|
||||
<a tal:attributes="href python: '%s?type_name=%s&flavourNumber=%s&search=%s' % (queryUrl, rootClass, flavourNumber, search['name']);
|
||||
<a tal:attributes="href python: '%s?type_name=%s&search=%s' % (queryUrl, rootClass, search['name']);
|
||||
title search/descr;
|
||||
class python: test(search['name'] == currentSearch, 'portletCurrent', '');"
|
||||
tal:content="structure search/label"></a>
|
||||
|
@ -113,16 +111,6 @@
|
|||
</tal:searchOrGroup>
|
||||
</tal:section>
|
||||
|
||||
<tal:comment replace="nothing">All objects in flavour</tal:comment>
|
||||
<!--dt class="portletAppyItem" tal:define="flavourInfo python: flavours[0]">
|
||||
<a tal:define="flavourNumber flavourInfo/number;
|
||||
rootTypes python: test(flavourNumber==1, rootClasses, ['%s_%s' % (rc, flavourNumber) for rc in rootClasses]);
|
||||
rootClassesQuery python:','.join(rootTypes)"
|
||||
tal:content="flavourInfo/title"
|
||||
tal:attributes="title python: tool.translate('query_consult_all');
|
||||
href python:'%s?type_name=%s&flavourNumber=%d' % (queryUrl, rootClassesQuery, flavourNumber)"></a>
|
||||
</dt-->
|
||||
|
||||
<tal:comment replace="nothing">
|
||||
Greyed transparent zone that is deployed on the
|
||||
whole screen when a popup is displayed.
|
||||
|
@ -133,8 +121,9 @@
|
|||
<div id="confirmActionPopup" class="appyPopup">
|
||||
<form id="confirmActionForm" method="post">
|
||||
<div align="center">
|
||||
<p tal:content="python: tool.translate('confirm')"></p>
|
||||
<input type="hidden" name="actionFormId"/>
|
||||
<p id="appyConfirmText"></p>
|
||||
<input type="hidden" name="actionType"/>
|
||||
<input type="hidden" name="action"/>
|
||||
<input type="button" onClick="doConfirm()"
|
||||
tal:attributes="value python:tool.translate('yes')"/>
|
||||
<input type="button" value="No" onClick="closePopup('confirmActionPopup')"
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
appName appFolder/id;
|
||||
tool python: portal.get('portal_%s' % appName.lower());
|
||||
contentType python:context.REQUEST.get('type_name');
|
||||
flavour python: tool.getFlavour(contentType);
|
||||
flavourNumber python:int(context.REQUEST.get('flavourNumber', 1));
|
||||
searchName python:context.REQUEST.get('search', '')">
|
||||
|
||||
<div metal:use-macro="here/skyn/page/macros/prologue"/>
|
||||
|
@ -25,8 +23,8 @@
|
|||
<div id="queryResult"></div>
|
||||
|
||||
<script language="javascript"
|
||||
tal:define="ajaxUrl python: tool.getQueryUrl(contentType, flavourNumber, searchName)"
|
||||
tal:content="python: 'askQueryResult(\'queryResult\', \'%s\',\'%s\',\'%s\',\'%s\',0)' % (tool.absolute_url(), contentType, flavourNumber, searchName)">
|
||||
tal:define="ajaxUrl python: tool.getQueryUrl(contentType, searchName)"
|
||||
tal:content="python: 'askQueryResult(\'queryResult\', \'%s\',\'%s\',\'%s\',0)' % (tool.absolute_url(), contentType, searchName)">
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -16,8 +16,7 @@
|
|||
tal:define="appFolder context/getParentNode;
|
||||
contentType request/type_name;
|
||||
tool python: portal.get('portal_%s' % appFolder.id.lower());
|
||||
flavour python: tool.getFlavour('Dummy_%s' % request['flavourNumber']);
|
||||
searchableFields python: flavour.getSearchableFields(contentType)">
|
||||
searchableFields python: tool.getSearchableFields(contentType)">
|
||||
|
||||
<tal:comment replace="nothing">Search title</tal:comment>
|
||||
<h1><span tal:replace="python: tool.translate('%s_plural' % contentType)"/> —
|
||||
|
@ -27,10 +26,9 @@
|
|||
<form name="search" tal:attributes="action python: appFolder.absolute_url()+'/skyn/do'" method="post">
|
||||
<input type="hidden" name="action" value="SearchObjects"/>
|
||||
<input type="hidden" name="type_name" tal:attributes="value contentType"/>
|
||||
<input type="hidden" name="flavourNumber:int" tal:attributes="value request/flavourNumber"/>
|
||||
|
||||
<table class="no-style-table" cellpadding="0" cellspacing="0" width="100%"
|
||||
tal:define="numberOfColumns python: flavour.getAttr('numberOfSearchColumnsFor%s' % contentType)">
|
||||
tal:define="numberOfColumns python: tool.getAttr('numberOfSearchColumnsFor%s' % contentType)">
|
||||
<tr tal:repeat="searchRow python: tool.tabularize(searchableFields, numberOfColumns)" valign="top">
|
||||
<td tal:repeat="widget searchRow" tal:attributes="width python:'%d%%' % (100/numberOfColumns)">
|
||||
<tal:field condition="widget">
|
||||
|
|
|
@ -21,13 +21,12 @@
|
|||
layoutType python:'view';
|
||||
layout python: contextObj.getPageLayout(layoutType);
|
||||
tool contextObj/getTool;
|
||||
flavour python: tool.getFlavour(contextObj);
|
||||
appFolder tool/getAppFolder;
|
||||
appName appFolder/getId;
|
||||
page request/page|python:'main';
|
||||
phaseInfo python: contextObj.getAppyPhases(page=page);
|
||||
phase phaseInfo/name;
|
||||
showWorkflow python: flavour.getAttr('showWorkflowFor' + contextObj.meta_type)">
|
||||
showWorkflow python: tool.getAttr('showWorkflowFor' + contextObj.meta_type)">
|
||||
<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"/>
|
||||
|
|
|
@ -2,14 +2,15 @@
|
|||
<metal:view define-macro="view">
|
||||
<form name="executeAppyAction"
|
||||
tal:define="formId python: '%s_%s' % (contextObj.UID(), name);
|
||||
label python: contextObj.translate(widget['labelId'])"
|
||||
label python: contextObj.translate(widget['labelId']);
|
||||
labelConfirm python: contextObj.translate(widget['labelId'] + '_confirm')"
|
||||
tal:attributes="id formId; action python: contextObj.absolute_url()+'/skyn/do'">
|
||||
<input type="hidden" name="action" value="ExecuteAppyAction"/>
|
||||
<input type="hidden" name="objectUid" tal:attributes="value contextObj/UID"/>
|
||||
<input type="hidden" name="fieldName" tal:attributes="value name"/>
|
||||
<input type="button" tal:condition="widget/confirm"
|
||||
tal:attributes="value label;
|
||||
onClick python: 'askConfirm(\'%s\')' % formId"/>
|
||||
onClick python: 'askConfirm(\'form\', \'%s\', "%s")' % (formId, labelConfirm)"/>
|
||||
<input type="submit" name="do" tal:condition="not: widget/confirm"
|
||||
tal:attributes="value label" onClick="javascript:;"/>
|
||||
<tal:comment replace="nothing">The previous onClick is simply used to prevent Plone
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
<label tal:attributes="for chekboxId" class="discreet"
|
||||
tal:content="python: tool.translate(doLabel)"></label>
|
||||
</tal:askAction>
|
||||
<img tal:repeat="podFormat python:flavour.getPodInfo(contextObj, name)['formats']"
|
||||
<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\')' % (contextObj.UID(), name, podFormat);
|
||||
title podFormat/capitalize"
|
||||
style="cursor:pointer"/>
|
||||
</metal:view>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
from one object to the next/previous on skyn/view.</tal:comment>
|
||||
<a tal:define="includeShownInfo includeShownInfo | python:False;
|
||||
navInfo python:'ref.%s.%s:%s.%d.%d' % (contextObj.UID(), fieldName, appyType['page'], repeat['obj'].number()+startNumber, totalNumber);
|
||||
navInfo python: appyType['isBack'] and '' or navInfo;
|
||||
navInfo python: test(appyType['isBack'], '', navInfo);
|
||||
pageName python: appyType['isBack'] and appyType['backd']['page'] or 'main';
|
||||
fullUrl python: obj.getUrl(page=pageName, nav=navInfo)"
|
||||
tal:attributes="href fullUrl" tal:content="python: (not includeShownInfo) and obj.Title() or contextObj.getReferenceLabel(fieldName, obj.appy())"></a>
|
||||
|
@ -40,13 +40,13 @@
|
|||
</tal:moveRef>
|
||||
</td>
|
||||
<tal:comment replace="nothing">Edit the element</tal:comment>
|
||||
<td class="noPadding">
|
||||
<td class="noPadding" tal:condition="python: member.has_permission('Modify portal content', obj) and not appyType['noForm']">
|
||||
<a tal:define="navInfo python:'ref.%s.%s:%s.%d.%d' % (contextObj.UID(), fieldName, appyType['page'], repeat['obj'].number()+startNumber, totalNumber);"
|
||||
tal:attributes="href python: obj.getUrl(mode='edit', page='main', nav=navInfo)"
|
||||
tal:condition="python: member.has_permission('Modify portal content', obj)">
|
||||
tal:attributes="href python: obj.getUrl(mode='edit', page='main', nav=navInfo)">
|
||||
<img title="label_edit" i18n:domain="plone" i18n:attributes="title"
|
||||
tal:attributes="src string: $portal_url/skyn/edit.gif"/>
|
||||
</a></td>
|
||||
</a>
|
||||
</td>
|
||||
<tal:comment replace="nothing">Delete the element</tal:comment>
|
||||
<td class="noPadding">
|
||||
<img tal:condition="python: member.has_permission('Delete objects', obj)"
|
||||
|
@ -63,10 +63,14 @@
|
|||
through a reference widget. Indeed, If field was declared as "addable", we must provide
|
||||
an icon for creating a new linked object (at least if multiplicities allow it).</tal:comment>
|
||||
<img style="cursor:pointer" tal:condition="showPlusIcon"
|
||||
tal:define="navInfo python:'ref.%s.%s:%s.%d.%d' % (contextObj.UID(), fieldName, appyType['page'], 0, totalNumber);"
|
||||
tal:define="navInfo python:'ref.%s.%s:%s.%d.%d' % (contextObj.UID(), fieldName, appyType['page'], 0, totalNumber);
|
||||
formCall python:'window.location=\'%s/skyn/do?action=Create&type_name=%s&nav=%s\'' % (folder.absolute_url(), linkedPortalType, navInfo);
|
||||
formCall python: test(appyType['addConfirm'], 'askConfirm(\'script\', "%s", "%s")' % (formCall, addConfirmMsg), formCall);
|
||||
noFormCall python: navBaseCall.replace('**v**', '%d, \'CreateWithoutForm\'' % startNumber);
|
||||
noFormCall python: test(appyType['addConfirm'], 'askConfirm(\'script\', "%s", "%s")' % (noFormCall, addConfirmMsg), noFormCall)"
|
||||
tal:attributes="src string:$portal_url/skyn/plus.png;
|
||||
title python: tool.translate('add_ref');
|
||||
onClick python: 'href: window.location=\'%s/skyn/do?action=Create&type_name=%s&nav=%s\'' % (folder.absolute_url(), linkedPortalType, navInfo)"/>
|
||||
onClick python: test(appyType['noForm'], noFormCall, formCall)"/>
|
||||
</metal:plusIcon>
|
||||
|
||||
<tal:comment replace="nothing">
|
||||
|
@ -109,8 +113,7 @@
|
|||
totalNumber refObjects/totalNumber;
|
||||
batchSize refObjects/batchSize;
|
||||
folder python: contextObj.isPrincipiaFolderish and contextObj or contextObj.getParentNode();
|
||||
flavour python:tool.getFlavour(contextObj);
|
||||
linkedPortalType python:flavour.getPortalType(appyType['klass']);
|
||||
linkedPortalType python: tool.getPortalType(appyType['klass']);
|
||||
addPermission python: '%s: Add %s' % (tool.getAppName(), linkedPortalType);
|
||||
canWrite python: not appyType['isBack'] and member.has_permission(appyType['writePermission'], contextObj);
|
||||
multiplicity appyType/multiplicity;
|
||||
|
@ -118,6 +121,7 @@
|
|||
showPlusIcon python:not appyType['isBack'] and appyType['add'] and not maxReached and member.has_permission(addPermission, folder) and canWrite;
|
||||
atMostOneRef python: (multiplicity[1] == 1) and (len(objs)<=1);
|
||||
label python: tool.translate(appyType['labelId']);
|
||||
addConfirmMsg python: tool.translate('%s_addConfirm' % appyType['labelId']);
|
||||
description python: tool.translate(appyType['descrId']);
|
||||
navBaseCall python: 'askRefField(\'%s\',\'%s\',\'%s\',\'%s\',**v**)' % (ajaxHookId, contextObj.absolute_url(), fieldName, innerRef)">
|
||||
|
||||
|
@ -240,13 +244,11 @@
|
|||
|
||||
</fieldset>
|
||||
<tal:comment replace="nothing">A carriage return needed in some cases.</tal:comment>
|
||||
<br tal:define="widgetDescr widgetDescr|nothing"
|
||||
tal:condition="python: not widgetDescr or (widgetDescr['widgetType'] != 'group')"/>
|
||||
</tal:anyNumberOfReferences>
|
||||
</div>
|
||||
|
||||
<tal:comment replace="nothing">Edit macro for an Ref.</tal:comment>
|
||||
<div metal:define-macro="edit"
|
||||
<metal:editRef define-macro="edit"
|
||||
tal:condition="widget/link"
|
||||
tal:define="rname python: 'appy_ref_%s' % name;
|
||||
requestValue python: request.get(rname, []);
|
||||
|
@ -255,18 +257,18 @@
|
|||
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;
|
||||
multiple python: isMultiple and 'multiple' or ''">
|
||||
<option tal:condition="not: isMultiple" i18n:translate="choose_a_value"></option>
|
||||
<tal:ref repeat="refObj allObjects">
|
||||
<option tal:define="uid python: contextObj.getReferenceUid(refObj)"
|
||||
tal:content="python: contextObj.getReferenceLabel(name, refObj)"
|
||||
tal:attributes="value uid;
|
||||
selected python:(inRequest and (uid in requestValue) or (not inRequest and ((uid in refUids)))) and True or False">
|
||||
</option>
|
||||
</tal:ref>
|
||||
</select>
|
||||
</div>
|
||||
<select tal:attributes="name rname;
|
||||
multiple python: isMultiple and 'multiple' or ''">
|
||||
<option tal:condition="not: isMultiple" i18n:translate="choose_a_value"></option>
|
||||
<tal:ref repeat="refObj allObjects">
|
||||
<option tal:define="uid python: contextObj.getReferenceUid(refObj)"
|
||||
tal:content="python: contextObj.getReferenceLabel(name, refObj)"
|
||||
tal:attributes="value uid;
|
||||
selected python:(inRequest and (uid in requestValue) or (not inRequest and ((uid in refUids)))) and True or False">
|
||||
</option>
|
||||
</tal:ref>
|
||||
</select>
|
||||
</metal:editRef>
|
||||
|
||||
<tal:comment replace="nothing">Cell macro for a Ref.</tal:comment>
|
||||
<metal:cell define-macro="cell">
|
||||
|
|
|
@ -90,7 +90,9 @@
|
|||
<metal:content use-macro="portal/skyn/widgets/show/macros/groupContent"/>
|
||||
</tal:asSection>
|
||||
<tal:asTabs condition="python: widget['style'] == 'tabs'">
|
||||
<table cellpadding="0" cellspacing="0" tal:attributes="width python: test(widget['wide'], '100%', '')">
|
||||
<table cellpadding="0" cellspacing="0"
|
||||
tal:attributes="width python: test(widget['wide'], '100%', '');
|
||||
class widget/css_class">
|
||||
<tal:comment replace="nothing">First row: the tabs.</tal:comment>
|
||||
<tr valign="middle"><td style="border-bottom: 1px solid #ff8040">
|
||||
<table cellpadding="0" cellspacing="0" style="position:relative; bottom:-1px;">
|
||||
|
@ -137,7 +139,8 @@
|
|||
</tal:comment>
|
||||
<table metal:define-macro="groupContent"
|
||||
tal:attributes="width python: test(widget['wide'], '100%', '');
|
||||
align widget/align">
|
||||
align widget/align;
|
||||
class widget/css_class">
|
||||
<tal:comment replace="nothing">Display the title of the group if it is not rendered a fieldset.</tal:comment>
|
||||
<tr tal:condition="python: (widget['style'] != 'fieldset') and widget['hasLabel']">
|
||||
<td tal:attributes="colspan python: len(widget['columnsWidths']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue