[gen] Finalized pending i18n.
This commit is contained in:
parent
2710fb6c39
commit
8f57163c2a
|
@ -191,7 +191,7 @@ class NewScript:
|
||||||
def patchPlone3x(self):
|
def patchPlone3x(self):
|
||||||
'''Auto-proclaimed ugly code in z3c forces us to patch some files
|
'''Auto-proclaimed ugly code in z3c forces us to patch some files
|
||||||
in Products.CMFPlone because these guys make the assumption that
|
in Products.CMFPlone because these guys make the assumption that
|
||||||
"plone.xxx" packages are within eggs when they've implemented their
|
"plone.*" packages are within eggs when they've implemented their
|
||||||
ZCML directives "includePlugins" and "includePluginsOverrides".
|
ZCML directives "includePlugins" and "includePluginsOverrides".
|
||||||
So in this method, I remove every call to those directives in
|
So in this method, I remove every call to those directives in
|
||||||
CMFPlone files. It does not seem to affect Plone behaviour. Indeed,
|
CMFPlone files. It does not seem to affect Plone behaviour. Indeed,
|
||||||
|
|
|
@ -2728,7 +2728,7 @@ class Transition:
|
||||||
sendNotification(obj.appy(), self, transitionName, wf)
|
sendNotification(obj.appy(), self, transitionName, wf)
|
||||||
# Return a message to the user if needed
|
# Return a message to the user if needed
|
||||||
if not doSay or (transitionName == '_init_'): return
|
if not doSay or (transitionName == '_init_'): return
|
||||||
if not msg: msg = 'Changes saved.' # XXX Translate
|
if not msg: msg = obj.translate('object_saved')
|
||||||
obj.say(msg)
|
obj.say(msg)
|
||||||
|
|
||||||
class Permission:
|
class Permission:
|
||||||
|
|
|
@ -445,6 +445,8 @@ class ZopeGenerator(Generator):
|
||||||
msg('bad_select_value', '', msg.BAD_SELECT_VALUE),
|
msg('bad_select_value', '', msg.BAD_SELECT_VALUE),
|
||||||
msg('select_delesect', '', msg.SELECT_DESELECT),
|
msg('select_delesect', '', msg.SELECT_DESELECT),
|
||||||
msg('no_elem_selected', '', msg.NO_SELECTION),
|
msg('no_elem_selected', '', msg.NO_SELECTION),
|
||||||
|
msg('object_edit', '', msg.EDIT),
|
||||||
|
msg('object_delete', '', msg.DELETE),
|
||||||
msg('delete_confirm', '', msg.DELETE_CONFIRM),
|
msg('delete_confirm', '', msg.DELETE_CONFIRM),
|
||||||
msg('delete_done', '', msg.DELETE_DONE),
|
msg('delete_done', '', msg.DELETE_DONE),
|
||||||
msg('goto_first', '', msg.GOTO_FIRST),
|
msg('goto_first', '', msg.GOTO_FIRST),
|
||||||
|
@ -466,6 +468,25 @@ class ZopeGenerator(Generator):
|
||||||
msg('front_page_text', '', msg.FRONT_PAGE_TEXT),
|
msg('front_page_text', '', msg.FRONT_PAGE_TEXT),
|
||||||
msg('captcha_text', '', msg.CAPTCHA_TEXT),
|
msg('captcha_text', '', msg.CAPTCHA_TEXT),
|
||||||
msg('bad_captcha', '', msg.BAD_CAPTCHA),
|
msg('bad_captcha', '', msg.BAD_CAPTCHA),
|
||||||
|
msg('app_login', '', msg.LOGIN),
|
||||||
|
msg('app_connect', '', msg.CONNECT),
|
||||||
|
msg('app_logout', '', msg.LOGOUT),
|
||||||
|
msg('app_password', '', msg.PASSWORD),
|
||||||
|
msg('app_home', '', msg.HOME),
|
||||||
|
msg('login_reserved', '', msg.LOGIN_RESERVED),
|
||||||
|
msg('login_in_use', '', msg.LOGIN_IN_USE),
|
||||||
|
msg('login_ko', '', msg.LOGIN_KO),
|
||||||
|
msg('login_ok', '', msg.LOGIN_OK),
|
||||||
|
msg('password_too_short', '', msg.PASSWORD_TOO_SHORT),
|
||||||
|
msg('passwords_mismatch', '', msg.PASSWORDS_MISMATCH),
|
||||||
|
msg('object_save', '', msg.SAVE),
|
||||||
|
msg('object_saved', '', msg.SAVED),
|
||||||
|
msg('validation_error', '', msg.ERROR),
|
||||||
|
msg('object_cancel', '', msg.CANCEL),
|
||||||
|
msg('object_canceled', '', msg.CANCELED),
|
||||||
|
msg('enable_cookies', '', msg.ENABLE_COOKIES),
|
||||||
|
msg('page_previous', '', msg.PAGE_PREVIOUS),
|
||||||
|
msg('page_next', '', msg.PAGE_NEXT),
|
||||||
]
|
]
|
||||||
# Create a label for every role added by this application
|
# Create a label for every role added by this application
|
||||||
for role in self.getAllUsedRoles():
|
for role in self.getAllUsedRoles():
|
||||||
|
|
|
@ -876,7 +876,7 @@ class ToolMixin(BaseMixin):
|
||||||
urlBack = rq['HTTP_REFERER']
|
urlBack = rq['HTTP_REFERER']
|
||||||
|
|
||||||
if jsEnabled and not cookiesEnabled:
|
if jsEnabled and not cookiesEnabled:
|
||||||
msg = 'You must enable cookies before you can log in.' # XXX transl.
|
msg = self.translate('enable_cookies')
|
||||||
return self.goto(urlBack, msg)
|
return self.goto(urlBack, msg)
|
||||||
# Perform the Zope-level authentication
|
# Perform the Zope-level authentication
|
||||||
login = rq.get('__ac_name', '')
|
login = rq.get('__ac_name', '')
|
||||||
|
@ -884,11 +884,11 @@ class ToolMixin(BaseMixin):
|
||||||
user = self.acl_users.validate(rq)
|
user = self.acl_users.validate(rq)
|
||||||
if self.userIsAnon():
|
if self.userIsAnon():
|
||||||
rq.RESPONSE.expireCookie('__ac', path='/')
|
rq.RESPONSE.expireCookie('__ac', path='/')
|
||||||
msg = 'Login failed.' # XXX to translate
|
msg = self.translate('login_ko')
|
||||||
logMsg = 'Authentication failed (tried with login "%s").' % login
|
logMsg = 'Authentication failed (tried with login "%s").' % login
|
||||||
else:
|
else:
|
||||||
msg = 'Welcome! You are now logged in.' # XXX to translate
|
msg = self.translate('login_ok')
|
||||||
logMsg = 'User "%s" has been logged in.' % login
|
logMsg = 'User "%s" logged in.' % login
|
||||||
self.log(logMsg)
|
self.log(logMsg)
|
||||||
return self.goto(self.getApp().absolute_url(), msg)
|
return self.goto(self.getApp().absolute_url(), msg)
|
||||||
|
|
||||||
|
|
|
@ -202,7 +202,7 @@ class BaseMixin:
|
||||||
fields in the database.'''
|
fields in the database.'''
|
||||||
rq = self.REQUEST
|
rq = self.REQUEST
|
||||||
tool = self.getTool()
|
tool = self.getTool()
|
||||||
errorMessage = 'Please correct the indicated errors.' # XXX Translate
|
errorMessage = self.translate('validation_error')
|
||||||
isNew = rq.get('is_new') == 'True'
|
isNew = rq.get('is_new') == 'True'
|
||||||
# If this object is created from an initiator, get info about him.
|
# If this object is created from an initiator, get info about him.
|
||||||
initiator, initiatorPage, initiatorField = self.getInitiatorInfo()
|
initiator, initiatorPage, initiatorField = self.getInitiatorInfo()
|
||||||
|
@ -217,7 +217,7 @@ class BaseMixin:
|
||||||
urlBack = tool.getSiteUrl()
|
urlBack = tool.getSiteUrl()
|
||||||
else:
|
else:
|
||||||
urlBack = self.getUrl()
|
urlBack = self.getUrl()
|
||||||
self.say('Changes canceled.') # XXX Translate
|
self.say(self.translate('object_canceled'))
|
||||||
return self.goto(urlBack)
|
return self.goto(urlBack)
|
||||||
|
|
||||||
# Object for storing validation errors
|
# Object for storing validation errors
|
||||||
|
@ -253,12 +253,11 @@ class BaseMixin:
|
||||||
obj, msg = self.createOrUpdate(isNew, values, initiator, initiatorField)
|
obj, msg = self.createOrUpdate(isNew, values, initiator, initiatorField)
|
||||||
|
|
||||||
# Redirect the user to the appropriate page
|
# Redirect the user to the appropriate page
|
||||||
if not msg: msg = 'Changes saved.' # XXX Translate
|
if not msg: msg = self.translate('object_saved')
|
||||||
# If the object has already been deleted (ie, it is a kind of transient
|
# If the object has already been deleted (ie, it is a kind of transient
|
||||||
# object like a one-shot form and has already been deleted in method
|
# object like a one-shot form and has already been deleted in method
|
||||||
# onEdit), redirect to the main site page.
|
# onEdit), redirect to the main site page.
|
||||||
if not getattr(obj.getParentNode().aq_base, obj.id, None):
|
if not getattr(obj.getParentNode().aq_base, obj.id, None):
|
||||||
obj.unindex()
|
|
||||||
return self.goto(tool.getSiteUrl(), msg)
|
return self.goto(tool.getSiteUrl(), msg)
|
||||||
# If the user can't access the object anymore, redirect him to the
|
# If the user can't access the object anymore, redirect him to the
|
||||||
# main site page.
|
# main site page.
|
||||||
|
|
21
gen/po.py
21
gen/po.py
|
@ -92,6 +92,8 @@ class PoMessage:
|
||||||
EMAIL_BODY = 'You can consult this element at ${objectUrl}.'
|
EMAIL_BODY = 'You can consult this element at ${objectUrl}.'
|
||||||
SELECT_DESELECT = '(Un)select all'
|
SELECT_DESELECT = '(Un)select all'
|
||||||
NO_SELECTION = 'You must select at least one element.'
|
NO_SELECTION = 'You must select at least one element.'
|
||||||
|
EDIT = 'Edit'
|
||||||
|
DELETE = 'Delete'
|
||||||
DELETE_CONFIRM = 'Are you sure you want to delete this element?'
|
DELETE_CONFIRM = 'Are you sure you want to delete this element?'
|
||||||
DELETE_DONE = 'The element has been deleted.'
|
DELETE_DONE = 'The element has been deleted.'
|
||||||
GOTO_FIRST = 'Go to top'
|
GOTO_FIRST = 'Go to top'
|
||||||
|
@ -115,6 +117,25 @@ class PoMessage:
|
||||||
'field besides, but without the character at position ' \
|
'field besides, but without the character at position ' \
|
||||||
'${number}.'
|
'${number}.'
|
||||||
BAD_CAPTCHA = 'The code was not correct. Please try again.'
|
BAD_CAPTCHA = 'The code was not correct. Please try again.'
|
||||||
|
LOGIN = 'Login'
|
||||||
|
CONNECT = 'Log in'
|
||||||
|
PASSWORD = 'Password'
|
||||||
|
LOGOUT = 'Logout'
|
||||||
|
HOME = 'Home'
|
||||||
|
LOGIN_RESERVED = 'This login is reserved.'
|
||||||
|
LOGIN_IN_USE = 'This login is already in use.'
|
||||||
|
LOGIN_OK = 'Welcome! You are now logged in.'
|
||||||
|
LOGIN_KO = 'Login failed.'
|
||||||
|
PASSWORD_TOO_SHORT = 'Passwords must contain at least ${nb} characters.'
|
||||||
|
PASSWORDS_MISMATCH = 'Passwords do not match.'
|
||||||
|
SAVE = 'Save'
|
||||||
|
SAVED = 'Changes saved.'
|
||||||
|
ERROR = 'Please correct the indicated errors.'
|
||||||
|
CANCEL = 'Cancel'
|
||||||
|
CANCELED = 'Changes canceled.'
|
||||||
|
ENABLE_COOKIES = 'You must enable cookies before you can log in.'
|
||||||
|
PAGE_PREVIOUS = 'Previous page'
|
||||||
|
PAGE_NEXT = 'Next page'
|
||||||
|
|
||||||
def __init__(self, id, msg, default, fuzzy=False, comments=[],
|
def __init__(self, id, msg, default, fuzzy=False, comments=[],
|
||||||
niceDefault=False):
|
niceDefault=False):
|
||||||
|
|
|
@ -60,20 +60,20 @@
|
||||||
<input type="hidden" name="importPath" value=""/>
|
<input type="hidden" name="importPath" value=""/>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<h1 tal:content="python: tool.translate('import_title')"></h1><br/>
|
<h1 tal:content="python: _('import_title')"></h1><br/>
|
||||||
<table class="list" width="100%">
|
<table class="list" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<th tal:repeat="columnHeader python: importElems[0]">
|
<th tal:repeat="columnHeader python: importElems[0]">
|
||||||
<img tal:condition="python: repeat['columnHeader'].number() == 1"
|
<img tal:condition="python: repeat['columnHeader'].number() == 1"
|
||||||
tal:attributes="src string:$appUrl/ui/eye.png;
|
tal:attributes="src string:$appUrl/ui/eye.png;
|
||||||
title python: tool.translate('import_show_hide')"
|
title python: _('import_show_hide')"
|
||||||
style="cursor:pointer" onClick="toggleViewableElements()" align="left" />
|
style="cursor:pointer" onClick="toggleViewableElements()" align="left" />
|
||||||
<span tal:replace="columnHeader"/>
|
<span tal:replace="columnHeader"/>
|
||||||
</th>
|
</th>
|
||||||
<th tal:content="python: tool.translate('ref_actions')"></th>
|
<th tal:content="python: _('ref_actions')"></th>
|
||||||
<th width="20px"><img
|
<th width="20px"><img
|
||||||
tal:attributes="src string: $appUrl/ui/select_elems.png;
|
tal:attributes="src string: $appUrl/ui/select_elems.png;
|
||||||
title python: tool.translate('select_delesect')"
|
title python: _('select_delesect')"
|
||||||
onClick="toggleCheckboxes()" style="cursor:pointer"/>
|
onClick="toggleCheckboxes()" style="cursor:pointer"/>
|
||||||
</tr>
|
</tr>
|
||||||
<tal:row repeat="row python: importElems[1]">
|
<tal:row repeat="row python: importElems[1]">
|
||||||
|
@ -89,8 +89,8 @@
|
||||||
<td>
|
<td>
|
||||||
<input type="button" tal:condition="not: alreadyImported"
|
<input type="button" tal:condition="not: alreadyImported"
|
||||||
tal:attributes="onClick python: 'importSingleElement(\'%s\')' % row[0];
|
tal:attributes="onClick python: 'importSingleElement(\'%s\')' % row[0];
|
||||||
value python: tool.translate('query_import')"/>
|
value python: _('query_import')"/>
|
||||||
<span tal:condition="alreadyImported" tal:replace="python: tool.translate('import_already')"/>
|
<span tal:condition="alreadyImported" tal:replace="python: _('import_already')"/>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<input type="checkbox" checked="checked" id="cbElem" name="cbElem"
|
<input type="checkbox" checked="checked" id="cbElem" name="cbElem"
|
||||||
|
@ -98,13 +98,13 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tal:row>
|
</tal:row>
|
||||||
<tr tal:condition="python: not importElems[1] or allAreImported"><td colspan="15" tal:content="python: tool.translate('query_no_result')"></td></tr>
|
<tr tal:condition="python: not importElems[1] or allAreImported"><td colspan="15" tal:content="python: _('query_no_result')"></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<tal:comment replace="nothing">Button for importing several elements at once.</tal:comment>
|
<tal:comment replace="nothing">Button for importing several elements at once.</tal:comment>
|
||||||
<p align="right"><br/>
|
<p align="right"><br/>
|
||||||
<input type="button" onClick="importManyElements()"
|
<input type="button" onClick="importManyElements()"
|
||||||
tal:condition="python: importElems[1] and not allAreImported"
|
tal:condition="python: importElems[1] and not allAreImported"
|
||||||
tal:attributes="value python:tool.translate('import_many')"/>
|
tal:attributes="value python: _('import_many')"/>
|
||||||
</p>
|
</p>
|
||||||
</metal:fill>
|
</metal:fill>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -12,13 +12,13 @@
|
||||||
<tal:comment replace="nothing">Go to the first page</tal:comment>
|
<tal:comment replace="nothing">Go to the first page</tal:comment>
|
||||||
<td tal:condition="python: (startNumber != 0) and (startNumber != batchSize)"><img style="cursor:pointer"
|
<td tal:condition="python: (startNumber != 0) and (startNumber != batchSize)"><img style="cursor:pointer"
|
||||||
tal:attributes="src string: $appUrl/ui/arrowLeftDouble.png;
|
tal:attributes="src string: $appUrl/ui/arrowLeftDouble.png;
|
||||||
title python: tool.translate('goto_first');
|
title python: _('goto_first');
|
||||||
onClick python: navBaseCall.replace('**v**', '0'+sortAndFilter)"/></td>
|
onClick python: navBaseCall.replace('**v**', '0'+sortAndFilter)"/></td>
|
||||||
<tal:comment replace="nothing">Go to the previous page</tal:comment>
|
<tal:comment replace="nothing">Go to the previous page</tal:comment>
|
||||||
<td tal:define="sNumber python: startNumber - batchSize"
|
<td tal:define="sNumber python: startNumber - batchSize"
|
||||||
tal:condition="python: startNumber != 0"><img style="cursor:pointer"
|
tal:condition="python: startNumber != 0"><img style="cursor:pointer"
|
||||||
tal:attributes="src string: $appUrl/ui/arrowLeftSimple.png;
|
tal:attributes="src string: $appUrl/ui/arrowLeftSimple.png;
|
||||||
title python: tool.translate('goto_previous');
|
title python: _('goto_previous');
|
||||||
onClick python: navBaseCall.replace('**v**', str(sNumber)+sortAndFilter)"/></td>
|
onClick python: navBaseCall.replace('**v**', str(sNumber)+sortAndFilter)"/></td>
|
||||||
<tal:comment replace="nothing">Explain which elements are currently shown</tal:comment>
|
<tal:comment replace="nothing">Explain which elements are currently shown</tal:comment>
|
||||||
<td class="discreet">
|
<td class="discreet">
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
<td tal:define="sNumber python: startNumber + batchSize"
|
<td tal:define="sNumber python: startNumber + batchSize"
|
||||||
tal:condition="python: sNumber < totalNumber"><img style="cursor:pointer"
|
tal:condition="python: sNumber < totalNumber"><img style="cursor:pointer"
|
||||||
tal:attributes="src string: $appUrl/ui/arrowRightSimple.png;
|
tal:attributes="src string: $appUrl/ui/arrowRightSimple.png;
|
||||||
title python: tool.translate('goto_next');
|
title python: _('goto_next');
|
||||||
onClick python: navBaseCall.replace('**v**', str(sNumber)+sortAndFilter)"/></td>
|
onClick python: navBaseCall.replace('**v**', str(sNumber)+sortAndFilter)"/></td>
|
||||||
<tal:comment replace="nothing">Go to the last page</tal:comment>
|
<tal:comment replace="nothing">Go to the last page</tal:comment>
|
||||||
<td tal:define="lastPageIsIncomplete python: totalNumber % batchSize;
|
<td tal:define="lastPageIsIncomplete python: totalNumber % batchSize;
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
sNumber python: (nbOfCountedPages*batchSize)"
|
sNumber python: (nbOfCountedPages*batchSize)"
|
||||||
tal:condition="python: (startNumber != sNumber) and (startNumber != sNumber-batchSize)"><img style="cursor:pointer"
|
tal:condition="python: (startNumber != sNumber) and (startNumber != sNumber-batchSize)"><img style="cursor:pointer"
|
||||||
tal:attributes="src string: $appUrl/ui/arrowRightDouble.png;
|
tal:attributes="src string: $appUrl/ui/arrowRightDouble.png;
|
||||||
title python: tool.translate('goto_last');
|
title python: _('goto_last');
|
||||||
onClick python: navBaseCall.replace('**v**', str(sNumber)+sortAndFilter)"/></td>
|
onClick python: navBaseCall.replace('**v**', str(sNumber)+sortAndFilter)"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -65,15 +65,15 @@
|
||||||
<tal:comment replace="nothing">Go to the source URL (search or referred object)</tal:comment>
|
<tal:comment replace="nothing">Go to the source URL (search or referred object)</tal:comment>
|
||||||
<td tal:condition="sourceUrl"><a tal:attributes="href sourceUrl"><img
|
<td tal:condition="sourceUrl"><a tal:attributes="href sourceUrl"><img
|
||||||
tal:attributes="src string: $appUrl/ui/gotoSource.png;
|
tal:attributes="src string: $appUrl/ui/gotoSource.png;
|
||||||
title python: backText + ' : ' + tool.translate('goto_source')"/></a></td>
|
title python: backText + ' : ' + _('goto_source')"/></a></td>
|
||||||
<tal:comment replace="nothing">Go to the first page</tal:comment>
|
<tal:comment replace="nothing">Go to the first page</tal:comment>
|
||||||
<td tal:condition="firstUrl"><a tal:attributes="href firstUrl"><img
|
<td tal:condition="firstUrl"><a tal:attributes="href firstUrl"><img
|
||||||
tal:attributes="src string: $appUrl/ui/arrowLeftDouble.png;
|
tal:attributes="src string: $appUrl/ui/arrowLeftDouble.png;
|
||||||
title python: tool.translate('goto_first')"/></a></td>
|
title python: _('goto_first')"/></a></td>
|
||||||
<tal:comment replace="nothing">Go to the previous page</tal:comment>
|
<tal:comment replace="nothing">Go to the previous page</tal:comment>
|
||||||
<td tal:condition="previousUrl"><a tal:attributes="href previousUrl"><img
|
<td tal:condition="previousUrl"><a tal:attributes="href previousUrl"><img
|
||||||
tal:attributes="src string: $appUrl/ui/arrowLeftSimple.png;
|
tal:attributes="src string: $appUrl/ui/arrowLeftSimple.png;
|
||||||
title python: tool.translate('goto_previous')"/></a></td>
|
title python: _('goto_previous')"/></a></td>
|
||||||
<tal:comment replace="nothing">Explain which element is currently shown</tal:comment>
|
<tal:comment replace="nothing">Explain which element is currently shown</tal:comment>
|
||||||
<td class="discreet">
|
<td class="discreet">
|
||||||
<span tal:replace="python: currentNumber"/> <b>//</b>
|
<span tal:replace="python: currentNumber"/> <b>//</b>
|
||||||
|
@ -82,11 +82,11 @@
|
||||||
<tal:comment replace="nothing">Go to the next page</tal:comment>
|
<tal:comment replace="nothing">Go to the next page</tal:comment>
|
||||||
<td tal:condition="python: nextUrl"><a tal:attributes="href nextUrl"><img
|
<td tal:condition="python: nextUrl"><a tal:attributes="href nextUrl"><img
|
||||||
tal:attributes="src string: $appUrl/ui/arrowRightSimple.png;
|
tal:attributes="src string: $appUrl/ui/arrowRightSimple.png;
|
||||||
title python: tool.translate('goto_next')"/></a></td>
|
title python: _('goto_next')"/></a></td>
|
||||||
<tal:comment replace="nothing">Go to the last page</tal:comment>
|
<tal:comment replace="nothing">Go to the last page</tal:comment>
|
||||||
<td tal:condition="lastUrl"><a tal:attributes="href lastUrl"><img
|
<td tal:condition="lastUrl"><a tal:attributes="href lastUrl"><img
|
||||||
tal:attributes="src string: $appUrl/ui/arrowRightDouble.png;
|
tal:attributes="src string: $appUrl/ui/arrowRightDouble.png;
|
||||||
title python: tool.translate('goto_last')"/></a></td>
|
title python: _('goto_last')"/></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -64,7 +64,8 @@
|
||||||
totalNumber historyInfo/totalNumber;
|
totalNumber historyInfo/totalNumber;
|
||||||
ajaxHookId python:'appyHistory';
|
ajaxHookId python:'appyHistory';
|
||||||
navBaseCall python: 'askObjectHistory(\'%s\',\'%s\',%d,**v**)' % (ajaxHookId, contextObj.absolute_url(),batchSize);
|
navBaseCall python: 'askObjectHistory(\'%s\',\'%s\',%d,**v**)' % (ajaxHookId, contextObj.absolute_url(),batchSize);
|
||||||
tool contextObj/getTool">
|
tool contextObj/getTool;
|
||||||
|
_ python: tool.translate">
|
||||||
|
|
||||||
<tal:comment replace="nothing">Table containing the history</tal:comment>
|
<tal:comment replace="nothing">Table containing the history</tal:comment>
|
||||||
<tal:history condition="objs">
|
<tal:history condition="objs">
|
||||||
|
@ -82,9 +83,9 @@
|
||||||
state event/review_state|nothing;
|
state event/review_state|nothing;
|
||||||
isDataChange python: event['action'] == '_datachange_'"
|
isDataChange python: event['action'] == '_datachange_'"
|
||||||
tal:attributes="class python:test(odd, 'even', 'odd')" valign="top">
|
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="isDataChange" tal:content="python: _('data_change')"></td>
|
||||||
<td tal:condition="not: isDataChange"
|
<td tal:condition="not: isDataChange"
|
||||||
tal:content="python: tool.translate(contextObj.getWorkflowLabel(event['action']))"/>
|
tal:content="python: _(contextObj.getWorkflowLabel(event['action']))"/>
|
||||||
<td tal:define="actorid python:event.get('actor');" tal:content="actorid"/>
|
<td tal:define="actorid python:event.get('actor');" tal:content="actorid"/>
|
||||||
<td tal:content="event/time"/>
|
<td tal:content="event/time"/>
|
||||||
<td tal:condition="not: isDataChange">
|
<td tal:condition="not: isDataChange">
|
||||||
|
@ -97,12 +98,12 @@
|
||||||
Display the previous values of the fields whose value were modified in this change.</tal:comment>
|
Display the previous values of the fields whose value were modified in this change.</tal:comment>
|
||||||
<table class="appyChanges" width="100%">
|
<table class="appyChanges" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left" width="30%" tal:content="python: tool.translate('modified_field')"></th>
|
<th align="left" width="30%" tal:content="python: _('modified_field')"></th>
|
||||||
<th align="left" width="70%" tal:content="python: tool.translate('previous_value')"></th>
|
<th align="left" width="70%" tal:content="python: _('previous_value')"></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr tal:repeat="change event/changes/items" valign="top">
|
<tr tal:repeat="change event/changes/items" valign="top">
|
||||||
<tal:change define="appyType python:contextObj.getAppyType(change[0], asDict=True);">
|
<tal:change define="appyType python:contextObj.getAppyType(change[0], asDict=True);">
|
||||||
<td tal:content="structure python: tool.translate(appyType['labelId'])"></td>
|
<td tal:content="structure python: _(appyType['labelId'])"></td>
|
||||||
<td tal:define="appyValue python: contextObj.getFormattedFieldValue(change[0], change[1][0]);
|
<td tal:define="appyValue python: contextObj.getFormattedFieldValue(change[0], change[1][0]);
|
||||||
severalValues python: (appyType['multiplicity'][1] > 1) or (appyType['multiplicity'][1] == None)">
|
severalValues python: (appyType['multiplicity'][1] > 1) or (appyType['multiplicity'][1] == None)">
|
||||||
<span tal:condition="not: severalValues" tal:replace="appyValue"></span>
|
<span tal:condition="not: severalValues" tal:replace="appyValue"></span>
|
||||||
|
@ -261,29 +262,34 @@
|
||||||
<tal:previous condition="python: previousPage and pageInfo['showPrevious']">
|
<tal:previous condition="python: previousPage and pageInfo['showPrevious']">
|
||||||
<tal:button condition="isEdit">
|
<tal:button condition="isEdit">
|
||||||
<input type="image" class="imageInput" style="cursor:pointer" name="buttonPrevious"
|
<input type="image" class="imageInput" style="cursor:pointer" name="buttonPrevious"
|
||||||
title="Previous" tal:attributes="src string:$appUrl/ui/previous.png"/>
|
tal:attributes="src string:$appUrl/ui/previous.png;
|
||||||
|
title python: _('page_previous')"/>
|
||||||
<input type="hidden" name="previousPage" tal:attributes="value previousPage"/>
|
<input type="hidden" name="previousPage" tal:attributes="value previousPage"/>
|
||||||
</tal:button>
|
</tal:button>
|
||||||
<tal:link condition="not: isEdit">
|
<tal:link condition="not: isEdit">
|
||||||
<a tal:attributes="href python: contextObj.getUrl(page=previousPage)">
|
<a tal:attributes="href python: contextObj.getUrl(page=previousPage)">
|
||||||
<img tal:attributes="src string:$appUrl/ui/previous.png" title="Previous"/>
|
<img tal:attributes="src string:$appUrl/ui/previous.png;
|
||||||
|
title python: _('page_previous')"/>
|
||||||
</a>
|
</a>
|
||||||
</tal:link>
|
</tal:link>
|
||||||
</tal:previous>
|
</tal:previous>
|
||||||
|
|
||||||
<tal:save condition="python: isEdit and pageInfo['showSave']">
|
<tal:save condition="python: isEdit and pageInfo['showSave']">
|
||||||
<input type="image" class="imageInput" style="cursor:pointer" name="buttonOk"
|
<input type="image" class="imageInput" style="cursor:pointer" name="buttonOk"
|
||||||
title="Save" tal:attributes="src string:$appUrl/ui/save.png"/>
|
tal:attributes="src string:$appUrl/ui/save.png;
|
||||||
|
title python: _('object_save')"/>
|
||||||
</tal:save>
|
</tal:save>
|
||||||
|
|
||||||
<tal:cancel condition="python: isEdit and pageInfo['showCancel']">
|
<tal:cancel condition="python: isEdit and pageInfo['showCancel']">
|
||||||
<input type="image" class="imageInput" style="cursor:pointer" name="buttonCancel"
|
<input type="image" class="imageInput" style="cursor:pointer" name="buttonCancel"
|
||||||
title="Cancel" tal:attributes="src string:$appUrl/ui/cancel.png"/>
|
tal:attributes="src string:$appUrl/ui/cancel.png;
|
||||||
|
title python: _('object_cancel')"/>
|
||||||
</tal:cancel>
|
</tal:cancel>
|
||||||
|
|
||||||
<tal:edit condition="python: not isEdit and pageInfo['showOnEdit']">
|
<tal:edit condition="python: not isEdit and pageInfo['showOnEdit']">
|
||||||
<img title="Edit" style="cursor:pointer"
|
<img style="cursor:pointer"
|
||||||
tal:attributes="onClick python: 'href: window.location=\'%s\'' % contextObj.getUrl(mode='edit', page=page);
|
tal:attributes="onClick python: 'href: window.location=\'%s\'' % contextObj.getUrl(mode='edit', page=page);
|
||||||
|
title python: _('object_edit');
|
||||||
src string: $appUrl/ui/editBig.png"
|
src string: $appUrl/ui/editBig.png"
|
||||||
tal:condition="contextObj/mayEdit"/>
|
tal:condition="contextObj/mayEdit"/>
|
||||||
</tal:edit>
|
</tal:edit>
|
||||||
|
@ -297,12 +303,14 @@
|
||||||
<tal:next condition="python: nextPage and pageInfo['showNext']">
|
<tal:next condition="python: nextPage and pageInfo['showNext']">
|
||||||
<tal:button condition="isEdit">
|
<tal:button condition="isEdit">
|
||||||
<input type="image" class="imageInput" style="cursor:pointer" name="buttonNext"
|
<input type="image" class="imageInput" style="cursor:pointer" name="buttonNext"
|
||||||
title="Next" tal:attributes="src string:$appUrl/ui/next.png"/>
|
tal:attributes="src string:$appUrl/ui/next.png;
|
||||||
|
title python: _('page_next')"/>
|
||||||
<input type="hidden" name="nextPage" tal:attributes="value nextPage"/>
|
<input type="hidden" name="nextPage" tal:attributes="value nextPage"/>
|
||||||
</tal:button>
|
</tal:button>
|
||||||
<tal:link condition="not: isEdit">
|
<tal:link condition="not: isEdit">
|
||||||
<a tal:attributes="href python: contextObj.getUrl(page=nextPage)">
|
<a tal:attributes="href python: contextObj.getUrl(page=nextPage)">
|
||||||
<img tal:attributes="src string:$appUrl/ui/next.png" title="Next"/>
|
<img tal:attributes="src string:$appUrl/ui/next.png;
|
||||||
|
title python: _('page_next')"/>
|
||||||
</a>
|
</a>
|
||||||
</tal:link>
|
</tal:link>
|
||||||
</tal:next>
|
</tal:next>
|
||||||
|
|
BIN
gen/ui/pdf.png
BIN
gen/ui/pdf.png
Binary file not shown.
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 400 B |
|
@ -1,5 +1,6 @@
|
||||||
<metal:queryResults define-macro="queryResult"
|
<metal:queryResults define-macro="queryResult"
|
||||||
tal:define="className request/className;
|
tal:define="_ python: tool.translate;
|
||||||
|
className request/className;
|
||||||
refInfo tool/getRefInfo;
|
refInfo tool/getRefInfo;
|
||||||
refObject python: refInfo[0];
|
refObject python: refInfo[0];
|
||||||
refField python: refInfo[1];
|
refField python: refInfo[1];
|
||||||
|
@ -9,7 +10,7 @@
|
||||||
searchName request/search;
|
searchName request/search;
|
||||||
labelId python: searchName and ('%s_search_%s' % (className, searchName)) or '';
|
labelId python: searchName and ('%s_search_%s' % (className, searchName)) or '';
|
||||||
labelId python: (searchName == '_advanced') and 'search_results' or labelId;
|
labelId python: (searchName == '_advanced') and 'search_results' or labelId;
|
||||||
searchLabel python: labelId and tool.translate(labelId) or '';
|
searchLabel python: labelId and _(labelId) or '';
|
||||||
severalTypes python: className and (className.find(',') != -1);
|
severalTypes python: className and (className.find(',') != -1);
|
||||||
sortKey request/sortKey| python:'';
|
sortKey request/sortKey| python:'';
|
||||||
sortOrder request/sortOrder| python:'asc';
|
sortOrder request/sortOrder| python:'asc';
|
||||||
|
@ -27,11 +28,11 @@
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>
|
<legend>
|
||||||
<span tal:replace="structure python: test(searchName, searchLabel, test(severalTypes, tool.translate(tool.getAppName()), tool.translate('%s_plural' % className)))"/>
|
<span tal:replace="structure python: test(searchName, searchLabel, test(severalTypes, _(tool.getAppName()), _('%s_plural' % className)))"/>
|
||||||
(<span tal:replace="totalNumber"/>)
|
(<span tal:replace="totalNumber"/>)
|
||||||
<tal:newSearch condition="python: searchName == '_advanced'">
|
<tal:newSearch condition="python: searchName == '_advanced'">
|
||||||
— <i><a tal:attributes="href newSearchUrl"
|
— <i><a tal:attributes="href newSearchUrl"
|
||||||
tal:content="python: tool.translate('search_new')"></a></i>
|
tal:content="python: _('search_new')"></a></i>
|
||||||
</tal:newSearch>
|
</tal:newSearch>
|
||||||
</legend>
|
</legend>
|
||||||
|
|
||||||
|
@ -49,7 +50,7 @@
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<tal:descr condition="searchName">
|
<tal:descr condition="searchName">
|
||||||
<td tal:define="descr python: tool.translate('%s_descr' % labelId)"
|
<td tal:define="descr python: _('%s_descr' % labelId)"
|
||||||
tal:condition="descr/strip">
|
tal:condition="descr/strip">
|
||||||
<span class="discreet" tal:content="descr"></span><br/><br/>
|
<span class="discreet" tal:content="descr"></span><br/><br/>
|
||||||
</td>
|
</td>
|
||||||
|
@ -69,16 +70,16 @@
|
||||||
<tal:header repeat="widget widgets">
|
<tal:header repeat="widget widgets">
|
||||||
<th tal:define="sortable python: tool.isSortable(widget['name'], className, 'search');
|
<th tal:define="sortable python: tool.isSortable(widget['name'], className, 'search');
|
||||||
filterable widget/filterable|nothing;">
|
filterable widget/filterable|nothing;">
|
||||||
<span tal:replace="structure python: tool.truncateText(tool.translate(widget['labelId']))"/>
|
<span tal:replace="structure python: tool.truncateText(_(widget['labelId']))"/>
|
||||||
<metal:icons use-macro="context/ui/navigate/macros/sortAndFilter"/>
|
<metal:icons use-macro="context/ui/navigate/macros/sortAndFilter"/>
|
||||||
</th>
|
</th>
|
||||||
</tal:header>
|
</tal:header>
|
||||||
<tal:comment replace="nothing">Object type, shown if instances of several types are shown</tal:comment>
|
<tal:comment replace="nothing">Object type, shown if instances of several types are shown</tal:comment>
|
||||||
<th tal:condition="severalTypes">
|
<th tal:condition="severalTypes">
|
||||||
<span tal:replace="python: tool.translate('root_type')"></span>
|
<span tal:replace="python: _('root_type')"></span>
|
||||||
</th>
|
</th>
|
||||||
<tal:comment replace="nothing">Actions</tal:comment>
|
<tal:comment replace="nothing">Actions</tal:comment>
|
||||||
<th tal:content="python: tool.translate('ref_actions')"></th>
|
<th tal:content="python: _('ref_actions')"></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tal:comment replace="nothing">Results</tal:comment>
|
<tal:comment replace="nothing">Results</tal:comment>
|
||||||
|
@ -97,7 +98,7 @@
|
||||||
<tal:comment replace="nothing">Workflow state</tal:comment>
|
<tal:comment replace="nothing">Workflow state</tal:comment>
|
||||||
<td id="field_workflow_state"
|
<td id="field_workflow_state"
|
||||||
tal:condition="python: widget['name'] == 'state'"
|
tal:condition="python: widget['name'] == 'state'"
|
||||||
tal:content="python: tool.translate(obj.getWorkflowLabel())">
|
tal:content="python: _(obj.getWorkflowLabel())">
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<tal:comment replace="nothing">Any other field</tal:comment>
|
<tal:comment replace="nothing">Any other field</tal:comment>
|
||||||
|
@ -114,7 +115,7 @@
|
||||||
|
|
||||||
<tal:comment replace="nothing">Column "Object type", shown if instances of several types are shown</tal:comment>
|
<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"
|
<td tal:condition="severalTypes" id="field_root_type"
|
||||||
tal:content="python: tool.translate(obj.portal_type)"></td>
|
tal:content="python: _(obj.portal_type)"></td>
|
||||||
|
|
||||||
<tal:comment replace="nothing">Column "Actions"</tal:comment>
|
<tal:comment replace="nothing">Column "Actions"</tal:comment>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
|
@ -125,13 +126,14 @@
|
||||||
<a tal:define="navInfo python:'search.%s.%s.%d.%d' % (className, searchName, repeat['obj'].number()+startNumber, totalNumber);"
|
<a tal:define="navInfo python:'search.%s.%s.%d.%d' % (className, searchName, repeat['obj'].number()+startNumber, totalNumber);"
|
||||||
tal:attributes="href python: obj.getUrl(mode='edit', page=obj.getDefaultEditPage(), nav=navInfo)"
|
tal:attributes="href python: obj.getUrl(mode='edit', page=obj.getDefaultEditPage(), nav=navInfo)"
|
||||||
tal:condition="obj/mayEdit">
|
tal:condition="obj/mayEdit">
|
||||||
<img title="Edit" tal:attributes="src string: $appUrl/ui/edit.gif"/>
|
<img tal:attributes="src string: $appUrl/ui/edit.gif;
|
||||||
|
title python: _('object_edit')"/>
|
||||||
</a></td>
|
</a></td>
|
||||||
<tal:comment replace="nothing">Delete the element</tal:comment>
|
<tal:comment replace="nothing">Delete the element</tal:comment>
|
||||||
<td>
|
<td>
|
||||||
<img tal:condition="obj/mayDelete"
|
<img tal:condition="obj/mayDelete" style="cursor:pointer"
|
||||||
title="Delete" style="cursor:pointer"
|
|
||||||
tal:attributes="src string: $appUrl/ui/delete.png;
|
tal:attributes="src string: $appUrl/ui/delete.png;
|
||||||
|
title python: _('object_delete');
|
||||||
onClick python:'onDeleteObject(\'%s\')' % obj.UID()"/>
|
onClick python:'onDeleteObject(\'%s\')' % obj.UID()"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -147,10 +149,10 @@
|
||||||
</tal:result>
|
</tal:result>
|
||||||
|
|
||||||
<tal:noResult condition="not: objs">
|
<tal:noResult condition="not: objs">
|
||||||
<span tal:replace="python: tool.translate('query_no_result')"/>
|
<span tal:replace="python: _('query_no_result')"/>
|
||||||
<tal:newSearch condition="python: searchName == '_advanced'">
|
<tal:newSearch condition="python: searchName == '_advanced'">
|
||||||
<br/><i class="discreet"><a tal:attributes="href newSearchUrl"
|
<br/><i class="discreet"><a tal:attributes="href newSearchUrl"
|
||||||
tal:content="python: tool.translate('search_new')"></a></i>
|
tal:content="python: _('search_new')"></a></i>
|
||||||
</tal:newSearch>
|
</tal:newSearch>
|
||||||
</tal:noResult>
|
</tal:noResult>
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
tal:attributes="src string:$appUrl/ui/$jsFile"></script>
|
tal:attributes="src string:$appUrl/ui/$jsFile"></script>
|
||||||
|
|
||||||
<tal:comment replace="nothing">Search title</tal:comment>
|
<tal:comment replace="nothing">Search title</tal:comment>
|
||||||
<h1><span tal:replace="python: tool.translate('%s_plural' % className)"/> —
|
<h1><span tal:replace="python: _('%s_plural' % className)"/> —
|
||||||
<span tal:replace="python: tool.translate('search_title')"/></h1><br/>
|
<span tal:replace="python: _('search_title')"/></h1><br/>
|
||||||
|
|
||||||
<tal:comment replace="nothing">Form for searching objects of request/className.</tal:comment>
|
<tal:comment replace="nothing">Form for searching objects of request/className.</tal:comment>
|
||||||
<form name="search" tal:attributes="action python: tool.absolute_url()+'/do'" method="post">
|
<form name="search" tal:attributes="action python: tool.absolute_url()+'/do'" method="post">
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
|
|
||||||
<tal:comment replace="nothing">Submit button</tal:comment>
|
<tal:comment replace="nothing">Submit button</tal:comment>
|
||||||
<p align="right"><br/>
|
<p align="right"><br/>
|
||||||
<input type="submit" tal:attributes="value python:tool.translate('search_button')"/>
|
<input type="submit" tal:attributes="value python: _('search_button')"/>
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</metal:fill>
|
</metal:fill>
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
<input type="hidden" name="actionType"/>
|
<input type="hidden" name="actionType"/>
|
||||||
<input type="hidden" name="action"/>
|
<input type="hidden" name="action"/>
|
||||||
<div id="commentArea" align="left"><br/>
|
<div id="commentArea" align="left"><br/>
|
||||||
<span tal:content="python: tool.translate('workflow_comment')" class="discreet"></span>
|
<span tal:content="python: _('workflow_comment')" class="discreet"></span>
|
||||||
<textarea name="comment" cols="30" rows="3"></textarea>
|
<textarea name="comment" cols="30" rows="3"></textarea>
|
||||||
<br/>
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -112,12 +112,12 @@
|
||||||
<input type="hidden" name="login_name" id="login_name" value=""/>
|
<input type="hidden" name="login_name" id="login_name" value=""/>
|
||||||
<input type="hidden" name="pwd_empty" id="pwd_empty" value="0"/>
|
<input type="hidden" name="pwd_empty" id="pwd_empty" value="0"/>
|
||||||
|
|
||||||
<span>Login</span>
|
<span tal:replace="python: _('app_login')"/>
|
||||||
<input type="text" size="25" name="__ac_name" id="__ac_name" value=""/>
|
<input type="text" size="25" name="__ac_name" id="__ac_name" value=""/>
|
||||||
<span>Password</span>
|
<span tal:replace="python: _('app_password')"/>
|
||||||
<input type="password" size="25" name="__ac_password" id="__ac_password"/>
|
<input type="password" size="25" name="__ac_password" id="__ac_password"/>
|
||||||
<input type="submit" name="submit" onclick="setLoginVars()"
|
<input type="submit" name="submit" onclick="setLoginVars()"
|
||||||
tal:define="label python: _('Login');" tal:attributes="value label; alt label;"/>
|
tal:define="label python: _('app_connect')" tal:attributes="value label; alt label;"/>
|
||||||
</form>
|
</form>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -126,7 +126,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<!-- Go home -->
|
<!-- Go home -->
|
||||||
<a tal:attributes="href appUrl; title python: _('home')">
|
<a tal:attributes="href appUrl; title python: _('app_home')">
|
||||||
<img tal:attributes="src string: $appUrl/ui/home.gif"/>
|
<img tal:attributes="src string: $appUrl/ui/home.gif"/>
|
||||||
</a>
|
</a>
|
||||||
<!-- Config -->
|
<!-- Config -->
|
||||||
|
@ -135,9 +135,11 @@
|
||||||
title python: _('%sTool' % appName)">
|
title python: _('%sTool' % appName)">
|
||||||
<img tal:attributes="src string:$appUrl/ui/appyConfig.gif"/>
|
<img tal:attributes="src string:$appUrl/ui/appyConfig.gif"/>
|
||||||
</a>
|
</a>
|
||||||
|
<tal:comment replace="nothing">Additional icons can be added here by redefining icons.pt</tal:comment>
|
||||||
|
<metal:call use-macro="app/ui/icons/macros/icons"/>
|
||||||
<!-- Logout -->
|
<!-- Logout -->
|
||||||
<a tal:attributes="href python: tool.absolute_url() + '/performLogout';
|
<a tal:attributes="href python: tool.absolute_url() + '/performLogout';
|
||||||
title python: _('logout')">
|
title python: _('app_logout')">
|
||||||
<img tal:attributes="src string: $appUrl/ui/logout.gif"/>
|
<img tal:attributes="src string: $appUrl/ui/logout.gif"/>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -78,7 +78,7 @@
|
||||||
<tal:comment replace="nothing">Search macro for an Date.</tal:comment>
|
<tal:comment replace="nothing">Search macro for an Date.</tal:comment>
|
||||||
<metal:search define-macro="search"
|
<metal:search define-macro="search"
|
||||||
tal:define="years python:range(widget['startYear'], widget['endYear']+1)">
|
tal:define="years python:range(widget['startYear'], widget['endYear']+1)">
|
||||||
<label tal:content="python: tool.translate(widget['labelId'])"></label>
|
<label tal:content="python: _(widget['labelId'])"></label>
|
||||||
<table>
|
<table>
|
||||||
<tal:comment replace="nothing">From</tal:comment>
|
<tal:comment replace="nothing">From</tal:comment>
|
||||||
<tr tal:define="fromName python: '%s_from' % name;
|
<tr tal:define="fromName python: '%s_from' % name;
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
yearFromName python: '%s*date' % widgetName">
|
yearFromName python: '%s*date' % widgetName">
|
||||||
<td width="10px"> </td>
|
<td width="10px"> </td>
|
||||||
<td>
|
<td>
|
||||||
<label tal:content="python: tool.translate('search_from')"></label>
|
<label tal:content="python: _('search_from')"></label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@
|
||||||
yearToName python: '%s_to_year' % name">
|
yearToName python: '%s_to_year' % name">
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
<td>
|
||||||
<label tal:content="python: tool.translate('search_to')"></label>
|
<label tal:content="python: _('search_to')"></label>
|
||||||
</td>
|
</td>
|
||||||
<td height="20px;">
|
<td height="20px;">
|
||||||
<select tal:attributes="id dayToName; name dayToName">
|
<select tal:attributes="id dayToName; name dayToName">
|
||||||
|
|
|
@ -20,13 +20,13 @@
|
||||||
<tal:comment replace="nothing">Search macro for an Float.</tal:comment>
|
<tal:comment replace="nothing">Search macro for an Float.</tal:comment>
|
||||||
<metal:search define-macro="search"
|
<metal:search define-macro="search"
|
||||||
tal:define="maxChars python: test(widget['maxChars'], widget['maxChars'], '')">
|
tal:define="maxChars python: test(widget['maxChars'], widget['maxChars'], '')">
|
||||||
<label tal:content="python: tool.translate(widget['labelId'])"></label><br>
|
<label tal:content="python: _(widget['labelId'])"></label><br>
|
||||||
<tal:from define="fromName python: '%s*float' % widgetName">
|
<tal:from define="fromName python: '%s*float' % widgetName">
|
||||||
<label tal:attributes="for fromName" tal:content="python: tool.translate('search_from')"></label>
|
<label tal:attributes="for fromName" tal:content="python: _('search_from')"></label>
|
||||||
<input type="text" tal:attributes="name fromName; maxlength maxChars" size="4"/>
|
<input type="text" tal:attributes="name fromName; maxlength maxChars" size="4"/>
|
||||||
</tal:from>
|
</tal:from>
|
||||||
<tal:to define="toName python: '%s_to' % name">
|
<tal:to define="toName python: '%s_to' % name">
|
||||||
<label tal:attributes="for toName" tal:content="python: tool.translate('search_to')"></label>
|
<label tal:attributes="for toName" tal:content="python: _('search_to')"></label>
|
||||||
<input type="text" tal:attributes="name toName; maxlength maxChars" size="4"/>
|
<input type="text" tal:attributes="name toName; maxlength maxChars" size="4"/>
|
||||||
</tal:to><br/>
|
</tal:to><br/>
|
||||||
</metal:search>
|
</metal:search>
|
||||||
|
|
|
@ -20,13 +20,13 @@
|
||||||
<tal:comment replace="nothing">Search macro for an Integer.</tal:comment>
|
<tal:comment replace="nothing">Search macro for an Integer.</tal:comment>
|
||||||
<metal:search define-macro="search"
|
<metal:search define-macro="search"
|
||||||
tal:define="maxChars python: test(widget['maxChars'], widget['maxChars'], '')">
|
tal:define="maxChars python: test(widget['maxChars'], widget['maxChars'], '')">
|
||||||
<label tal:content="python: tool.translate(widget['labelId'])"></label><br>
|
<label tal:content="python: _(widget['labelId'])"></label><br>
|
||||||
<tal:from define="fromName python: '%s*int' % widgetName">
|
<tal:from define="fromName python: '%s*int' % widgetName">
|
||||||
<label tal:attributes="for fromName" tal:content="python: tool.translate('search_from')"></label>
|
<label tal:attributes="for fromName" tal:content="python: _('search_from')"></label>
|
||||||
<input type="text" tal:attributes="name fromName; maxlength maxChars" size="4"/>
|
<input type="text" tal:attributes="name fromName; maxlength maxChars" size="4"/>
|
||||||
</tal:from>
|
</tal:from>
|
||||||
<tal:to define="toName python: '%s_to' % name">
|
<tal:to define="toName python: '%s_to' % name">
|
||||||
<label tal:attributes="for toName" tal:content="python: tool.translate('search_to')"></label>
|
<label tal:attributes="for toName" tal:content="python: _('search_to')"></label>
|
||||||
<input type="text" tal:attributes="name toName; maxlength maxChars" size="4"/>
|
<input type="text" tal:attributes="name toName; maxlength maxChars" size="4"/>
|
||||||
</tal:to><br/>
|
</tal:to><br/>
|
||||||
</metal:search>
|
</metal:search>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
chekboxId python: '%s_%s' % (contextObj.UID(), name)">
|
chekboxId python: '%s_%s' % (contextObj.UID(), name)">
|
||||||
<input type="checkbox" tal:attributes="name doLabel; id chekboxId"/>
|
<input type="checkbox" tal:attributes="name doLabel; id chekboxId"/>
|
||||||
<label tal:attributes="for chekboxId" class="discreet"
|
<label tal:attributes="for chekboxId" class="discreet"
|
||||||
tal:content="python: tool.translate(doLabel)"></label>
|
tal:content="python: _(doLabel)"></label>
|
||||||
</tal:askAction>
|
</tal:askAction>
|
||||||
<img tal:repeat="podFormat python: tool.getPodInfo(contextObj, name)[1]"
|
<img tal:repeat="podFormat python: tool.getPodInfo(contextObj, name)[1]"
|
||||||
tal:attributes="src string: $appUrl/ui/${podFormat}.png;
|
tal:attributes="src string: $appUrl/ui/${podFormat}.png;
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
<td tal:attributes="style python:'background-image: url(%s/ui/tabBg.png)' % appUrl;
|
<td tal:attributes="style python:'background-image: url(%s/ui/tabBg.png)' % appUrl;
|
||||||
id tabId">
|
id tabId">
|
||||||
<a style="cursor:pointer"
|
<a style="cursor:pointer"
|
||||||
tal:content="python: tool.translate('%s_col%d' % (widget['labelId'], repeat['widgetRow'].number()))"
|
tal:content="python: _('%s_col%d' % (widget['labelId'], repeat['widgetRow'].number()))"
|
||||||
tal:attributes="onClick python: '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>
|
||||||
<td><img tal:attributes="src string: $appUrl/ui/tabRight.png;
|
<td><img tal:attributes="src string: $appUrl/ui/tabRight.png;
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
|
|
||||||
<tal:comment replace="nothing">Search macro for a String.</tal:comment>
|
<tal:comment replace="nothing">Search macro for a String.</tal:comment>
|
||||||
<metal:search define-macro="search">
|
<metal:search define-macro="search">
|
||||||
<label tal:attributes="for widgetName" tal:content="python: tool.translate(widget['labelId'])"></label><br>
|
<label tal:attributes="for widgetName" tal:content="python: _(widget['labelId'])"></label><br>
|
||||||
<tal:comment replace="nothing">Show a simple search field for most String fields.</tal:comment>
|
<tal:comment replace="nothing">Show a simple search field for most String fields.</tal:comment>
|
||||||
<tal:simpleSearch condition="not: widget/isSelect">
|
<tal:simpleSearch condition="not: widget/isSelect">
|
||||||
<input type="text" tal:define="maxChars python: test(widget['maxChars'], widget['maxChars'], '')"
|
<input type="text" tal:define="maxChars python: test(widget['maxChars'], widget['maxChars'], '')"
|
||||||
|
@ -100,9 +100,9 @@
|
||||||
andName python: '%s_and' % operName;"
|
andName python: '%s_and' % operName;"
|
||||||
condition="python: widget['multiplicity'][1]!=1">
|
condition="python: widget['multiplicity'][1]!=1">
|
||||||
<input type="radio" tal:attributes="name operName; id orName" checked="checked" value="or"/>
|
<input type="radio" tal:attributes="name operName; id orName" checked="checked" value="or"/>
|
||||||
<label tal:attributes="for orName" tal:content="python: tool.translate('search_or')"></label>
|
<label tal:attributes="for orName" tal:content="python: _('search_or')"></label>
|
||||||
<input type="radio" tal:attributes="name operName; id andName" value="and"/>
|
<input type="radio" tal:attributes="name operName; id andName" value="and"/>
|
||||||
<label tal:attributes="for andName" tal:content="python: tool.translate('search_and')"></label><br/>
|
<label tal:attributes="for andName" tal:content="python: _('search_and')"></label><br/>
|
||||||
</tal:operator>
|
</tal:operator>
|
||||||
<tal:comment replace="nothing">The list of values</tal:comment>
|
<tal:comment replace="nothing">The list of values</tal:comment>
|
||||||
<select tal:attributes="name widgetName; size widget/height" multiple="multiple">
|
<select tal:attributes="name widgetName; size widget/height" multiple="multiple">
|
||||||
|
|
|
@ -28,19 +28,18 @@ class UserWrapper(AbstractWrapper):
|
||||||
def validateLogin(self, login):
|
def validateLogin(self, login):
|
||||||
'''Is this p_login valid?'''
|
'''Is this p_login valid?'''
|
||||||
# The login can't be the id of the whole site or "admin"
|
# The login can't be the id of the whole site or "admin"
|
||||||
if login == 'admin':
|
if login == 'admin': return self.translate('login_reserved')
|
||||||
return 'This username is reserved.' # XXX Translate
|
|
||||||
# Check that no user or group already uses this login.
|
# Check that no user or group already uses this login.
|
||||||
if self.count('User', noSecurity=True, login=login) or \
|
if self.count('User', noSecurity=True, login=login) or \
|
||||||
self.count('Group', noSecurity=True, login=login):
|
self.count('Group', noSecurity=True, login=login):
|
||||||
return 'This login is already in use.' # XXX Translate
|
self.translate('login_in_use')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def validatePassword(self, password):
|
def validatePassword(self, password):
|
||||||
'''Is this p_password valid?'''
|
'''Is this p_password valid?'''
|
||||||
# Password must be at least 5 chars length
|
# Password must be at least 5 chars length
|
||||||
if len(password) < 5:
|
if len(password) < 5:
|
||||||
return 'Passwords must contain at least 5 letters.' # XXX Translate
|
return self.translate('password_too_short', mapping={'nb':5})
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def showPassword(self):
|
def showPassword(self):
|
||||||
|
@ -84,8 +83,7 @@ class UserWrapper(AbstractWrapper):
|
||||||
page = self.request.get('page', 'main')
|
page = self.request.get('page', 'main')
|
||||||
if page == 'main':
|
if page == 'main':
|
||||||
if hasattr(new, 'password1') and (new.password1 != new.password2):
|
if hasattr(new, 'password1') and (new.password1 != new.password2):
|
||||||
# XXX Translate
|
msg = self.translate('passwords_mismatch')
|
||||||
msg = 'Passwords do not match.'
|
|
||||||
errors.password1 = msg
|
errors.password1 = msg
|
||||||
errors.password2 = msg
|
errors.password2 = msg
|
||||||
return self._callCustom('validate', new, errors)
|
return self._callCustom('validate', new, errors)
|
||||||
|
|
Loading…
Reference in a new issue