appy.bin: backup.py: added field 'To' to mails sent by the backup procedure (so it not less directly considered as junk mail); bugfix in job.py used with Appy > 0.8; appy.gen: optimized performance (methods defined in 'show' attrs were called twice on edit.pt and view.pt); appy.gen: added String.richText allowing to have ckeditor with more text-formatting icons; added ckeditor 'show source' button by default (impossible to live without that); appy.gen: solved security-related problems; appy.gen.mail: allowto send mail as authenticated user; appy.gen: bugfixes in pages when rendered by IE.

This commit is contained in:
Gaetan Delannay 2012-05-05 17:04:19 +02:00
parent 459a714b76
commit 6245023365
21 changed files with 233 additions and 148 deletions

View file

@ -12,11 +12,9 @@
<div class="portletContent" tal:condition="python: contextObj and contextObj.mayNavigate()">
<div class="portletTitle" tal:define="parent contextObj/getParent">
<span tal:replace="contextObj/Title"></span>
<div style="float:right" tal:condition="python: parent">
<a tal:attributes="href parent/absolute_url">
<a tal:condition="python: parent" tal:attributes="href parent/absolute_url">
<img tal:attributes="src string: $appUrl/ui/gotoSource.png"/>
</a>
</div>
</div>
<metal:phases use-macro="here/ui/portlet/macros/phases"/>
</div>
@ -34,10 +32,9 @@
class python:test(not currentSearch and (currentClass==rootClass), 'portletCurrent', '')"
tal:content="structure python: _(rootClass + '_plural')">
</a>
<div style="float: right"
tal:define="addPermission python: '%s: Add %s' % (appName, rootClass);
userMayAdd python: user.has_permission(addPermission, appFolder);
createMeans python: tool.getCreateMeans(rootClass)">
<span tal:define="addPermission python: '%s: Add %s' % (appName, rootClass);
userMayAdd python: user.has_permission(addPermission, appFolder);
createMeans python: tool.getCreateMeans(rootClass)">
<tal:comment replace="nothing">Create a new object from a web form</tal:comment>
<a tal:condition="python: ('form' in createMeans) and userMayAdd"
tal:attributes="href python: '%s/do?action=Create&className=%s' % (toolUrl, rootClass);
@ -57,30 +54,30 @@
title python: _('search_objects')">
<img tal:attributes="src string: $appUrl/ui/search.gif"/>
</a>
</div>
</span>
<tal:comment replace="nothing">Searches for this content type.</tal:comment>
<tal:searchOrGroup repeat="searchOrGroup python: tool.getSearches(rootClass)">
<tal:group condition="searchOrGroup/isGroup">
<tal:expanded define="group searchOrGroup;
expanded python: request.get(group['labelId'], 'collapsed') == 'expanded'">
<tal:comment replace="nothing">Group name</tal:comment>
<dt class="portletGroup">
<div class="portletGroup">
<img align="left" style="cursor:pointer; margin-right: 3px"
tal:attributes="id python: '%s_img' % group['labelId'];
src python:test(expanded, 'ui/collapse.gif', 'ui/expand.gif');
onClick python:'toggleCookie(\'%s\')' % group['labelId']"/>
<span tal:replace="group/label"/>
</dt>
</div>
<tal:comment replace="nothing">Group searches</tal:comment>
<span tal:attributes="id group/labelId;
<div tal:attributes="id group/labelId;
style python:test(expanded, 'display:block', 'display:none')">
<dt class="portletSearch" tal:repeat="search group/searches">
<div class="portletSearch" tal:repeat="search group/searches">
<a tal:attributes="href python: '%s?className=%s&search=%s' % (queryUrl, rootClass, search['name']);
title search/descr;
class python: test(search['name'] == currentSearch, 'portletCurrent', '');"
tal:content="structure search/label"></a>
</dt>
</span>
</div>
</div>
</tal:expanded>
</tal:group>
<dt tal:define="search searchOrGroup" tal:condition="not: searchOrGroup/isGroup"
@ -100,10 +97,9 @@
currently shown object, made of phases and contained pages.
</tal:comment>
<table metal:define-macro="phases"
tal:define="phases contextObj/getAppyPhases|nothing;
tal:define="phases contextObj/getAppyPhases;
singlePhase python: len(phases) == 1;
page python: req.get('page', 'main')"
tal:condition="python: phases" width="100%">
page python: req.get('page', 'main')">
<tal:phase repeat="phase phases">
<tal:comment replace="nothing">The box containing phase-related information</tal:comment>
<tr tal:define="singlePage python: len(phase['pages']) == 1">
@ -116,30 +112,25 @@
tal:content="structure python: _(label)">
</div>
<tal:comment replace="nothing">The page(s) within the phase</tal:comment>
<table width="100%" cellpadding="0">
<tal:page repeat="aPage phase/pages">
<tal:comment replace="nothing">1st line: page name and icons</tal:comment>
<tr valign="top" tal:condition="python: not (singlePhase and singlePage)">
<td tal:attributes="class python: test(aPage == page, 'portletCurrent portletPage', 'portletPage')">
<a tal:attributes="href python: contextObj.getUrl(page=aPage)"
<tal:page repeat="aPage phase/pages">
<tal:comment replace="nothing">First line: page name and icons</tal:comment>
<div tal:condition="python: not (singlePhase and singlePage)"
tal:attributes="class python: test(aPage == page, 'portletCurrent portletPage', 'portletPage')">
<a tal:attributes="href python: contextObj.getUrl(page=aPage)"
tal:content="structure python: _('%s_page_%s' % (contextObj.meta_type, aPage))">
</a>
</td>
<td align="right">
<img title="Edit" style="cursor:pointer"
tal:attributes="onClick python: 'href: window.location=\'%s\'' % contextObj.getUrl(mode='edit', page=aPage);
src string: $appUrl/ui/edit.gif"
tal:condition="python: contextObj.allows('Modify portal content') and phase['pagesInfo'][aPage]['showOnEdit']"/>
</td>
</tr>
<tal:comment replace="nothing">2nd line: links</tal:comment>
<tal:links define="links python: phase['pagesInfo'][aPage].get('links')" tal:condition="links">
<tr tal:repeat="link links">
<td><a tal:content="link/title" tal:attributes="href link/url"></a></td>
</tr>
</tal:links>
</tal:page>
</table>
</a>
<a tal:condition="python: contextObj.allows('Modify portal content') and phase['pagesInfo'][aPage]['showOnEdit']"
tal:attributes="href python: contextObj.getUrl(mode='edit', page=aPage)">
<img title="Edit" tal:attributes="src string: $appUrl/ui/edit.gif"/>
</a>
</div>
<tal:comment replace="nothing">Next lines: links</tal:comment>
<tal:links define="links python: phase['pagesInfo'][aPage].get('links')" tal:condition="links">
<div tal:repeat="link links">
<a tal:content="link/title" tal:attributes="href link/url"></a>
</div>
</tal:links>
</tal:page>
</td>
</tr>
<tal:comment replace="nothing">The down arrow pointing to the next phase (if any)</tal:comment>