2009-10-18 07:52:27 -05:00
|
|
|
<div metal:define-macro="listPodTemplates" class="appyPod" tal:condition="podTemplates"
|
|
|
|
tal:define="podTemplates python: flavour.getAvailablePodTemplates(contextObj, phase);">
|
2009-06-29 07:06:01 -05:00
|
|
|
<script language="javascript">
|
|
|
|
<!--
|
|
|
|
// Function that allows to generate a meeting document containing selected items.
|
|
|
|
function generatePodDocument(contextUid, templateUid) {
|
|
|
|
var theForm = document.forms["podTemplateForm"];
|
|
|
|
theForm.objectUid.value = contextUid;
|
|
|
|
theForm.templateUid.value = templateUid;
|
|
|
|
theForm.submit();
|
|
|
|
}
|
|
|
|
-->
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Form submitted when an object needs to be generated as a document.</tal:comment>
|
|
|
|
<form name="podTemplateForm" method="post"
|
2009-10-18 07:52:27 -05:00
|
|
|
tal:attributes="action python: contextObj.absolute_url() + '/generateDocument'">
|
2009-06-29 07:06:01 -05:00
|
|
|
<input type="hidden" name="objectUid"/>
|
|
|
|
<input type="hidden" name="templateUid"/>
|
|
|
|
</form>
|
|
|
|
|
2009-10-18 07:52:27 -05:00
|
|
|
<tal:podTemplates define="maxShownTemplates python: flavour.getMaxShownTemplates(contextObj)">
|
2009-06-29 07:06:01 -05:00
|
|
|
<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"
|
2009-10-18 07:52:27 -05:00
|
|
|
tal:attributes="onclick python: 'javascript:generatePodDocument(\'%s\',\'%s\')' % (contextObj.UID(), podTemplate.UID())" >
|
2009-06-29 07:06:01 -05:00
|
|
|
<img tal:attributes="src string: $portal_url/$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">
|
2009-10-18 07:52:27 -05:00
|
|
|
<option value="" tal:content="python: tool.translate('choose_a_doc')"></option>
|
2009-06-29 07:06:01 -05:00
|
|
|
<option tal:repeat="podTemplate podTemplates" tal:content="podTemplate/Title"
|
2009-10-18 07:52:27 -05:00
|
|
|
tal:attributes="onclick python: 'javascript:generatePodDocument(\'%s\',\'%s\')' % (contextObj.UID(), podTemplate.UID())" />
|
2009-06-29 07:06:01 -05:00
|
|
|
</select>
|
|
|
|
</tal:podTemplates>
|
|
|
|
</div>
|
|
|
|
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:editString define-macro="editString" tal:define="vocab python:field.Vocabulary(contextObj)">
|
|
|
|
<label tal:attributes="for fieldName" tal:condition="showLabel" tal:content="label"/>
|
|
|
|
<span class="fieldRequired" tal:condition="python: appyType['multiplicity'][0] > 0"></span>
|
2009-07-28 03:14:40 -05:00
|
|
|
<div class="discreet" tal:content="structure description"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
<select tal:attributes="name fieldName;
|
|
|
|
id fieldName;
|
|
|
|
tabindex tabindex/next;
|
|
|
|
multiple isMultiple;
|
|
|
|
onchange python: 'javascript:updateSlaves(getMasterValue(this), \'%s\')' % appyType['id'];
|
|
|
|
class python: contextObj.getCssClasses(appyType, asSlave=False)">
|
|
|
|
<option tal:repeat="item vocab" i18n:translate=""
|
|
|
|
tal:attributes="value item;
|
|
|
|
selected python:contextObj.fieldValueSelected(fieldName, value, item)"
|
|
|
|
tal:content="python:here.translate(vocab.getMsgId(item), default=vocab.getValue(item))"/>
|
|
|
|
</select>
|
|
|
|
</metal:editString>
|
|
|
|
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:editBoolean define-macro="editBoolean">
|
2009-06-29 07:06:01 -05:00
|
|
|
<input type="checkbox"
|
|
|
|
tal:attributes="tabindex tabindex/next;
|
|
|
|
name python: fieldName + '_visible';
|
|
|
|
id fieldName;
|
|
|
|
checked python:contextObj.checkboxChecked(fieldName, value);
|
|
|
|
onClick python:'toggleCheckbox(\'%s\', \'%s_hidden\');;updateSlaves(getMasterValue(this), \'%s\')' % (fieldName, fieldName, appyType['id']);
|
|
|
|
class python: 'noborder ' + contextObj.getCssClasses(appyType, asSlave=False)"/>
|
|
|
|
<input tal:attributes="name fieldName;
|
|
|
|
id string:${fieldName}_hidden;
|
|
|
|
value python: test(contextObj.checkboxChecked(fieldName, value), 'True', 'False')"
|
|
|
|
type="hidden" />
|
2009-10-18 07:52:27 -05:00
|
|
|
<span class="fieldRequired" tal:condition="python: appyType['multiplicity'][0] > 0"></span>
|
2009-06-29 07:06:01 -05:00
|
|
|
<label tal:attributes="for fieldName" tal:condition="showLabel" tal:content="label"/>
|
2009-07-28 03:14:40 -05:00
|
|
|
<div class="discreet" tal:content="structure description"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
</metal:editBoolean>
|
|
|
|
|
2009-10-18 07:52:27 -05:00
|
|
|
<div metal:define-macro="editField"
|
2009-06-29 07:06:01 -05:00
|
|
|
tal:define="fieldName field/getName;
|
|
|
|
isMultiple python:test(appyType['multiplicity'][1]!=1, 'multiple', '');
|
|
|
|
inError python:test(errors.has_key(fieldName), True, False);
|
|
|
|
value python:field.getAccessor(contextObj)();
|
2009-10-18 07:52:27 -05:00
|
|
|
defaultValue python: contextObj.getDefault(fieldName)"
|
2009-06-29 07:06:01 -05:00
|
|
|
tal:attributes="class python:'field ' + test(inError, ' error', '')">
|
|
|
|
<div tal:condition="inError" tal:content="python: errors[fieldName]"></div>
|
|
|
|
<tal:stringField condition="python: appyType['type'] == 'String'">
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:edit use-macro="here/skyn/macros/macros/editString"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:stringField>
|
|
|
|
<tal:booleanField condition="python: appyType['type'] == 'Boolean'">
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:edit use-macro="here/skyn/macros/macros/editBoolean"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:booleanField>
|
|
|
|
</div>
|
|
|
|
|
2009-10-18 07:52:27 -05:00
|
|
|
<div metal:define-macro="showComputedField">
|
|
|
|
<span class="appyLabel" tal:condition="showLabel" tal:content="label"></span>
|
2009-06-29 07:06:01 -05:00
|
|
|
<tal:showValue define="theValue python: contextObj.getComputedValue(appyType)">
|
|
|
|
<span tal:condition="appyType/plainText" tal:replace="theValue"/>
|
|
|
|
<span tal:condition="not: appyType/plainText" tal:replace="structure theValue"/>
|
|
|
|
</tal:showValue>
|
|
|
|
</div>
|
|
|
|
|
2009-10-18 07:52:27 -05:00
|
|
|
<div metal:define-macro="showInfoField">
|
2009-12-21 13:45:29 -06:00
|
|
|
<span class="appyLabel" tal:content="structure label"></span>
|
2009-10-18 07:52:27 -05:00
|
|
|
<span tal:content="structure description"></span>
|
2009-06-29 07:06:01 -05:00
|
|
|
</div>
|
|
|
|
|
2009-10-18 07:52:27 -05:00
|
|
|
<div metal:define-macro="showActionField">
|
2009-10-30 15:31:39 -05:00
|
|
|
<form name="executeAppyAction"
|
|
|
|
tal:attributes="action python: contextObj.absolute_url()+'/skyn/do'">
|
2009-10-20 09:57:00 -05:00
|
|
|
<input type="hidden" name="action" value="ExecuteAppyAction"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
<input type="hidden" name="objectUid" tal:attributes="value contextObj/UID"/>
|
|
|
|
<input type="hidden" name="fieldName" tal:attributes="value field/getName"/>
|
2009-10-25 15:42:08 -05:00
|
|
|
<input type="submit" name="do" tal:attributes="value label" onClick="javascript:;"/>
|
|
|
|
<tal:comment replace="nothing">The previous onClick is simply used to prevent Plone
|
|
|
|
from adding a CSS class that displays a popup when the user triggers the form multiple
|
|
|
|
times.</tal:comment>
|
2009-06-29 07:06:01 -05:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
2009-11-13 11:21:03 -06:00
|
|
|
<metal:showDate define-macro="showDateField"
|
2009-12-14 13:22:55 -06:00
|
|
|
tal:define="v python: contextObj.getAppyValue(field.getName(), appyType)">
|
2009-11-13 11:21:03 -06:00
|
|
|
<span tal:condition="showLabel" tal:content="label" class="appyLabel"></span>
|
2009-12-14 13:22:55 -06:00
|
|
|
<span tal:replace="v"></span>
|
2009-11-13 11:21:03 -06:00
|
|
|
</metal:showDate>
|
|
|
|
|
|
|
|
<metal:showString define-macro="showStringField"
|
2009-12-14 13:22:55 -06:00
|
|
|
tal:define="v python: contextObj.getAppyValue(field.getName(), appyType);
|
2009-11-13 11:21:03 -06:00
|
|
|
fmt python: appyType['format'];
|
|
|
|
maxMult python: appyType['multiplicity'][1];
|
|
|
|
severalValues python: (maxMult == None) or (maxMult > 1)">
|
2009-11-25 13:37:22 -06:00
|
|
|
<tal:simpleString condition="python: fmt in (0, 3)">
|
2009-11-13 11:21:03 -06:00
|
|
|
<span tal:condition="showLabel" tal:content="label" class="appyLabel"
|
|
|
|
tal:attributes="class python: 'appyLabel ' + contextObj.getCssClasses(appyType, asSlave=False);
|
|
|
|
id python: v"></span>
|
2009-12-14 13:22:55 -06:00
|
|
|
<ul class="appyList" tal:condition="python: v and severalValues">
|
|
|
|
<li class="appyBullet" tal:repeat="sv v"><i tal:content="structure sv"></i></li>
|
2009-11-13 11:21:03 -06:00
|
|
|
</ul>
|
2009-11-24 15:41:42 -06:00
|
|
|
<tal:singleValue condition="python: v and not severalValues">
|
2009-12-14 13:22:55 -06:00
|
|
|
<span tal:condition="python: fmt != 3" tal:replace="structure v"/>
|
|
|
|
<span tal:condition="python: fmt == 3">********</span>
|
2009-11-13 11:21:03 -06:00
|
|
|
</tal:singleValue>
|
|
|
|
</tal:simpleString>
|
2009-11-25 13:37:22 -06:00
|
|
|
<tal:formattedString condition="python: fmt not in (0, 3)">
|
2009-11-13 11:21:03 -06:00
|
|
|
<fieldset>
|
|
|
|
<legend tal:condition="showLabel" tal:content="label"></legend>
|
|
|
|
<span tal:condition="python: appyType['format'] == 1"
|
|
|
|
tal:replace="structure python: v.replace('\n', '<br>')"/>
|
|
|
|
<span tal:condition="python: appyType['format'] == 2" tal:replace="structure v"/>
|
|
|
|
</fieldset>
|
|
|
|
</tal:formattedString>
|
|
|
|
</metal:showString>
|
|
|
|
|
2009-10-18 07:52:27 -05:00
|
|
|
<div metal:define-macro="showArchetypesField"
|
2009-06-29 07:06:01 -05:00
|
|
|
tal:define="field fieldDescr/atField|widgetDescr/atField;
|
|
|
|
appyType fieldDescr/appyType|widgetDescr/appyType;
|
2009-10-18 07:52:27 -05:00
|
|
|
showLabel showLabel|python:True;
|
2009-10-25 15:42:08 -05:00
|
|
|
labelId field/widget/label_msgid;
|
|
|
|
label python: tool.translate(labelId);
|
2009-10-18 07:52:27 -05:00
|
|
|
descrId field/widget/description_msgid|python:'';
|
|
|
|
description python: tool.translate(descrId)"
|
2009-06-29 07:06:01 -05:00
|
|
|
tal:attributes="class python: contextObj.getCssClasses(appyType, asSlave=True)">
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">For some fields we simply use the standard Archetypes
|
|
|
|
macro for showing it. Special Appy field types like Ref and Computed have their
|
|
|
|
corresponding Archetypes fields set as invisible, so they won't be shown by the following
|
|
|
|
tal:showField.</tal:comment>
|
|
|
|
|
|
|
|
<tal:showField define="mode python:test(isEdit, 'edit', 'view');"
|
|
|
|
tal:condition="python: test(isEdit, member.has_permission(field.write_permission, contextObj), member.has_permission(field.read_permission, contextObj))">
|
|
|
|
<tal:editField condition="isEdit">
|
|
|
|
<metal:editMacro use-macro="python:contextObj.widget(field.getName(), mode='edit', use_label=showLabel)" />
|
|
|
|
</tal:editField>
|
|
|
|
<tal:viewField tal:condition="not: isEdit">
|
2009-11-13 11:21:03 -06:00
|
|
|
<tal:fileField condition="python: (appyType['type'] == 'File')">
|
2009-12-01 13:36:59 -06:00
|
|
|
<span tal:condition="showLabel" tal:content="label" class="appyLabel"></span>
|
2009-11-13 11:21:03 -06:00
|
|
|
<metal:viewField use-macro="python: contextObj.widget(field.getName(), 'view', use_label=0)"/>
|
|
|
|
</tal:fileField>
|
|
|
|
<tal:date condition="python: appyType['type'] == 'Date'">
|
|
|
|
<metal:showDate use-macro="here/skyn/macros/macros/showDateField"/>
|
|
|
|
</tal:date>
|
|
|
|
<tal:string condition="python: appyType['type'] == 'String'">
|
|
|
|
<metal:showString use-macro="here/skyn/macros/macros/showStringField"/>
|
|
|
|
</tal:string>
|
|
|
|
<tal:simpleField condition="python: (appyType['type'] in ('Integer', 'Float', 'Boolean'))">
|
|
|
|
<span tal:condition="showLabel" tal:content="label"
|
|
|
|
tal:attributes="class python: 'appyLabel ' + contextObj.getCssClasses(appyType, asSlave=False);
|
|
|
|
id python: field.getAccessor(contextObj)()"></span>
|
|
|
|
<metal:viewField use-macro="python: contextObj.widget(field.getName(), 'view', use_label=0)"/>
|
|
|
|
</tal:simpleField>
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:viewField>
|
|
|
|
</tal:showField>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">For other fields like Refs we use specific view/edit macros.</tal:comment>
|
|
|
|
<tal:viewRef condition="python: (not isEdit) and (appyType['type'] == 'Ref')">
|
|
|
|
<tal:ref define="isBack python:False;
|
2009-10-25 15:42:08 -05:00
|
|
|
fieldName field/getName;
|
2009-06-29 07:06:01 -05:00
|
|
|
innerRef innerRef|python:False">
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:viewRef use-macro="here/skyn/ref/macros/showReference" />
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:ref>
|
|
|
|
</tal:viewRef>
|
|
|
|
<tal:editRef condition="python: isEdit and (appyType['type'] == 'Ref')">
|
|
|
|
<tal:ref define="appyType fieldDescr/appyType|widgetDescr/appyType"
|
|
|
|
condition="python: appyType['link']==True">
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:editRef use-macro="here/skyn/ref/macros/editReference" />
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:ref>
|
|
|
|
</tal:editRef>
|
2009-12-17 14:14:52 -06:00
|
|
|
<tal:computedField condition="python: appyType['type'] == 'Computed'">
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:cf use-macro="here/skyn/macros/macros/showComputedField" />
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:computedField>
|
2009-10-30 15:31:39 -05:00
|
|
|
<tal:actionField condition="python: appyType['type'] == 'Action'">
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:af use-macro="here/skyn/macros/macros/showActionField" />
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:actionField>
|
|
|
|
<tal:masterString condition="python: isEdit and (appyType['type'] in ('String', 'Boolean')) and (appyType['slaves'])">
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:mf use-macro="here/skyn/macros/macros/editField" />
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:masterString>
|
|
|
|
<tal:infoField condition="python: (not isEdit) and (appyType['type'] == 'Info')">
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:af use-macro="here/skyn/macros/macros/showInfoField" />
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:infoField>
|
|
|
|
</div>
|
|
|
|
|
2009-10-18 07:52:27 -05:00
|
|
|
<div metal:define-macro="showBackwardField"
|
2009-06-29 07:06:01 -05:00
|
|
|
tal:define="isBack python:True;
|
|
|
|
appyType widgetDescr/appyType;
|
2009-10-25 15:42:08 -05:00
|
|
|
fieldName widgetDescr/fieldRel;
|
|
|
|
labelId python: '%s_%s_back' % (contextObj.meta_type, appyType['backd']['attribute']);
|
|
|
|
descrId python: '';
|
2009-06-29 07:06:01 -05:00
|
|
|
innerRef innerRef|python:False">
|
2009-10-18 07:52:27 -05:00
|
|
|
<div metal:use-macro="here/skyn/ref/macros/showReference" />
|
2009-06-29 07:06:01 -05:00
|
|
|
</div>
|
|
|
|
|
2009-11-06 04:33:56 -06:00
|
|
|
<metal:group define-macro="showGroup">
|
2009-06-29 07:06:01 -05:00
|
|
|
<fieldset class="appyGroup">
|
2009-10-18 07:52:27 -05:00
|
|
|
<legend><i tal:define="groupDescription python:contextObj.translate('%s_group_%s' % (contextObj.meta_type, widgetDescr['name']))"
|
2009-11-11 13:22:13 -06:00
|
|
|
tal:content="structure groupDescription"></i></legend>
|
2009-06-29 07:06:01 -05:00
|
|
|
<table tal:define="global fieldNb python:-1" width="100%">
|
|
|
|
<tr valign="top" tal:repeat="rowNb python:range(widgetDescr['rows'])">
|
2009-10-18 07:52:27 -05:00
|
|
|
<td tal:repeat="colNb python:range(widgetDescr['cols'])"
|
|
|
|
tal:attributes="width python: str(100.0/widgetDescr['cols']) + '%'">
|
2009-06-29 07:06:01 -05:00
|
|
|
<tal:showField define="global fieldNb python:fieldNb+1;
|
|
|
|
hasFieldDescr python: test(fieldNb < len(widgetDescr['fields']), True, False);"
|
|
|
|
tal:condition="hasFieldDescr">
|
|
|
|
<tal:field define="fieldDescr python:widgetDescr['fields'][fieldNb]">
|
|
|
|
<tal:archetypesField condition="python: fieldDescr['widgetType'] == 'field'">
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:atField use-macro="here/skyn/macros/macros/showArchetypesField"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:archetypesField>
|
|
|
|
<tal:backwardRef tal:condition="python: (not isEdit) and (fieldDescr['widgetType'] == 'backField')">
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:backRef use-macro="here/skyn/macros/macros/showBackwardField" />
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:backwardRef>
|
|
|
|
</tal:field>
|
|
|
|
</tal:showField>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</fieldset>
|
|
|
|
<br/>
|
2009-11-06 04:33:56 -06:00
|
|
|
</metal:group>
|
2009-06-29 07:06:01 -05:00
|
|
|
|
2009-11-06 04:33:56 -06:00
|
|
|
<metal:fields define-macro="listFields"
|
2009-06-29 07:06:01 -05:00
|
|
|
tal:repeat="widgetDescr python: contextObj.getAppyFields(isEdit, pageName)">
|
|
|
|
<tal:displayArchetypesField condition="python: widgetDescr['widgetType'] == 'field'">
|
|
|
|
<tal:atField condition="python: widgetDescr['page'] == pageName">
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:field use-macro="here/skyn/macros/macros/showArchetypesField" />
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:atField>
|
|
|
|
</tal:displayArchetypesField>
|
|
|
|
<tal:displayBackwardRef condition="python: (not isEdit) and (widgetDescr['widgetType'] == 'backField')">
|
|
|
|
<tal:backRef condition="python: widgetDescr['appyType']['backd']['page'] == pageName">
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:field metal:use-macro="here/skyn/macros/macros/showBackwardField" />
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:backRef>
|
|
|
|
</tal:displayBackwardRef>
|
|
|
|
<tal:displayGroup condition="python: widgetDescr['widgetType'] == 'group'">
|
|
|
|
<tal:displayG condition="python: widgetDescr['page'] == pageName">
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:group metal:use-macro="here/skyn/macros/macros/showGroup" />
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:displayG>
|
|
|
|
</tal:displayGroup>
|
2009-11-06 04:33:56 -06:00
|
|
|
</metal:fields>
|
2009-06-29 07:06:01 -05:00
|
|
|
|
2009-12-14 13:22:55 -06:00
|
|
|
<metal:history define-macro="history"
|
|
|
|
tal:define="startNumber request/startNumber|python:0;
|
|
|
|
startNumber python: int(startNumber);
|
|
|
|
historyInfo python: contextObj.getHistory(startNumber);
|
|
|
|
objs historyInfo/events;
|
|
|
|
batchSize historyInfo/batchSize;
|
|
|
|
totalNumber historyInfo/totalNumber;
|
|
|
|
ajaxHookId python:'appyHistory';
|
|
|
|
baseUrl python: contextObj.getUrl('showHistory', startNumber='**v**');
|
|
|
|
tool contextObj/getTool">
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Table containing the history</tal:comment>
|
|
|
|
<tal:history condition="objs">
|
|
|
|
<metal:nav use-macro="here/skyn/macros/macros/appyNavigate"/>
|
|
|
|
<table width="100%" class="listing nosort">
|
|
|
|
<tr i18n:domain="plone">
|
|
|
|
<th i18n:translate="listingheader_action"/>
|
|
|
|
<th i18n:translate="listingheader_performed_by"/>
|
|
|
|
<th i18n:translate="listingheader_date_and_time"/>
|
|
|
|
<th i18n:translate="listingheader_comment"/>
|
|
|
|
</tr>
|
|
|
|
<tal:event repeat="event objs">
|
|
|
|
<tr tal:define="odd repeat/event/odd;
|
|
|
|
rhComments event/comments|nothing;
|
|
|
|
state event/review_state|nothing;
|
|
|
|
isDataChange python: event['action'] == '_datachange_'"
|
|
|
|
tal:attributes="class python:test(odd, 'even', 'odd')" valign="top">
|
|
|
|
<td tal:condition="isDataChange" tal:content="python: tool.translate('data_change')"></td>
|
|
|
|
<td tal:condition="not: isDataChange"
|
|
|
|
tal:content="python: tool.translate(contextObj.getWorkflowLabel(event['action']))"
|
|
|
|
tal:attributes="class string:state-${state}"/>
|
|
|
|
<td tal:define="actorid python:event.get('actor');
|
|
|
|
actor python:contextObj.portal_membership.getMemberInfo(actorid);
|
|
|
|
fullname actor/fullname|nothing;
|
|
|
|
username actor/username|nothing"
|
|
|
|
tal:content="python:fullname or username or actorid"/>
|
|
|
|
<td tal:content="python:contextObj.toLocalizedTime(event['time'],long_format=True)"/>
|
|
|
|
<td tal:condition="not: isDataChange"><tal:comment condition="rhComments" tal:content="structure rhComments"/>
|
|
|
|
<tal:noComment condition="not: rhComments" i18n:translate="no_comments" i18n:domain="plone"/></td>
|
|
|
|
<td tal:condition="isDataChange">
|
|
|
|
<tal:comment replace="nothing">
|
|
|
|
Display the previous values of the fields whose value were modified in this change.</tal:comment>
|
|
|
|
<table class="appyChanges" width="100%">
|
|
|
|
<tr>
|
2009-12-15 14:30:43 -06:00
|
|
|
<th align="left" width="30%" tal:content="python: tool.translate('modified_field')"></th>
|
|
|
|
<th align="left" width="70%" tal:content="python: tool.translate('previous_value')"></th>
|
2009-12-14 13:22:55 -06:00
|
|
|
</tr>
|
2010-01-14 01:56:04 -06:00
|
|
|
<tr tal:repeat="change event/changes/items" valign="top">
|
2009-12-14 13:22:55 -06:00
|
|
|
<td tal:content="python: tool.translate(change[1][1])"></td>
|
2010-01-14 01:56:04 -06:00
|
|
|
<td tal:define="appyType python:contextObj.getAppyType(change[0]);
|
|
|
|
appyValue python: contextObj.getAppyValue(change[0], appyType, True, change[1][0]);
|
|
|
|
severalValues python: (appyType['multiplicity'][1] > 1) or (appyType['multiplicity'][1] == None)">
|
|
|
|
<span tal:condition="not: severalValues" tal:replace="appyValue"></span>
|
|
|
|
<ul tal:condition="python: severalValues">
|
|
|
|
<li tal:repeat="av appyValue" tal:content="av"></li>
|
|
|
|
</ul>
|
|
|
|
</td>
|
2009-12-14 13:22:55 -06:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tal:event>
|
|
|
|
</table>
|
|
|
|
</tal:history>
|
|
|
|
</metal:history>
|
2009-06-29 07:06:01 -05:00
|
|
|
|
2009-10-20 09:57:00 -05:00
|
|
|
<div metal:define-macro="pagePrologue">
|
|
|
|
<tal:comment replace="nothing">Global elements used in every page.</tal:comment>
|
2009-06-29 07:06:01 -05:00
|
|
|
|
2009-10-20 09:57:00 -05:00
|
|
|
<tal:comment replace="nothing">Javascript messages</tal:comment>
|
|
|
|
<script language="javascript" tal:content="tool/getJavascriptMessages"></script>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">"Static" javascripts</tal:comment>
|
2009-06-29 07:06:01 -05:00
|
|
|
<script language="javascript">
|
2009-10-20 09:57:00 -05:00
|
|
|
<!--
|
2009-10-30 15:31:39 -05:00
|
|
|
var isIe = (navigator.appName == "Microsoft Internet Explorer");
|
2009-10-25 15:42:08 -05:00
|
|
|
// AJAX machinery
|
|
|
|
var xhrObjects = new Array(); // An array of XMLHttpRequest objects
|
|
|
|
function XhrObject() { // Wraps a XmlHttpRequest object
|
|
|
|
this.freed = 1; // Is this xhr object already dealing with a request or not?
|
|
|
|
this.xhr = false;
|
|
|
|
if (window.XMLHttpRequest) this.xhr = new XMLHttpRequest();
|
|
|
|
else this.xhr = new ActiveXObject("Microsoft.XMLHTTP");
|
|
|
|
this.hook = ''; // The ID of the HTML element in the page that will be
|
|
|
|
// replaced by result of executing the Ajax request.
|
|
|
|
}
|
|
|
|
|
|
|
|
function getAjaxChunk(pos) {
|
|
|
|
// This function is the callback called by the AJAX machinery (see function
|
|
|
|
// askAjaxChunk below) when an Ajax response is available.
|
|
|
|
// First, find back the correct XMLHttpRequest object
|
|
|
|
if ( (typeof(xhrObjects[pos]) != 'undefined') &&
|
|
|
|
(xhrObjects[pos].freed == 0)) {
|
|
|
|
var hook = xhrObjects[pos].hook;
|
|
|
|
if (xhrObjects[pos].xhr.readyState == 1) {
|
|
|
|
// The request has been initialized: display the waiting radar
|
|
|
|
var hookElem = document.getElementById(hook);
|
|
|
|
if (hookElem) hookElem.innerHTML = "<div align=\"center\"><img src=\"skyn/waiting.gif\"/><\/div>";
|
|
|
|
}
|
|
|
|
if (xhrObjects[pos].xhr.readyState == 4) {
|
|
|
|
// We have received the HTML chunk
|
|
|
|
var hookElem = document.getElementById(hook);
|
|
|
|
if (hookElem && (xhrObjects[pos].xhr.status == 200)) {
|
|
|
|
hookElem.innerHTML = xhrObjects[pos].xhr.responseText;
|
|
|
|
}
|
|
|
|
xhrObjects[pos].freed = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function askAjaxChunk(hook, url) {
|
|
|
|
// This function will ask to get a chunk of HTML on the server by
|
|
|
|
// triggering a XMLHttpRequest.
|
|
|
|
// First, get a non-busy XMLHttpRequest object.
|
|
|
|
var pos = -1;
|
|
|
|
for (var i=0; i < xhrObjects.length; i++) {
|
|
|
|
if (xhrObjects[i].freed == 1) { pos = i; break; }
|
|
|
|
}
|
|
|
|
if (pos == -1) {
|
|
|
|
pos = xhrObjects.length;
|
|
|
|
xhrObjects[pos] = new XhrObject();
|
|
|
|
}
|
|
|
|
xhrObjects[pos].hook = hook;
|
|
|
|
if (xhrObjects[pos].xhr) {
|
|
|
|
xhrObjects[pos].freed = 0;
|
|
|
|
// Perform the asynchronous HTTP GET
|
|
|
|
xhrObjects[pos].xhr.open('GET', url, true);
|
|
|
|
xhrObjects[pos].xhr.onreadystatechange = function() { getAjaxChunk(pos); }
|
|
|
|
if (window.XMLHttpRequest) { xhrObjects[pos].xhr.send(null); }
|
|
|
|
else if (window.ActiveXObject) { xhrObjects[pos].xhr.send(); }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-10-20 09:57:00 -05:00
|
|
|
// Function used by checkbox widgets for having radio-button-like behaviour
|
|
|
|
function toggleCheckbox(visibleCheckbox, hiddenBoolean) {
|
|
|
|
vis = document.getElementById(visibleCheckbox);
|
|
|
|
hidden = document.getElementById(hiddenBoolean);
|
|
|
|
if (vis.checked) hidden.value = 'True';
|
|
|
|
else hidden.value = 'False';
|
|
|
|
}
|
|
|
|
// Functions used for master/slave relationships between widgets
|
|
|
|
function getMasterValue(widget) {
|
|
|
|
// Returns an array of selected options in a select widget
|
|
|
|
res = new Array();
|
|
|
|
if (widget.type == 'checkbox') {
|
|
|
|
var mv = widget.checked + '';
|
|
|
|
mv = mv.charAt(0).toUpperCase() + mv.substr(1);
|
|
|
|
res.push(mv);
|
|
|
|
}
|
|
|
|
else { // SELECT widget
|
|
|
|
for (var i=0; i < widget.options.length; i++) {
|
|
|
|
if (widget.options[i].selected) res.push(widget.options[i].value);
|
2009-06-29 07:06:01 -05:00
|
|
|
}
|
2009-10-20 09:57:00 -05:00
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
function updateSlaves(masterValues, appyTypeId) {
|
|
|
|
// Given the value(s) selected in a master field, this function updates the
|
|
|
|
// state of all corresponding slaves.
|
|
|
|
var slaves = cssQuery('div.slave_' + appyTypeId);
|
|
|
|
for (var i=0; i< slaves.length; i++){
|
|
|
|
slaves[i].style.display = "none";
|
|
|
|
}
|
|
|
|
for (var i=0; i < masterValues.length; i++) {
|
|
|
|
var activeSlaves = cssQuery('div.slaveValue_' + appyTypeId + '_' + masterValues[i]);
|
|
|
|
for (var j=0; j < activeSlaves.length; j++){
|
|
|
|
activeSlaves[j].style.display = "";
|
2009-06-29 07:06:01 -05:00
|
|
|
}
|
2009-10-20 09:57:00 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// Function used for triggering a workflow transition
|
|
|
|
function triggerTransition(transitionId) {
|
|
|
|
var theForm = document.getElementById('triggerTransitionForm');
|
|
|
|
theForm.workflow_action.value = transitionId;
|
|
|
|
theForm.submit();
|
|
|
|
}
|
|
|
|
function onDeleteObject(objectUid) {
|
|
|
|
if (confirm(delete_confirm)) {
|
|
|
|
f = document.getElementById('deleteForm');
|
|
|
|
f.objectUid.value = objectUid;
|
|
|
|
f.submit();
|
|
|
|
}
|
|
|
|
}
|
2009-12-14 13:22:55 -06:00
|
|
|
function toggleCookie(cookieId) {
|
|
|
|
// What is the state of this boolean (expanded/collapsed) cookie?
|
|
|
|
var state = readCookie(cookieId);
|
|
|
|
if ((state != 'collapsed') && (state != 'expanded')) {
|
|
|
|
// No cookie yet, create it.
|
|
|
|
createCookie(cookieId, 'collapsed');
|
|
|
|
state = 'collapsed';
|
|
|
|
}
|
|
|
|
var hook = document.getElementById(cookieId); // The hook is the part of
|
|
|
|
// the HTML document that needs to be shown or hidden.
|
|
|
|
var displayValue = 'none';
|
|
|
|
var newState = 'collapsed';
|
|
|
|
var imgSrc = 'skyn/expand.gif';
|
|
|
|
if (state == 'collapsed') {
|
|
|
|
// Show the HTML zone
|
|
|
|
displayValue = 'block';
|
|
|
|
imgSrc = 'skyn/collapse.gif';
|
|
|
|
newState = 'expanded';
|
|
|
|
}
|
|
|
|
// Update the corresponding HTML element
|
|
|
|
hook.style.display = displayValue;
|
|
|
|
var img = document.getElementById(cookieId + '_img');
|
|
|
|
img.src = imgSrc;
|
|
|
|
// Inverse the cookie value
|
|
|
|
createCookie(cookieId, newState);
|
|
|
|
}
|
2009-10-20 09:57:00 -05:00
|
|
|
-->
|
|
|
|
</script>
|
|
|
|
<tal:comment replace="nothing">Global form for deleting an object</tal:comment>
|
|
|
|
<form id="deleteForm" method="post" action="skyn/do">
|
|
|
|
<input type="hidden" name="action" value="Delete"/>
|
|
|
|
<input type="hidden" name="objectUid"/>
|
|
|
|
</form>
|
2009-06-29 07:06:01 -05:00
|
|
|
</div>
|
|
|
|
|
2009-10-18 07:52:27 -05:00
|
|
|
<div metal:define-macro="showPageHeader"
|
|
|
|
tal:define="appyPages python: contextObj.getAppyPages(phase);
|
2009-12-14 13:22:55 -06:00
|
|
|
showCommonInfo python: not isEdit;
|
|
|
|
hasHistory contextObj/hasHistory;
|
|
|
|
historyExpanded python: tool.getCookieValue('appyHistory', default='collapsed') == 'expanded';
|
|
|
|
creator contextObj/Creator"
|
2009-11-17 03:05:19 -06:00
|
|
|
tal:condition="not: contextObj/isTemporary">
|
2009-06-29 07:06:01 -05:00
|
|
|
|
|
|
|
<tal:comment replace="nothing">Information that is common to all tabs (object title, state, etc)</tal:comment>
|
|
|
|
<table width="100%" tal:condition="showCommonInfo" class="appyCommonInfo">
|
|
|
|
<tr valign="bottom">
|
|
|
|
<tal:comment replace="nothing">Title, edit icon and state</tal:comment>
|
|
|
|
<td width="80%">
|
2009-10-18 07:52:27 -05:00
|
|
|
<b class="appyTitle" tal:content="contextObj/title_or_id"></b>
|
2009-06-29 07:06:01 -05:00
|
|
|
<tal:comment replace="nothing">Show the phase name tied to this page</tal:comment>
|
|
|
|
<span class="discreet" tal:condition="python: phaseInfo['totalNbOfPhases']>1">−
|
2009-10-18 07:52:27 -05:00
|
|
|
<span tal:replace="python:contextObj.translate('phase')"/>:
|
|
|
|
<span tal:replace="python:tool.translate('%s_phase_%s' % (contextObj.meta_type, phase))"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
</span>
|
|
|
|
<tal:comment replace="nothing">When no tabs are shown, we provide an edit icon.</tal:comment>
|
2010-01-08 11:03:59 -06:00
|
|
|
<img tal:define="editPageName python:test(pageName=='main', 'default', pageName);
|
|
|
|
nav request/nav|nothing;
|
|
|
|
nav python: test(nav, '&nav=%s' % nav, '')"
|
2009-11-25 13:37:22 -06:00
|
|
|
title="Edit" i18n:domain="plone" i18n:attributes="title" style="cursor:pointer"
|
2010-01-08 11:03:59 -06:00
|
|
|
tal:attributes="onClick python: 'href: window.location=\'%s/skyn/edit?fieldset=%s&phase=%s%s\'' % (contextObj.absolute_url(), editPageName, phase, nav);
|
2009-11-25 13:37:22 -06:00
|
|
|
src string: $portal_url/skyn/edit.gif"
|
2009-10-18 07:52:27 -05:00
|
|
|
tal:condition="python: (len(appyPages)==1) and member.has_permission('Modify portal content', contextObj)"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
</td>
|
|
|
|
<td><metal:actions use-macro="here/document_actions/macros/document_actions"/>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2009-10-18 07:52:27 -05:00
|
|
|
<tr tal:define="descrLabel python: contextObj.translate('%s_edit_descr' % contextObj.portal_type)"
|
2009-11-17 03:05:19 -06:00
|
|
|
tal:condition="descrLabel/strip" >
|
2009-06-29 07:06:01 -05:00
|
|
|
<tal:comment replace="nothing">Content type description</tal:comment>
|
|
|
|
<td colspan="2" class="discreet" tal:content="descrLabel"/>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2009-12-14 13:22:55 -06:00
|
|
|
<td class="documentByLine">
|
|
|
|
<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">
|
|
|
|
<img align="left" style="cursor:pointer" onClick="javascript:toggleCookie('appyHistory')"
|
|
|
|
tal:attributes="src python:test(historyExpanded, 'skyn/collapse.gif', 'skyn/expand.gif');"
|
|
|
|
id="appyHistory_img"/>
|
|
|
|
<span i18n:translate="label_history" i18n:domain="plone" class="appyHistory"></span>
|
|
|
|
</tal:accessHistory>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Show document creator</tal:comment>
|
|
|
|
<tal:creator condition="creator"
|
|
|
|
define="author python:contextObj.portal_membership.getMemberInfo(creator)">
|
|
|
|
<span class="documentAuthor" i18n:domain="plone" i18n:translate="label_by_author">
|
|
|
|
by <a tal:attributes="href string:${portal_url}/author/${creator}"
|
|
|
|
tal:content="python:author and author['fullname'] or creator"
|
|
|
|
tal:omit-tag="not:author" i18n:name="author"/>
|
|
|
|
—
|
|
|
|
</span>
|
|
|
|
</tal:creator>
|
|
|
|
<tal:comment replace="nothing">Show last modification date</tal:comment>
|
|
|
|
<span i18n:translate="box_last_modified" i18n:domain="plone"></span>
|
|
|
|
<span tal:replace="python:contextObj.toLocalizedTime(contextObj.ModificationDate(),long_format=1)"></span>
|
2009-06-29 07:06:01 -05:00
|
|
|
</td>
|
2009-10-18 07:52:27 -05:00
|
|
|
<td valign="top"><metal:pod use-macro="here/skyn/macros/macros/listPodTemplates"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
2009-12-14 13:22:55 -06:00
|
|
|
<tal:comment replace="nothing">Object history</tal:comment>
|
|
|
|
<tr tal:condition="hasHistory">
|
|
|
|
<td colspan="2">
|
|
|
|
<span id="appyHistory"
|
|
|
|
tal:attributes="style python:test(historyExpanded, 'display:block', 'display:none')">
|
|
|
|
<div tal:define="ajaxHookId python: contextObj.UID() + '_history';
|
|
|
|
ajaxUrl python: contextObj.getUrl('showHistory')"
|
|
|
|
tal:attributes="id ajaxHookId">
|
|
|
|
<script language="javascript" tal:content="python: 'askAjaxChunk(\'%s\',\'%s\')' % (ajaxHookId, ajaxUrl)">
|
|
|
|
</script>
|
|
|
|
</div>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2009-06-29 07:06:01 -05:00
|
|
|
|
|
|
|
<tal:comment replace="nothing">Workflow-related information and actions</tal:comment>
|
2009-10-18 07:52:27 -05:00
|
|
|
<tr tal:condition="python: showWorkflow and contextObj.getWorkflowLabel()">
|
2009-06-29 07:06:01 -05:00
|
|
|
<td colspan="2" class="appyWorkflow">
|
|
|
|
<table width="100%">
|
|
|
|
<tr>
|
2009-10-18 07:52:27 -05:00
|
|
|
<td><metal:states use-macro="here/skyn/macros/macros/states"/></td>
|
|
|
|
<td align="right"><metal:states use-macro="here/skyn/macros/macros/transitions"/></td>
|
2009-06-29 07:06:01 -05:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2009-11-17 03:05:19 -06:00
|
|
|
<metal:nav use-macro="here/skyn/macros/macros/objectNavigate"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
|
|
|
|
<tal:comment replace="nothing">Tabs</tal:comment>
|
2009-10-18 07:52:27 -05:00
|
|
|
<ul class="contentViews appyTabs" tal:condition="python: len(appyPages)>1">
|
2009-06-29 07:06:01 -05:00
|
|
|
<li tal:repeat="thePage appyPages"
|
|
|
|
tal:attributes="class python:test(thePage == pageName, 'selected', 'plain')">
|
2009-10-18 07:52:27 -05:00
|
|
|
<tal:tab define="pageLabel python: tool.translate('%s_page_%s' % (contextObj.meta_type, thePage))">
|
|
|
|
<a tal:content="pageLabel"
|
|
|
|
tal:attributes="href python: contextObj.absolute_url() + '/skyn/view?phase=%s&pageName=%s' % (phase, thePage)">
|
2009-06-29 07:06:01 -05:00
|
|
|
</a>
|
2010-01-08 11:03:59 -06:00
|
|
|
<img tal:define="editPageName python:test(thePage=='main', 'default', thePage);
|
|
|
|
nav request/nav|nothing;
|
|
|
|
nav python: test(nav, '&nav=%s' % nav, '')"
|
2009-11-25 13:37:22 -06:00
|
|
|
title="Edit" i18n:domain="plone" i18n:attributes="title" style="cursor:pointer" class="appyPlusImg"
|
2010-01-08 11:03:59 -06:00
|
|
|
tal:attributes="onClick python: 'href: window.location=\'%s/skyn/edit?fieldset=%s&phase=%s%s\'' % (contextObj.absolute_url(), editPageName, phase, nav);
|
2009-11-25 13:37:22 -06:00
|
|
|
src string: $portal_url/skyn/edit.gif"
|
2009-10-18 07:52:27 -05:00
|
|
|
tal:condition="python: member.has_permission('Modify portal content', contextObj)"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:tab>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
2009-10-18 07:52:27 -05:00
|
|
|
<div metal:define-macro="showPageFooter">
|
2009-06-29 07:06:01 -05:00
|
|
|
<script language="javascript">
|
|
|
|
<!--
|
|
|
|
// When the current page is loaded, we must set the correct state for all slave fields.
|
|
|
|
var masters = cssQuery('.appyMaster');
|
|
|
|
for (var i=0; i < masters.length; i++) {
|
|
|
|
var cssClasses = masters[i].className.split(' ');
|
|
|
|
for (var j=0; j < cssClasses.length; j++) {
|
|
|
|
if (cssClasses[j].indexOf('master_') == 0) {
|
|
|
|
var appyId = cssClasses[j].split('_')[1];
|
|
|
|
var masterValue = [];
|
|
|
|
if (masters[i].nodeName == 'SPAN'){
|
|
|
|
var idField = masters[i].id;
|
|
|
|
if (idField == '') {
|
|
|
|
masterValue.push(idField);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (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++){
|
|
|
|
var subValue = subValues[k].strip();
|
|
|
|
masterValue.push(subValue.substring(1, subValue.length-1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else { masterValue.push(masters[i].id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else { masterValue = getMasterValue(masters[i]);
|
|
|
|
}
|
|
|
|
updateSlaves(masterValue, appyId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
-->
|
|
|
|
</script>
|
|
|
|
</div>
|
|
|
|
|
2009-11-03 08:02:18 -06:00
|
|
|
<metal:queryResults define-macro="queryResult"
|
2009-11-17 03:05:19 -06:00
|
|
|
tal:define="tool python: contextObj;
|
|
|
|
contentType request/type_name;
|
2009-11-03 08:02:18 -06:00
|
|
|
flavourNumber python: int(request['flavourNumber']);
|
2009-11-17 03:05:19 -06:00
|
|
|
startNumber request/startNumber|python:'0';
|
|
|
|
startNumber python: int(startNumber);
|
|
|
|
searchName request/search;
|
2009-12-30 10:12:18 -06:00
|
|
|
searchLabel python: test(searchName=='_advanced', 'search_results', '%s_search_%s' % (contentType, searchName));
|
2009-11-17 03:05:19 -06:00
|
|
|
searchDescr python: '%s_descr' % searchLabel;
|
|
|
|
severalTypes python: contentType and (contentType.find(',') != -1);
|
|
|
|
queryResult python: tool.executeQuery(contentType, flavourNumber, searchName, startNumber, remember=True);
|
|
|
|
objs queryResult/objects;
|
|
|
|
totalNumber queryResult/totalNumber;
|
|
|
|
batchSize queryResult/batchSize;
|
|
|
|
ajaxHookId python:'queryResult';
|
2010-01-06 11:36:16 -06:00
|
|
|
baseUrl python: tool.getQueryUrl(contentType, flavourNumber, searchName, startNumber='**v**');
|
|
|
|
newSearchUrl python: '%s/skyn/search?type_name=%s&flavourNumber=%d' % (tool.getAppFolder().absolute_url(), contentType, flavourNumber);">
|
2009-11-03 08:02:18 -06:00
|
|
|
|
|
|
|
<tal:result condition="objs">
|
|
|
|
|
2009-11-17 03:05:19 -06:00
|
|
|
<fieldset>
|
|
|
|
<legend>
|
|
|
|
<span tal:replace="structure python: test(searchName, tool.translate(searchLabel), test(severalTypes, tool.translate(tool.getAppName()), tool.translate('%s_plural' % contentType)))"/>
|
|
|
|
(<span tal:replace="totalNumber"/>)
|
2010-01-06 11:36:16 -06:00
|
|
|
<tal:newSearch condition="python: searchName == '_advanced'">
|
|
|
|
— <i><a tal:attributes="href newSearchUrl"
|
|
|
|
tal:content="python: tool.translate('search_new')"></a></i>
|
|
|
|
</tal:newSearch>
|
2009-11-17 03:05:19 -06:00
|
|
|
</legend>
|
2009-11-03 08:02:18 -06:00
|
|
|
|
2009-11-17 03:05:19 -06:00
|
|
|
<table cellpadding="0" cellspacing="0" width="100%"><tr>
|
2009-11-17 08:46:41 -06:00
|
|
|
<td tal:define="descr python: tool.translate(searchDescr)"
|
|
|
|
tal:condition="python: searchName and descr">
|
|
|
|
<span class="discreet" tal:content="descr"></span><br/><br/>
|
2009-11-17 03:05:19 -06:00
|
|
|
</td>
|
2009-11-24 15:41:42 -06:00
|
|
|
<td align="right" width="25%">
|
2009-11-17 03:05:19 -06:00
|
|
|
<tal:comment replace="nothing">Appy (top) navigation</tal:comment>
|
|
|
|
<metal:nav use-macro="here/skyn/macros/macros/appyNavigate"/>
|
|
|
|
</td>
|
|
|
|
</tr></table>
|
|
|
|
|
|
|
|
<table tal:define="fieldDescrs python: tool.getResultColumns(objs[0], contentType)"
|
2009-12-15 14:30:43 -06:00
|
|
|
class="listing nosort" width="100%" cellpadding="0" cellspacing="0">
|
2009-06-29 07:06:01 -05:00
|
|
|
<tal:comment replace="nothing">Every item in fieldDescr is a FieldDescr instance,
|
2009-10-18 07:52:27 -05:00
|
|
|
excepted for workflow state (which is not a field): in this case it is simply the
|
|
|
|
string "workflowState".</tal:comment>
|
2009-06-29 07:06:01 -05:00
|
|
|
|
2010-01-08 11:03:59 -06:00
|
|
|
<tal:comment replace="nothing">Headers, with (disabled) filters and sort arrows</tal:comment>
|
2009-06-29 07:06:01 -05:00
|
|
|
<tr>
|
|
|
|
<tal:comment replace="nothing">Mandatory column "Title"/"Name"</tal:comment>
|
2010-01-08 11:03:59 -06:00
|
|
|
<th><!--img tal:attributes= "src string: $portal_url/arrowDown.gif;
|
2009-07-28 03:14:40 -05:00
|
|
|
onClick python:'javascript:onSort(\'title\')';"
|
2010-01-08 11:03:59 -06:00
|
|
|
id="arrow_title" style="cursor:pointer"/-->
|
2009-10-18 07:52:27 -05:00
|
|
|
<span tal:content="python: tool.translate('ref_name')"/>
|
2009-11-06 04:33:56 -06:00
|
|
|
<!--input id="filter_title" type="text" size="5" onkeyup="javascript:onTextEntered('title')"/-->
|
|
|
|
<tal:comment replace="nothing">Input fields like this have been commented out because they will
|
|
|
|
be replaced by Ajax server- searches that will be more relevant (the current Javascript search
|
|
|
|
is limited to the batch, which has little interest).</tal:comment>
|
2009-06-29 07:06:01 -05:00
|
|
|
</th>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Columns corresponding to other fields</tal:comment>
|
|
|
|
<tal:columnHeader repeat="fieldDescr fieldDescrs">
|
|
|
|
<th tal:define="fieldName fieldDescr/atField/getName|string:workflow_state">
|
2010-01-08 11:03:59 -06:00
|
|
|
<!--img tal:attributes= "src string: $portal_url/arrowDown.gif;
|
2009-06-29 07:06:01 -05:00
|
|
|
onClick python:'javascript:onSort(\'%s\')' % fieldName;
|
|
|
|
id python: 'arrow_%s' % fieldName"
|
2010-01-08 11:03:59 -06:00
|
|
|
style="cursor:pointer"/-->
|
2009-06-29 07:06:01 -05:00
|
|
|
<tal:comment replace="nothing">Display header for a "standard" field</tal:comment>
|
|
|
|
<tal:standardField condition="python: fieldName != 'workflow_state'">
|
2009-10-18 07:52:27 -05:00
|
|
|
<span tal:replace="python: tool.translate(fieldDescr['atField'].widget.label_msgid)"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:standardField>
|
|
|
|
<tal:comment replace="nothing">Display header for the workflow state</tal:comment>
|
|
|
|
<tal:workflowState condition="python: fieldName == 'workflow_state'">
|
2009-10-18 07:52:27 -05:00
|
|
|
<span tal:replace="python: tool.translate('workflow_state')"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:workflowState>
|
2009-11-06 04:33:56 -06:00
|
|
|
<!--input type="text" size="5"
|
2009-06-29 07:06:01 -05:00
|
|
|
tal:attributes="id python: 'filter_%s' % fieldName;
|
2009-11-06 04:33:56 -06:00
|
|
|
onkeyup python:'javascript:onTextEntered(\'%s\')' % fieldName"/-->
|
2009-06-29 07:06:01 -05:00
|
|
|
</th>
|
|
|
|
</tal:columnHeader>
|
|
|
|
|
2009-11-03 08:02:18 -06:00
|
|
|
<tal:comment replace="nothing">Column "Object type", shown if instances of several types are shown</tal:comment>
|
2010-01-08 11:03:59 -06:00
|
|
|
<th tal:condition="severalTypes"><!--img
|
2009-06-29 07:06:01 -05:00
|
|
|
tal:attributes= "src string: $portal_url/arrowDown.gif;
|
|
|
|
onClick python:'javascript:onSort(\'root_type\')';"
|
2010-01-08 11:03:59 -06:00
|
|
|
id = "arrow_root_type" style="cursor:pointer"/-->
|
2009-10-18 07:52:27 -05:00
|
|
|
<span tal:replace="python: tool.translate('root_type')"/>
|
2009-11-06 04:33:56 -06:00
|
|
|
<!--input type="text" size="5" id="filter_root_type"
|
|
|
|
tal:attributes="onkeyup python:'javascript:onTextEntered(\'root_type\')'"/-->
|
2009-06-29 07:06:01 -05:00
|
|
|
</th>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Column "Actions"</tal:comment>
|
2009-10-18 07:52:27 -05:00
|
|
|
<th tal:content="python: tool.translate('ref_actions')"></th>
|
2009-06-29 07:06:01 -05:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Results</tal:comment>
|
2009-12-15 14:30:43 -06:00
|
|
|
<tal:row repeat="obj objs">
|
|
|
|
<tr id="query_row" tal:define="odd repeat/obj/odd"
|
|
|
|
tal:attributes="class python:test(odd, 'even', 'odd')">
|
2009-06-29 07:06:01 -05:00
|
|
|
|
|
|
|
<tal:comment replace="nothing">Mandatory column "Title"/"Name"</tal:comment>
|
2009-11-17 03:05:19 -06:00
|
|
|
<td id="field_title"><a
|
|
|
|
tal:define="navInfo python:'nav=search.%s:%d.%s.%d.%d' % (contentType, flavourNumber, searchName, repeat['obj'].number()+startNumber, totalNumber);"
|
|
|
|
tal:content="obj/Title" tal:attributes="href python: obj.getUrl() + '/?' + navInfo"></a></td>
|
2009-06-29 07:06:01 -05:00
|
|
|
|
|
|
|
<tal:comment replace="nothing">Columns corresponding to other fields</tal:comment>
|
|
|
|
<tal:otherFields repeat="fieldDescr fieldDescrs">
|
|
|
|
<tal:standardField condition="python: fieldDescr != 'workflowState'">
|
2009-07-10 08:01:50 -05:00
|
|
|
<td tal:condition="fieldDescr/atField"
|
|
|
|
tal:attributes="id python:'field_%s' % fieldDescr['atField'].getName()">
|
2009-06-29 07:06:01 -05:00
|
|
|
<tal:field define="contextObj python:obj;
|
|
|
|
isEdit python:False;
|
|
|
|
showLabel python:False;
|
|
|
|
innerRef python:True"
|
|
|
|
condition="python: contextObj.showField(fieldDescr)">
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:field use-macro="here/skyn/macros/macros/showArchetypesField"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:field>
|
|
|
|
</td>
|
2009-07-10 08:01:50 -05:00
|
|
|
<td tal:condition="not: fieldDescr/atField" style="color:red">Field
|
|
|
|
<span tal:replace="fieldDescr/name"/> not found.
|
|
|
|
</td>
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:standardField>
|
|
|
|
<tal:workflowState condition="python: fieldDescr == 'workflowState'">
|
2009-10-18 07:52:27 -05:00
|
|
|
<td id="field_workflow_state" tal:content="python: tool.translate(obj.getWorkflowLabel())"></td>
|
2009-06-29 07:06:01 -05:00
|
|
|
</tal:workflowState>
|
|
|
|
</tal:otherFields>
|
|
|
|
|
2009-11-03 08:02:18 -06:00
|
|
|
<tal:comment replace="nothing">Column "Object type", shown if instances of several types are shown</tal:comment>
|
|
|
|
<td tal:condition="severalTypes" id="field_root_type"
|
2009-10-18 07:52:27 -05:00
|
|
|
tal:content="python: tool.translate(obj.portal_type)"></td>
|
2009-06-29 07:06:01 -05:00
|
|
|
|
|
|
|
<tal:comment replace="nothing">Column "Actions"</tal:comment>
|
|
|
|
<td align="right">
|
|
|
|
<table class="no-style-table" cellpadding="0" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<tal:comment replace="nothing">Edit the element</tal:comment>
|
2009-10-18 07:52:27 -05:00
|
|
|
<td class="noPadding"><a tal:attributes="href python: obj.absolute_url() + '/skyn/edit'"
|
2009-06-29 07:06:01 -05:00
|
|
|
tal:condition="python: member.has_permission('Modify portal content', obj)">
|
2009-11-25 13:37:22 -06:00
|
|
|
<img title="Edit" i18n:domain="plone" i18n:attributes="title"
|
|
|
|
tal:attributes="src string: $portal_url/skyn/edit.gif"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
</a></td>
|
|
|
|
<tal:comment replace="nothing">Delete the element</tal:comment>
|
2009-10-20 09:57:00 -05:00
|
|
|
<td class="noPadding">
|
|
|
|
<img tal:condition="python: member.has_permission('Delete objects', obj)"
|
2009-11-24 15:41:42 -06:00
|
|
|
title="Delete" i18n:domain="plone" i18n:attributes="title" style="cursor:pointer"
|
|
|
|
tal:attributes="src string: $portal_url/skyn/delete.png;
|
|
|
|
onClick python:'javascript:onDeleteObject(\'%s\')' % obj.UID()"/>
|
2009-10-20 09:57:00 -05:00
|
|
|
</td>
|
2009-06-29 07:06:01 -05:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2009-12-15 14:30:43 -06:00
|
|
|
</tal:row>
|
2009-11-17 03:05:19 -06:00
|
|
|
</table>
|
2009-06-29 07:06:01 -05:00
|
|
|
|
2009-11-17 03:05:19 -06:00
|
|
|
<tal:comment replace="nothing">Appy (bottom) navigation</tal:comment>
|
|
|
|
<metal:nav use-macro="here/skyn/macros/macros/appyNavigate"/>
|
|
|
|
</fieldset>
|
2009-11-03 08:02:18 -06:00
|
|
|
</tal:result>
|
|
|
|
|
2010-01-06 11:36:16 -06:00
|
|
|
<tal:noResult condition="not: objs">
|
|
|
|
<span tal:replace="python: tool.translate('query_no_result')"/>
|
|
|
|
<tal:newSearch condition="python: searchName == '_advanced'">
|
|
|
|
<br/><i class="discreet"><a tal:attributes="href newSearchUrl"
|
|
|
|
tal:content="python: tool.translate('search_new')"></a></i>
|
|
|
|
</tal:newSearch>
|
|
|
|
</tal:noResult>
|
2009-11-03 08:02:18 -06:00
|
|
|
|
|
|
|
</metal:queryResults>
|
2009-06-29 07:06:01 -05:00
|
|
|
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:phases define-macro="phases">
|
2009-06-29 07:06:01 -05:00
|
|
|
<tal:comment replace="nothing">This macro displays phases defined for a given content type,
|
|
|
|
only if more than one phase is defined.</tal:comment>
|
2009-10-18 07:52:27 -05:00
|
|
|
<table width="100%" tal:define="phases contextObj/getAppyPhases|nothing"
|
|
|
|
tal:condition="python: phases and (len(phases)>1)" cellspacing="1" cellpadding="0">
|
2009-06-29 07:06:01 -05:00
|
|
|
<tal:phase repeat="phase phases">
|
|
|
|
<tr>
|
2009-10-18 07:52:27 -05:00
|
|
|
<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())"
|
2009-06-29 07:06:01 -05:00
|
|
|
tal:attributes="class python: 'appyPhase step' + phase['phaseStatus']">
|
2009-10-18 07:52:27 -05:00
|
|
|
<a tal:attributes="href python: '%s?phase=%s&pageName=%s' % (contextObj.getUrl(), phase['name'], phase['pages'][0]);" tal:condition="displayLink"
|
|
|
|
tal:content="python: tool.translate(label)"/>
|
|
|
|
<span tal:condition="not: displayLink" tal:content="python: tool.translate(label)"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr tal:condition="python: phase['name'] != phases[-1]['name']">
|
2009-10-18 07:52:27 -05:00
|
|
|
<td align="center"><img tal:attributes="src string: $portal_url/skyn/nextPhase.png"/></td>
|
2009-06-29 07:06:01 -05:00
|
|
|
</tr>
|
|
|
|
</tal:phase>
|
|
|
|
</table>
|
|
|
|
</metal:phases>
|
|
|
|
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:states define-macro="states"
|
2009-06-29 07:06:01 -05:00
|
|
|
tal:define="showAllStatesInPhase python: flavour.getAttr('showAllStatesInPhaseFor' + contextObj.meta_type);
|
2009-10-18 07:52:27 -05:00
|
|
|
states python: contextObj.getAppyStates(phase, currentOnly=not showAllStatesInPhase)"
|
2009-06-29 07:06:01 -05:00
|
|
|
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']"
|
2009-10-18 07:52:27 -05:00
|
|
|
tal:content="python: tool.translate(contextObj.getWorkflowLabel(stateInfo['name']))">
|
2009-06-29 07:06:01 -05:00
|
|
|
</td>
|
|
|
|
<td tal:condition="python: stateInfo['name'] != states[-1]['name']">
|
2009-10-18 07:52:27 -05:00
|
|
|
<img tal:attributes="src string: $portal_url/skyn/nextState.png"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
</td>
|
|
|
|
</tal:state>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</metal:states>
|
|
|
|
|
2009-10-18 07:52:27 -05:00
|
|
|
<metal:transitions define-macro="transitions"
|
2009-11-06 04:33:56 -06:00
|
|
|
tal:define="transitions contextObj/getAppyTransitions"
|
2009-06-29 07:06:01 -05:00
|
|
|
tal:condition="transitions">
|
|
|
|
<form id="triggerTransitionForm" method="post"
|
2009-10-18 07:52:27 -05:00
|
|
|
tal:attributes="action python: contextObj.absolute_url() + '/skyn/do'">
|
2009-10-20 09:57:00 -05:00
|
|
|
<input type="hidden" name="action" value="TriggerTransition"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
<input type="hidden" name="workflow_action"/>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<tal:comment replace="nothing">Input field allowing to enter a comment before triggering a transition</tal:comment>
|
2009-10-18 07:52:27 -05:00
|
|
|
<td tal:define="showCommentsField python:flavour.getAttr('showWorkflowCommentFieldFor'+contextObj.meta_type)"
|
2009-06-29 07:06:01 -05:00
|
|
|
align="right" tal:condition="showCommentsField">
|
2009-10-18 07:52:27 -05:00
|
|
|
<span tal:content="python: tool.translate('workflow_comment')" class="discreet"></span>
|
2009-06-29 07:06:01 -05:00
|
|
|
<input type="text" id="comment" name="comment" size="35"/>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Buttons for triggering transitions</tal:comment>
|
|
|
|
<td align="right" tal:repeat="transition transitions">
|
2009-10-18 07:52:27 -05:00
|
|
|
<input type="button" class="context"
|
|
|
|
tal:attributes="value python: tool.translate(transition['name']);
|
|
|
|
onClick python: 'javascript: triggerTransition(\'%s\')' % transition['id'];"/>
|
2009-06-29 07:06:01 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
</metal:transitions>
|
2009-10-18 07:52:27 -05:00
|
|
|
|
2009-11-03 08:02:18 -06:00
|
|
|
<metal:portletContent define-macro="portletContent"
|
|
|
|
tal:define="queryUrl python: '%s/skyn/query' % appFolder.absolute_url();
|
|
|
|
currentSearch request/search|nothing;
|
|
|
|
currentType request/type_name|nothing;">
|
2009-10-18 07:52:27 -05:00
|
|
|
<tal:comment replace="nothing">Portlet title, with link to tool.</tal:comment>
|
|
|
|
<dt class="portletHeader">
|
2009-11-03 08:02:18 -06:00
|
|
|
<tal:comment replace="nothing">If there is only one flavour, clicking on the portlet
|
|
|
|
title allows to see all root objects in the database.</tal:comment>
|
|
|
|
<a tal:condition="python: len(flavours)==1"
|
|
|
|
tal:attributes="href python:'%s?type_name=%s&flavourNumber=1' % (queryUrl, ','.join(rootClasses))"
|
|
|
|
tal:content="python: tool.translate(appName)"></a>
|
|
|
|
<span tal:condition="python: len(flavours)>1"
|
|
|
|
tal:replace="python: tool.translate(appName)"/>
|
2009-10-18 07:52:27 -05:00
|
|
|
<img style="cursor:pointer"
|
|
|
|
tal:condition="python: member.has_role('Manager')"
|
|
|
|
tal:attributes="onClick python: 'href: window.location=\'%s/skyn/view\'' % tool.absolute_url();
|
|
|
|
title python: tool.translate('%sTool' % appName);
|
|
|
|
src string:$portal_url/skyn/appyConfig.gif"/>
|
|
|
|
</dt>
|
|
|
|
|
2009-11-03 08:02:18 -06:00
|
|
|
<tal:comment replace="nothing">TODO: implement a widget for selecting the needed flavour.</tal:comment>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Create a section for every root class.</tal:comment>
|
2010-01-06 11:36:16 -06:00
|
|
|
<tal:section repeat="rootClass rootClasses"
|
|
|
|
define="flavourNumber python:1;
|
|
|
|
flavour python: tool.getFlavour('Dummy_%d' % flavourNumber)">
|
2009-11-03 08:02:18 -06:00
|
|
|
<tal:comment replace="nothing">Section title, with action icons</tal:comment>
|
|
|
|
<dt tal:attributes="class python:test(repeat['rootClass'].number()==1, '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);
|
|
|
|
class python:test(not currentSearch and (currentType==rootClass), 'portletCurrent', '')"
|
|
|
|
tal:content="python: tool.translate(rootClass + '_plural')"></a>
|
|
|
|
</td>
|
|
|
|
<td align="right"
|
|
|
|
tal:define="addPermission python: '%s: Add %s' % (appName, rootClass);
|
|
|
|
userMayAdd python: member.has_permission(addPermission, appFolder);
|
|
|
|
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')"/>
|
2009-12-30 10:12:18 -06:00
|
|
|
<tal:comment replace="nothing">Search objects of this type (todo: update flavourNumber)</tal:comment>
|
|
|
|
<img style="cursor:pointer"
|
2010-01-06 11:36:16 -06:00
|
|
|
tal:define="showSearch python: flavour.getAttr('enableAdvancedSearchFor%s' % rootClass)"
|
|
|
|
tal:condition="showSearch"
|
2009-12-30 10:12:18 -06:00
|
|
|
tal:attributes="onClick python: 'href: window.location=\'%s/skyn/search?type_name=%s&flavourNumber=1\'' % (appFolder.absolute_url(), rootClass);
|
|
|
|
src string: $portal_url/skyn/search.gif;
|
|
|
|
title python: tool.translate('search_objects')"/>
|
2009-11-03 08:02:18 -06:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</dt>
|
|
|
|
<tal:comment replace="nothing">Searches for this content type.</tal:comment>
|
2009-11-06 04:33:56 -06:00
|
|
|
<tal:searchOrGroup repeat="searchOrGroup python: tool.getSearches(rootClass)">
|
|
|
|
<tal:group condition="searchOrGroup/isGroup">
|
|
|
|
<tal:expanded define="group searchOrGroup;
|
2009-11-11 13:22:13 -06:00
|
|
|
expanded python: tool.getCookieValue(group['labelId'], default='collapsed') == 'expanded'">
|
2009-11-06 04:33:56 -06: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'];
|
|
|
|
src python:test(expanded, 'skyn/collapse.gif', 'skyn/expand.gif');
|
2009-12-14 13:22:55 -06:00
|
|
|
onClick python:'javascript:toggleCookie(\'%s\')' % group['labelId']"/>
|
2009-11-06 04:33:56 -06:00
|
|
|
<span tal:replace="group/label"/>
|
|
|
|
</dt>
|
|
|
|
<tal:comment replace="nothing">Group searches</tal:comment>
|
2009-11-11 13:22:13 -06:00
|
|
|
<span tal:attributes="id group/labelId;
|
2009-12-14 13:22:55 -06:00
|
|
|
style python:test(expanded, 'display:block', 'display:none')">
|
2009-11-11 13:22:13 -06:00
|
|
|
<dt class="portletAppyItem portletSearch portletGroupItem" tal:repeat="search group/searches">
|
2009-11-06 04:33:56 -06:00
|
|
|
<a tal:attributes="href python: '%s?type_name=%s&flavourNumber=%s&search=%s' % (queryUrl, rootClass, flavourNumber, search['name']);
|
|
|
|
title search/descr;
|
|
|
|
class python: test(search['name'] == currentSearch, 'portletCurrent', '');"
|
|
|
|
tal:content="structure search/label"></a>
|
|
|
|
</dt>
|
2009-11-11 13:22:13 -06:00
|
|
|
</span>
|
2009-11-06 04:33:56 -06:00
|
|
|
</tal:expanded>
|
|
|
|
</tal:group>
|
|
|
|
<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']);
|
|
|
|
title search/descr;
|
2009-11-11 13:22:13 -06:00
|
|
|
class python: test(search['name'] == currentSearch, 'portletCurrent', '');"
|
2009-11-06 04:33:56 -06:00
|
|
|
tal:content="structure search/label"></a>
|
|
|
|
</dt>
|
|
|
|
</tal:searchOrGroup>
|
2009-11-03 08:02:18 -06:00
|
|
|
</tal:section>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">All objects in flavour</tal:comment>
|
|
|
|
<!--dt class="portletAppyItem" tal:define="flavourInfo python: flavours[0]">
|
2009-10-18 07:52:27 -05:00
|
|
|
<a tal:define="flavourNumber flavourInfo/number;
|
|
|
|
rootTypes python: test(flavourNumber==1, rootClasses, ['%s_%s' % (rc, flavourNumber) for rc in rootClasses]);
|
|
|
|
rootClassesQuery python:','.join(rootTypes)"
|
2009-11-03 08:02:18 -06:00
|
|
|
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-->
|
2009-10-18 07:52:27 -05:00
|
|
|
|
|
|
|
<dt class="portletAppyItem" tal:define="contextObj tool/getPublishedObject"
|
|
|
|
tal:condition="python: contextObj.meta_type in rootClasses">
|
|
|
|
<metal:phases use-macro="here/skyn/macros/macros/phases"/>
|
|
|
|
</dt>
|
|
|
|
</metal:portletContent>
|
2009-10-25 15:42:08 -05:00
|
|
|
|
2009-11-03 08:02:18 -06:00
|
|
|
<div metal:define-macro="appyNavigate" tal:condition="python: totalNumber > batchSize" align="right">
|
|
|
|
<tal:comment replace="nothing">
|
|
|
|
Buttons for navigating among a list of elements (next, back, first, last, etc).
|
|
|
|
</tal:comment>
|
|
|
|
<table cellpadding="0" cellspacing="0" class="appyNav">
|
2009-10-25 15:42:08 -05:00
|
|
|
<tr>
|
|
|
|
<tal:comment replace="nothing">Go to the first page</tal:comment>
|
|
|
|
<td><img style="cursor:pointer" tal:condition="python: (startNumber != 0) and (startNumber != batchSize)"
|
|
|
|
tal:attributes="src string: $portal_url/skyn/arrowLeftDouble.png;
|
|
|
|
title python: tool.translate('goto_first');
|
2009-11-17 03:05:19 -06:00
|
|
|
onClick python: 'askAjaxChunk(\'%s\', \'%s\')' % (ajaxHookId, baseUrl.replace('**v**', '0'))"/></td>
|
2009-10-25 15:42:08 -05:00
|
|
|
<tal:comment replace="nothing">Go to the previous page</tal:comment>
|
|
|
|
<td><img style="cursor:pointer" tal:condition="python: startNumber != 0"
|
|
|
|
tal:define="sNumber python: startNumber - batchSize"
|
|
|
|
tal:attributes="src string: $portal_url/skyn/arrowLeftSimple.png;
|
|
|
|
title python: tool.translate('goto_previous');
|
2009-11-17 03:05:19 -06:00
|
|
|
onClick python: 'askAjaxChunk(\'%s\', \'%s\')' % (ajaxHookId, baseUrl.replace('**v**', str(sNumber)))"/></td>
|
2009-10-25 15:42:08 -05:00
|
|
|
<tal:comment replace="nothing">Explain which elements are currently shown</tal:comment>
|
2009-11-03 08:02:18 -06:00
|
|
|
<td class="discreet" valign="middle">
|
2009-10-25 15:42:08 -05:00
|
|
|
<span tal:replace="python: startNumber+1"/>
|
|
|
|
<img tal:attributes="src string: $portal_url/skyn/to.png"/>
|
2009-11-03 08:02:18 -06:00
|
|
|
<span tal:replace="python: startNumber+len(objs)"/> <b>//</b>
|
|
|
|
<span tal:replace="python: totalNumber"/>
|
2009-10-25 15:42:08 -05:00
|
|
|
</td>
|
|
|
|
<tal:comment replace="nothing">Go to the next page</tal:comment>
|
|
|
|
<td><img style="cursor:pointer" tal:condition="python: sNumber < totalNumber"
|
|
|
|
tal:define="sNumber python: startNumber + batchSize"
|
|
|
|
tal:attributes="src string: $portal_url/skyn/arrowRightSimple.png;
|
|
|
|
title python: tool.translate('goto_next');
|
2009-11-17 03:05:19 -06:00
|
|
|
onClick python: 'askAjaxChunk(\'%s\', \'%s\')' % (ajaxHookId, baseUrl.replace('**v**', str(sNumber)))"/></td>
|
2009-10-25 15:42:08 -05:00
|
|
|
<tal:comment replace="nothing">Go to the last page</tal:comment>
|
|
|
|
<td><img style="cursor:pointer" tal:condition="python: (startNumber != sNumber) and (startNumber != sNumber-batchSize)"
|
|
|
|
tal:define="lastPageIsIncomplete python: totalNumber % batchSize;
|
|
|
|
nbOfCompletePages python: totalNumber/batchSize;
|
|
|
|
nbOfCountedPages python: test(lastPageIsIncomplete, nbOfCompletePages, nbOfCompletePages-1);
|
|
|
|
sNumber python: (nbOfCountedPages*batchSize)"
|
|
|
|
tal:attributes="src string: $portal_url/skyn/arrowRightDouble.png;
|
|
|
|
title python: tool.translate('goto_last');
|
2009-11-17 03:05:19 -06:00
|
|
|
onClick python: 'askAjaxChunk(\'%s\', \'%s\')' % (ajaxHookId, baseUrl.replace('**v**', str(sNumber)))"/></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div metal:define-macro="objectNavigate" tal:condition="request/nav|nothing" align="right">
|
|
|
|
<tal:comment replace="nothing">
|
|
|
|
Buttons for going to next/previous elements if this one is among bunch of referenced or searched objects.
|
|
|
|
currentNumber starts with 1.
|
|
|
|
</tal:comment>
|
|
|
|
<table cellpadding="0" cellspacing="0"
|
|
|
|
tal:define="navInfo tool/getNavigationInfo;
|
|
|
|
currentNumber navInfo/currentNumber;
|
|
|
|
totalNumber navInfo/totalNumber;
|
|
|
|
firstUrl navInfo/firstUrl;
|
|
|
|
previousUrl navInfo/previousUrl;
|
|
|
|
nextUrl navInfo/nextUrl;
|
|
|
|
lastUrl navInfo/lastUrl;
|
2010-01-15 06:46:54 -06:00
|
|
|
sourceUrl navInfo/sourceUrl;
|
|
|
|
backText navInfo/backText">
|
2009-11-17 03:05:19 -06:00
|
|
|
<tr>
|
|
|
|
<tal:comment replace="nothing">Go to the source URL (search or referred object)</tal:comment>
|
|
|
|
<td><a tal:condition="sourceUrl" tal:attributes="href sourceUrl"><img style="cursor:pointer"
|
|
|
|
tal:attributes="src string: $portal_url/skyn/gotoSource.png;
|
2010-01-15 06:46:54 -06:00
|
|
|
title python: backText + ' : ' + tool.translate('goto_source')"/></a></td>
|
2009-11-17 03:05:19 -06:00
|
|
|
<tal:comment replace="nothing">Go to the first page</tal:comment>
|
|
|
|
<td><a tal:condition="firstUrl" tal:attributes="href firstUrl"><img style="cursor:pointer"
|
|
|
|
tal:attributes="src string: $portal_url/skyn/arrowLeftDouble.png;
|
|
|
|
title python: tool.translate('goto_first')"/></a></td>
|
|
|
|
<tal:comment replace="nothing">Go to the previous page</tal:comment>
|
|
|
|
<td><a tal:condition="previousUrl" tal:attributes="href previousUrl"><img style="cursor:pointer"
|
|
|
|
tal:attributes="src string: $portal_url/skyn/arrowLeftSimple.png;
|
|
|
|
title python: tool.translate('goto_previous')"/></a></td>
|
|
|
|
<tal:comment replace="nothing">Explain which element is currently shown</tal:comment>
|
|
|
|
<td class="discreet" valign="middle">
|
|
|
|
<span tal:replace="python: currentNumber"/> <b>//</b>
|
|
|
|
<span tal:replace="python: totalNumber"/>
|
|
|
|
</td>
|
|
|
|
<tal:comment replace="nothing">Go to the next page</tal:comment>
|
|
|
|
<td><a tal:condition="python: nextUrl" tal:attributes="href nextUrl"><img style="cursor:pointer"
|
|
|
|
tal:attributes="src string: $portal_url/skyn/arrowRightSimple.png;
|
|
|
|
title python: tool.translate('goto_next')"/></a></td>
|
|
|
|
<tal:comment replace="nothing">Go to the last page</tal:comment>
|
|
|
|
<td><a tal:condition="lastUrl" tal:attributes="href lastUrl"><img style="cursor:pointer"
|
|
|
|
tal:attributes="src string: $portal_url/skyn/arrowRightDouble.png;
|
|
|
|
title python: tool.translate('goto_last')"/></a></td>
|
2009-10-25 15:42:08 -05:00
|
|
|
</tr>
|
|
|
|
</table>
|
2009-11-03 08:02:18 -06:00
|
|
|
</div>
|