[gen] When param Ref.select is a Search instance, Search.name can be ommitted; added code that shows a warning: Appy is not compatible with MSIE below 9.
This commit is contained in:
parent
a45dfa8dd0
commit
dda894089a
|
@ -24,10 +24,12 @@ from group import Group
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
class Search:
|
class Search:
|
||||||
'''Used for specifying a search for a given class.'''
|
'''Used for specifying a search for a given class.'''
|
||||||
def __init__(self, name, group=None, sortBy='', sortOrder='asc',
|
def __init__(self, name=None, group=None, sortBy='', sortOrder='asc',
|
||||||
maxPerPage=30, default=False, colspan=1, translated=None,
|
maxPerPage=30, default=False, colspan=1, translated=None,
|
||||||
show=True, translatedDescr=None, checkboxes=False,
|
show=True, translatedDescr=None, checkboxes=False,
|
||||||
checkboxesDefault=True, **fields):
|
checkboxesDefault=True, **fields):
|
||||||
|
# "name" is mandatory, excepted in some special cases (ie, when used as
|
||||||
|
# "select" param for a Ref field).
|
||||||
self.name = name
|
self.name = name
|
||||||
# Searches may be visually grouped in the portlet.
|
# Searches may be visually grouped in the portlet.
|
||||||
self.group = Group.get(group)
|
self.group = Group.get(group)
|
||||||
|
|
|
@ -730,6 +730,9 @@ class ZopeGenerator(Generator):
|
||||||
def generateSearches(self, classDescr):
|
def generateSearches(self, classDescr):
|
||||||
'''Generates i18n labels for searches defined on p_classDescr.'''
|
'''Generates i18n labels for searches defined on p_classDescr.'''
|
||||||
for search in classDescr.getSearches(classDescr.klass):
|
for search in classDescr.getSearches(classDescr.klass):
|
||||||
|
if not search.name:
|
||||||
|
className = classDescr.klass.__name__
|
||||||
|
raise Exception('Search defined on %s has no name.' % className)
|
||||||
label = '%s_search_%s' % (classDescr.name, search.name)
|
label = '%s_search_%s' % (classDescr.name, search.name)
|
||||||
self.i18n(label, search.name)
|
self.i18n(label, search.name)
|
||||||
self.i18n('%s_descr' % label, ' ', nice=False)
|
self.i18n('%s_descr' % label, ' ', nice=False)
|
||||||
|
|
|
@ -1410,4 +1410,16 @@ class ToolMixin(BaseMixin):
|
||||||
'''Returns the PX allowing to close the iframe popup and refresh the
|
'''Returns the PX allowing to close the iframe popup and refresh the
|
||||||
base page.'''
|
base page.'''
|
||||||
return self.appy().pxBack({'ztool': self})
|
return self.appy().pxBack({'ztool': self})
|
||||||
|
|
||||||
|
ieRex = re.compile('MSIE\s+(\d\.\d)')
|
||||||
|
ieMin = '9' # We do not support IE below this version.
|
||||||
|
def getBrowserIncompatibility(self):
|
||||||
|
'''Produces an error message if the browser in use is not compatible
|
||||||
|
with Appy.'''
|
||||||
|
res = self.ieRex.search(self.REQUEST.get('HTTP_USER_AGENT'))
|
||||||
|
if not res: return
|
||||||
|
version = res.group(1)
|
||||||
|
if version < self.ieMin:
|
||||||
|
mapping = {'version': version, 'min': self.ieMin}
|
||||||
|
return self.translate('wrong_browser', mapping=mapping)
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
|
@ -715,6 +715,6 @@ msgstr ""
|
||||||
msgid "unauthorized"
|
msgid "unauthorized"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. Default: "Close"
|
#. Default: "Microsoft Internet Explorer ${version} is not supported. Please upgrade your browser to version ${min} or above."
|
||||||
msgid "window_close"
|
msgid "wrong_browser"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -714,3 +714,7 @@ msgstr ""
|
||||||
#. Default: "You are not allowed to consult this."
|
#. Default: "You are not allowed to consult this."
|
||||||
msgid "unauthorized"
|
msgid "unauthorized"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. Default: "Microsoft Internet Explorer ${version} is not supported. Please upgrade your browser to version ${min} or above."
|
||||||
|
msgid "wrong_browser"
|
||||||
|
msgstr ""
|
||||||
|
|
|
@ -714,3 +714,7 @@ msgstr ""
|
||||||
#. Default: "You are not allowed to consult this."
|
#. Default: "You are not allowed to consult this."
|
||||||
msgid "unauthorized"
|
msgid "unauthorized"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. Default: "Microsoft Internet Explorer ${version} is not supported. Please upgrade your browser to version ${min} or above."
|
||||||
|
msgid "wrong_browser"
|
||||||
|
msgstr ""
|
||||||
|
|
|
@ -715,3 +715,7 @@ msgstr "In some situations, by leaving this page this way, you may lose encoded
|
||||||
#. Default: "You are not allowed to consult this."
|
#. Default: "You are not allowed to consult this."
|
||||||
msgid "unauthorized"
|
msgid "unauthorized"
|
||||||
msgstr "You are not allowed to consult this."
|
msgstr "You are not allowed to consult this."
|
||||||
|
|
||||||
|
#. Default: "Microsoft Internet Explorer ${version} is not supported. Please upgrade your browser to version ${min} or above."
|
||||||
|
msgid "wrong_browser"
|
||||||
|
msgstr "Microsoft Internet Explorer ${version} is not supported. Please upgrade your browser to version ${min} or above."
|
||||||
|
|
|
@ -714,3 +714,7 @@ msgstr ""
|
||||||
#. Default: "You are not allowed to consult this."
|
#. Default: "You are not allowed to consult this."
|
||||||
msgid "unauthorized"
|
msgid "unauthorized"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. Default: "Microsoft Internet Explorer ${version} is not supported. Please upgrade your browser to version ${min} or above."
|
||||||
|
msgid "wrong_browser"
|
||||||
|
msgstr ""
|
||||||
|
|
|
@ -715,3 +715,7 @@ msgstr "Dans certaines situations, en quittant cette page de cette manière, vou
|
||||||
#. Default: "You are not allowed to consult this."
|
#. Default: "You are not allowed to consult this."
|
||||||
msgid "unauthorized"
|
msgid "unauthorized"
|
||||||
msgstr "Vous n'êtes pas autorisé à consulter ceci."
|
msgstr "Vous n'êtes pas autorisé à consulter ceci."
|
||||||
|
|
||||||
|
#. Default: "Microsoft Internet Explorer ${version} is not supported. Please upgrade your browser to version ${min} or above."
|
||||||
|
msgid "wrong_browser"
|
||||||
|
msgstr "Microsoft Internet Explorer ${version} n'est pas supporté. Veuillez mettre à jour votre navigateur à la version ${min} ou supérieure."
|
||||||
|
|
|
@ -714,3 +714,7 @@ msgstr ""
|
||||||
#. Default: "You are not allowed to consult this."
|
#. Default: "You are not allowed to consult this."
|
||||||
msgid "unauthorized"
|
msgid "unauthorized"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. Default: "Microsoft Internet Explorer ${version} is not supported. Please upgrade your browser to version ${min} or above."
|
||||||
|
msgid "wrong_browser"
|
||||||
|
msgstr ""
|
||||||
|
|
|
@ -714,3 +714,7 @@ msgstr ""
|
||||||
#. Default: "You are not allowed to consult this."
|
#. Default: "You are not allowed to consult this."
|
||||||
msgid "unauthorized"
|
msgid "unauthorized"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. Default: "Microsoft Internet Explorer ${version} is not supported. Please upgrade your browser to version ${min} or above."
|
||||||
|
msgid "wrong_browser"
|
||||||
|
msgstr ""
|
||||||
|
|
|
@ -47,6 +47,7 @@ img { border: 0; vertical-align: middle }
|
||||||
|
|
||||||
.main { width: 900px; height: 95%; box-shadow: 3px 3px 3px #A9A9A9 }
|
.main { width: 900px; height: 95%; box-shadow: 3px 3px 3px #A9A9A9 }
|
||||||
.mainWide { width: 100%; height: 100% }
|
.mainWide { width: 100%; height: 100% }
|
||||||
|
.wrongBrowser { height: 15px; color: red; text-align: center }
|
||||||
.top { height: 89px; margin-left: 3em; vertical-align: top;
|
.top { height: 89px; margin-left: 3em; vertical-align: top;
|
||||||
background-color: white }
|
background-color: white }
|
||||||
.lang { margin-right: 6px }
|
.lang { margin-right: 6px }
|
||||||
|
|
|
@ -236,7 +236,7 @@ function askQueryResult(hookId, objectUrl, className, searchName, popup,
|
||||||
var filterWidget = document.getElementById(hookId + '_' + filterKey);
|
var filterWidget = document.getElementById(hookId + '_' + filterKey);
|
||||||
if (filterWidget && filterWidget.value) {
|
if (filterWidget && filterWidget.value) {
|
||||||
params['filterKey'] = filterKey;
|
params['filterKey'] = filterKey;
|
||||||
params['filterValue'] = filterWidget.value;
|
params['filterValue'] = encodeURIComponent(filterWidget.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
askAjaxChunk(hookId, 'GET', objectUrl, 'pxQueryResult', params, null,
|
askAjaxChunk(hookId, 'GET', objectUrl, 'pxQueryResult', params, null,
|
||||||
|
|
|
@ -181,6 +181,10 @@ class AbstractWrapper(object):
|
||||||
|
|
||||||
<table class=":(cfg.skin == 'wide') and 'mainWide main' or 'main'"
|
<table class=":(cfg.skin == 'wide') and 'mainWide main' or 'main'"
|
||||||
align="center" cellpadding="0">
|
align="center" cellpadding="0">
|
||||||
|
<!-- The browser incompatibility message when relevant -->
|
||||||
|
<tr var="bi=ztool.getBrowserIncompatibility()" if="bi"
|
||||||
|
class="wrongBrowser"><td>:bi</td></tr>
|
||||||
|
|
||||||
<tr class="top" if="not inPopup">
|
<tr class="top" if="not inPopup">
|
||||||
<!-- Top banner -->
|
<!-- Top banner -->
|
||||||
<td var="bannerName=(dir == 'ltr') and 'banner' or 'bannerrtl'"
|
<td var="bannerName=(dir == 'ltr') and 'banner' or 'bannerrtl'"
|
||||||
|
|
Loading…
Reference in a new issue