diff --git a/browser/common.py b/browser/common.py index cbf456b..ac304db 100644 --- a/browser/common.py +++ b/browser/common.py @@ -72,6 +72,7 @@ from loops.versioning.interfaces import IVersionable concept_macros = ViewPageTemplateFile('concept_macros.pt') conceptMacrosTemplate = concept_macros # +resource_macros = ViewPageTemplateFile('resource_macros.pt') class NameField(schema.ASCIILine): @@ -131,6 +132,10 @@ class BaseView(GenericView, I18NView): concept_macros = conceptMacros + @Lazy + def resource_macros(self): + return resource_macros.macros + @Lazy def name(self): return getName(self.context) diff --git a/browser/resource_macros.pt b/browser/resource_macros.pt index 9172377..5f5ad01 100644 --- a/browser/resource_macros.pt +++ b/browser/resource_macros.pt @@ -15,6 +15,7 @@
Description
+Blogging from ...
\n'
+ u'
Blogging from ...
\n'
>>> aMail.externalAddress
u'imap://jim@merz12/20081208171745.e4ce2xm96cco80cg@cy55.de'
diff --git a/integrator/mail/browser.py b/integrator/mail/browser.py
new file mode 100644
index 0000000..116bcd9
--- /dev/null
+++ b/integrator/mail/browser.py
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2009 Helmut Merz helmutm@cy55.de
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+"""
+View class(es) for mail objects.
+
+$Id$
+"""
+
+from zope import interface, component
+from zope.app.pagetemplate import ViewPageTemplateFile
+from zope.cachedescriptors.property import Lazy
+
+from loops.browser.resource import DocumentView
+from loops.common import adapted
+
+
+class MailView(DocumentView):
+
+ macro_template = ViewPageTemplateFile('mail_macros.pt')
+
+ @property
+ def macro(self):
+ return self.macro_template.macros['email']
+
diff --git a/integrator/mail/configure.zcml b/integrator/mail/configure.zcml
index 2594c6d..352bad2 100644
--- a/integrator/mail/configure.zcml
+++ b/integrator/mail/configure.zcml
@@ -31,4 +31,14 @@
set_schema="loops.integrator.mail.interfaces.IMailResource" />
+
+
+
+
+
+
+ From:
+
+
+ To:
+
+
+ Date:
+
+