From a67c19659a7a3d29f5ced9062c9c21afe73f9366 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Sun, 24 Mar 2013 17:15:06 +0100 Subject: [PATCH] more flexible layout for states info and stateful actions; improved/more flexible translateion facilities --- browser/common.py | 5 +++++ browser/form_macros.pt | 17 +++++++++++------ organize/stateful/browser.py | 10 ++++++++-- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/browser/common.py b/browser/common.py index c7e0528..69b54b6 100644 --- a/browser/common.py +++ b/browser/common.py @@ -154,6 +154,11 @@ class BaseView(GenericView, I18NView): def checkPermissions(self): return canAccessObject(self.context) + def translate(self, text, msgFactory=_): + if msgFactory is None: + return text + return msgFactory(text) + @Lazy def contextInfo(self): return dict(view=self, context=getName(self.context)) diff --git a/browser/form_macros.pt b/browser/form_macros.pt index 63543d3..f56b708 100644 --- a/browser/form_macros.pt +++ b/browser/form_macros.pt @@ -274,18 +274,22 @@ - + States + - States - loops.simple_publishing - draft + + + loops.simple_publishing:  + + draft