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

@ -64,7 +64,7 @@ img {border: 0}
.portletSearch { font-size: 90%; font-style: italic; padding-left: 1em}
.phase { border-style: dashed; border-width: thin; padding: 4px 0.6em 5px 1em;}
.phaseSelected { background-color: #F4F5F6; }
.content { padding: 14px 14px 9px 15px;}
.content { padding: 14px 14px 9px 15px; }
.grey { display: none; position: absolute; left: 0px; top: 0px;
background:grey; opacity:0.5; -moz-opacity:0.5; -khtml-opacity:0.5;
filter:alpha(Opacity=50);}

View file

@ -9,20 +9,22 @@ CKEDITOR.editorConfig = function( config )
config.toolbar_Appy =
[
{ name: 'basicstyles', items : [ 'Format', 'Bold', 'Italic', 'Underline',
'Strike', 'Subscript', 'Superscript', '-',
'RemoveFormat' ] },
'Strike', 'Subscript', 'Superscript'] },
{ name: 'paragraph', items : [ 'NumberedList', 'BulletedList', '-',
'Outdent', 'Indent', '-', 'JustifyLeft',
'JustifyCenter', 'JustifyRight',
'JustifyBlock'] },
{ name: 'clipboard', items : [ 'Cut', 'Copy', 'Paste', 'PasteText',
'PasteFromWord', '-', 'Undo', 'Redo' ] },
'PasteFromWord', 'Undo', 'Redo']},
{ name: 'editing', items : [ 'Find', 'Replace', '-', 'SelectAll', '-',
'SpellChecker', 'Scayt']},
{ name: 'insert', items : [ 'Image', 'Table', 'HorizontalRule',
'SpecialChar', 'PageBreak', 'Link', 'Unlink',
'-', 'Maximize']},
{ name: 'insert', items : [ 'Image', 'Table', 'SpecialChar', 'Link',
'Unlink', 'Source', 'Maximize']},
];
config.toolbar_AppyRich = config.toolbar_Appy.concat(
[{name: 'styles', items: [ 'Font', 'FontSize', 'TextColor', 'BGColor',
'RemoveFormat' ]},]
)
config.format_p = { element:'p', attributes:{'style':'margin:0;padding:0'}};
config.format_h1 = { element:'h1', attributes:{'style':'margin:0;padding:0'}};
config.format_h2 = { element:'h2', attributes:{'style':'margin:0;padding:0'}};

View file

@ -1,16 +1,17 @@
<tal:main define="tool context/getTool">
<html metal:use-macro="context/ui/template/macros/main">
<metal:fill fill-slot="content"
tal:define="contextObj context/getParentNode;
dummy python: contextObj.allows('Modify portal content', raiseError=True);
errors request/errors | python:{};
layoutType python:'edit';
layout python: contextObj.getPageLayout(layoutType);
phaseInfo python: contextObj.getAppyPhases(currentOnly=True, layoutType=layoutType);
phase phaseInfo/name;
page request/page|python:'main';
cssJs python: contextObj.getCssJs(contextObj.getAppyTypes(layoutType, page), layoutType);
confirmMsg request/confirmMsg | nothing;"
tal:define="contextObj context/getParentNode;
dummy python: contextObj.allows('Modify portal content', raiseError=True);
errors request/errors | python:{};
layoutType python:'edit';
layout python: contextObj.getPageLayout(layoutType);
page request/page|python:'main';
cssJs python: {};
groupedWidgets python: contextObj.getGroupedAppyTypes(layoutType, page, cssJs=cssJs);
phaseInfo python: contextObj.getAppyPhases(currentOnly=True, layoutType=layoutType);
phase phaseInfo/name;
confirmMsg request/confirmMsg | nothing;"
tal:on-error="structure python: tool.manageError(error)">
<tal:comment replace="nothing">Include type-specific CSS and JS.</tal:comment>

View file

@ -42,7 +42,7 @@
</tal:comment>
<table metal:define-macro="widgets"
tal:attributes="width layout/width">
<tr tal:repeat="widget python: contextObj.getGroupedAppyTypes(layoutType, page)">
<tr tal:repeat="widget groupedWidgets">
<td tal:condition="python: widget['type'] == 'group'">
<metal:call use-macro="app/ui/widgets/show/macros/group"/>
</td>

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>

View file

@ -4,7 +4,8 @@
tal:define="className request/className;
refInfo request/ref|nothing;
searchInfo python: tool.getSearchInfo(className, refInfo);
cssJs python: tool.getCssJs(searchInfo['fields'], 'edit')">
cssJs python: {};
dummy python: tool.getCssJs(searchInfo['fields'], 'edit', cssJs)">
<tal:comment replace="nothing">Include type-specific CSS and JS.</tal:comment>
<link tal:repeat="cssFile cssJs/css" rel="stylesheet" type="text/css"

View file

@ -1,15 +1,16 @@
<tal:main define="tool context/config">
<html metal:use-macro="context/ui/template/macros/main">
<metal:fill fill-slot="content"
tal:define="contextObj python: context.getParentNode();
dummy python: contextObj.allows('View', raiseError=True);
portal_type python: context.portal_type.lower().replace(' ', '_');
errors python: req.get('errors', {});
layoutType python:'view';
layout python: contextObj.getPageLayout(layoutType);
phaseInfo python: contextObj.getAppyPhases(currentOnly=True, layoutType='view');
page req/page|python:'main';
phase phaseInfo/name;"
tal:define="contextObj python: context.getParentNode();
dummy python: contextObj.allows('View', raiseError=True);
portal_type python: context.portal_type.lower().replace(' ', '_');
errors python: req.get('errors', {});
layoutType python:'view';
layout python: contextObj.getPageLayout(layoutType);
phaseInfo python: contextObj.getAppyPhases(currentOnly=True, layoutType='view');
page req/page|python:'main';
phase phaseInfo/name;
groupedWidgets python: contextObj.getGroupedAppyTypes(layoutType, page);"
tal:on-error="structure python: tool.manageError(error)">
<metal:prologue use-macro="context/ui/page/macros/prologue"/>
<metal:show use-macro="context/ui/page/macros/show"/>