Improved and generalized intra- and inter-objects navigation.

This commit is contained in:
Gaetan Delannay 2010-09-17 15:32:48 +02:00
parent 88cd4f7c46
commit c2a3551a94
12 changed files with 132 additions and 101 deletions

View file

@ -9,7 +9,7 @@
<input type="hidden" name="fieldName" tal:attributes="value name"/>
<input type="button" tal:condition="widget/confirm"
tal:attributes="value label;
onClick python: 'javascript:askConfirm(\'%s\')' % formId"/>
onClick python: 'askConfirm(\'%s\')' % formId"/>
<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

View file

@ -9,7 +9,7 @@
</tal:askAction>
<img tal:repeat="podFormat python:flavour.getPodInfo(contextObj, name)['formats']"
tal:attributes="src string: $portal_url/skyn/${podFormat}.png;
onClick python: 'javascript: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>

View file

@ -8,10 +8,11 @@
allows to reach the correct page where the forward reference is defined. If we are
on a forward reference, the "nav" parameter is added to the URL for allowing to navigate
from one object to the next/previous on skyn/view.</tal:comment>
<a tal:define="viewUrl obj/getUrl;
includeShownInfo includeShownInfo | python:False;
navInfo python:'nav=ref.%s.%s.%d.%d' % (contextObj.UID(), fieldName, repeat['obj'].number()+startNumber, totalNumber);
fullUrl python: appyType['isBack'] and (viewUrl + '/?page=%s' % appyType['backd']['page']) or (viewUrl + '/?' + navInfo)"
<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;
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>
</metal:objectTitle>
@ -39,7 +40,9 @@
</tal:moveRef>
</td>
<tal:comment replace="nothing">Edit the element</tal:comment>
<td class="noPadding"><a tal:attributes="href python: obj.absolute_url() + '/skyn/edit'"
<td class="noPadding">
<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)">
<img title="label_edit" i18n:domain="plone" i18n:attributes="title"
tal:attributes="src string: $portal_url/skyn/edit.gif"/>
@ -49,7 +52,7 @@
<img tal:condition="python: member.has_permission('Delete objects', obj)"
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()"/>
onClick python:'onDeleteObject(\'%s\')' % obj.UID()"/>
</td>
</tr>
</table>

View file

@ -55,8 +55,8 @@
layout python: widget['layouts'][layoutType];
name widget/name;
sync python: widget['sync'][layoutType];
rawValue python: sync and contextObj.getFieldValue(name) or None;
value python: sync and contextObj.getFormattedFieldValue(name, rawValue) or None;
rawValue python: contextObj.getFieldValue(name, onlyIfSync=True, layoutType=layoutType);
value python: contextObj.getFormattedFieldValue(name, rawValue);
requestValue python: request.get(name, None);
inRequest python: request.has_key(name);
errors errors | python: ();
@ -103,7 +103,7 @@
id tabId">
<a style="cursor:pointer"
tal:content="python: tool.translate('%s_col%d' % (widget['labelId'], repeat['widgetRow'].number()))"
tal:attributes="onClick python: 'javascript:showTab(\'%s_%d_%d\')' % (widget['name'], repeat['widgetRow'].number(), len(widget['widgets']))"></a>
tal:attributes="onClick python: 'showTab(\'%s_%d_%d\')' % (widget['name'], repeat['widgetRow'].number(), len(widget['widgets']))"></a>
</td>
<td><img tal:attributes="src string: $portal_url/skyn/tabRight.png;
id python: '%s_right' % tabId"/><td>

View file

@ -30,7 +30,7 @@
tal:attributes="name name;
id name;
multiple python: isMultiple and 'multiple' or '';
onchange python: isMaster and ('javascript:updateSlaves(getMasterValue(this), \'%s\')' % widget['id']) or '';
onchange python: isMaster and ('updateSlaves(getMasterValue(this), \'%s\')' % widget['id']) or '';
class widget/master_css;
size python: isMultiple and widget['height'] or 1">
<option tal:repeat="possibleValue possibleValues"