From d2d3f9a7450f941e8d33bdcb227c305629269769 Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Wed, 7 Sep 2011 09:56:53 +0200 Subject: [PATCH] appy.gen: removed from some pages superfluous translations of inexistent labels. --- gen/plone25/skin/result.pt | 25 +++++++++++++++---------- gen/plone25/skin/widgets/action.pt | 8 +++++--- gen/plone25/skin/widgets/ref.pt | 7 +++---- gen/plone25/skin/widgets/show.pt | 2 +- gen/plone25/wrappers/__init__.py | 4 +--- 5 files changed, 25 insertions(+), 21 deletions(-) diff --git a/gen/plone25/skin/result.pt b/gen/plone25/skin/result.pt index 2b517c9..c01d0d6 100644 --- a/gen/plone25/skin/result.pt +++ b/gen/plone25/skin/result.pt @@ -7,8 +7,9 @@ startNumber request/startNumber|python:'0'; startNumber python: int(startNumber); searchName request/search; - searchLabel python: test(searchName=='_advanced', 'search_results', '%s_search_%s' % (contentType, searchName)); - searchDescr python: '%s_descr' % searchLabel; + labelId python: searchName and ('%s_search_%s' % (contentType, searchName)) or ''; + labelId python: (searchName == '_advanced') and 'search_results' or labelId; + searchLabel python: labelId and tool.translate(labelId) or ''; severalTypes python: contentType and (contentType.find(',') != -1); sortKey request/sortKey| python:''; sortOrder request/sortOrder| python:'asc'; @@ -26,7 +27,7 @@
- + ()   —   - - +
-

+ + + + + -
+

- Appy (top) navigation - + Appy (top) navigation +
+
- + + The previous onClick is simply used to prevent Plone diff --git a/gen/plone25/skin/widgets/ref.pt b/gen/plone25/skin/widgets/ref.pt index 7ba90f9..4fa7b5f 100644 --- a/gen/plone25/skin/widgets/ref.pt +++ b/gen/plone25/skin/widgets/ref.pt @@ -121,8 +121,7 @@ showPlusIcon python:not appyType['isBack'] and appyType['add'] and not maxReached and member.has_permission(addPermission, folder) and canWrite; atMostOneRef python: (multiplicity[1] == 1) and (len(objs)<=1); label python: contextObj.translate('label', field=appyType['name']); - addConfirmMsg python: tool.translate('%s_addConfirm' % appyType['labelId']); - description python: contextObj.translate('descr', field=appyType['name']); + addConfirmMsg python: appyType['addConfirm'] and tool.translate('%s_addConfirm' % appyType['labelId']) or ''; navBaseCall python: 'askRefField(\'%s\',\'%s\',\'%s\',\'%s\',**v**)' % (ajaxHookId, contextObj.absolute_url(), fieldName, innerRef)"> This macro displays the Reference widget on a "consult" page. @@ -167,8 +166,8 @@ Object description - +

Appy (top) navigation diff --git a/gen/plone25/skin/widgets/show.pt b/gen/plone25/skin/widgets/show.pt index 8241fa1..1c77c8a 100644 --- a/gen/plone25/skin/widgets/show.pt +++ b/gen/plone25/skin/widgets/show.pt @@ -154,7 +154,7 @@
The rows of widgets diff --git a/gen/plone25/wrappers/__init__.py b/gen/plone25/wrappers/__init__.py index 19c4807..be340dd 100644 --- a/gen/plone25/wrappers/__init__.py +++ b/gen/plone25/wrappers/__init__.py @@ -62,9 +62,7 @@ class AbstractWrapper(object): except AttributeError, ae: # Maybe a back reference? res = self.o.getAppyType(name) - if not res: - print "Attribute error", ae - raise ae + if not res: raise ae # If we got an Appy type, return the value of this type for this object if isinstance(res, Type): o = self.o
+ tal:content="structure python: widget['hasHeaders'] and contextObj.translate('%s_col%d' % (widget['labelId'], colNb+1)) or ''">