[Checkins] SVN: bluebream/trunk/ - Use a template to display default page for the root

Baiju M baiju.m.mail at gmail.com
Sat Feb 20 09:57:55 EST 2010


Log message for revision 109179:
  - Use a template to display default page for the root
    folder
  
  - Use ``zope.formlib.form.DisplayForm`` as base class for
    views instead of ``zope.publisher.browser.BrowserView``
  
  - Sample application add form view name is changed from
    ``@@add`` to ``@@add_sample_app``
  
  - Add links to to BlueBream website & mailing list
  

Changed:
  U   bluebream/trunk/CHANGES.txt
  U   bluebream/trunk/src/bluebream/project_template/src/+namespace_package+/+main_package+/configure.zcml_tmpl
  A   bluebream/trunk/src/bluebream/project_template/src/+namespace_package+/+main_package+/index.pt_tmpl
  U   bluebream/trunk/src/bluebream/project_template/src/+namespace_package+/+main_package+/views.py
  U   bluebream/trunk/src/bluebream/tests/bluebream.txt

-=-
Modified: bluebream/trunk/CHANGES.txt
===================================================================
--- bluebream/trunk/CHANGES.txt	2010-02-20 13:10:19 UTC (rev 109178)
+++ bluebream/trunk/CHANGES.txt	2010-02-20 14:57:55 UTC (rev 109179)
@@ -4,6 +4,17 @@
 1.0a2 (unreleased)
 ------------------
 
+- Use a template to display default page for the root
+  folder
+
+- Use ``zope.formlib.form.DisplayForm`` as base class for
+  views instead of ``zope.publisher.browser.BrowserView``
+
+- Sample application add form view name is changed from
+  ``@@add`` to ``@@add_sample_app``
+
+- Add links to to BlueBream website & mailing list
+
 1.0a1 (2010-02-06)
 ------------------
 

Modified: bluebream/trunk/src/bluebream/project_template/src/+namespace_package+/+main_package+/configure.zcml_tmpl
===================================================================
--- bluebream/trunk/src/bluebream/project_template/src/+namespace_package+/+main_package+/configure.zcml_tmpl	2010-02-20 13:10:19 UTC (rev 109178)
+++ bluebream/trunk/src/bluebream/project_template/src/+namespace_package+/+main_package+/configure.zcml_tmpl	2010-02-20 14:57:55 UTC (rev 109179)
@@ -31,7 +31,7 @@
 
   <browser:page
      for="zope.site.interfaces.IRootFolder"
-     name="add"
+     name="add_sample_app"
      permission="zope.ManageContent"
      class=".views.AddSampleApplication"
      />

Added: bluebream/trunk/src/bluebream/project_template/src/+namespace_package+/+main_package+/index.pt_tmpl
===================================================================
--- bluebream/trunk/src/bluebream/project_template/src/+namespace_package+/+main_package+/index.pt_tmpl	                        (rev 0)
+++ bluebream/trunk/src/bluebream/project_template/src/+namespace_package+/+main_package+/index.pt_tmpl	2010-02-20 14:57:55 UTC (rev 109179)
@@ -0,0 +1,23 @@
+<html>
+  <head>
+    <title>Welcome to BlueBream!</title>
+  </head>
+  <body>
+    <h1>Welcome to BlueBream!</h1>
+    <ul>
+      <li><a href="http://bluebream.zope.org">BlueBream Website (Documentation)</a></li>
+      <li><a href="http://pypi.python.org/pypi/bluebream">PyPI page</a></li>
+      <li><a href="https://launchpad.net/bluebream">Issue Tracker</a></li>
+      <li><a href="http://wiki.zope.org/bluebream">Wiki</a></li>
+      <li><a href="http://twitter.com/bluebream">Twitter</a></li>
+      <li><a href="https://mail.zope.org/mailman/listinfo/bluebream">Mailing list</a></li>
+      <li>
+        <a href="http://webchat.freenode.net/?randomnick=1&channels=bluebream">
+          IRC Channel: #bluebream at irc.freenode.net</a>
+      </li>
+    </ul>
+    <a href="@@login.html">Login</a>
+    <br/>
+    <a href="@@add_sample_app">Add Sample application</a>
+  </body>
+</html>

Modified: bluebream/trunk/src/bluebream/project_template/src/+namespace_package+/+main_package+/views.py
===================================================================
--- bluebream/trunk/src/bluebream/project_template/src/+namespace_package+/+main_package+/views.py	2010-02-20 13:10:19 UTC (rev 109178)
+++ bluebream/trunk/src/bluebream/project_template/src/+namespace_package+/+main_package+/views.py	2010-02-20 14:57:55 UTC (rev 109179)
@@ -1,10 +1,16 @@
-from zope.publisher.browser import BrowserView
+from zope.browserpage import ViewPageTemplateFile
 from zope.container.interfaces import INameChooser
 from zope.formlib import form
 
 from interfaces import ISampleApplication
 from app import SampleApplication
 
+
+class RootDefaultView(form.DisplayForm):
+
+    __call__ = ViewPageTemplateFile('index.pt')
+
+
 class AddSampleApplication(form.AddForm):
 
     form_fields = form.Fields(ISampleApplication)
@@ -19,29 +25,8 @@
         self.request.response.redirect(name)
 
 
-class SampleApplicationDefaultView(BrowserView):
+class SampleApplicationDefaultView(form.DisplayForm):
 
     def __call__(self):
         return """Welcome to the Sample application"""
 
-
-class RootDefaultView(BrowserView):
-
-    def __call__(self):
-        return """\
-<html><head><title>Welcome to BlueBream!</title></head><body>
-<h1>Welcome to BlueBream!</h1>
-<ul>
-<li><a href="http://pypi.python.org/pypi/bluebream">PyPI page</a></li>
-<li><a href="http://packages.python.org/bluebream">Documentation</a></li>
-<li><a href="https://launchpad.net/bluebream">Issue Tracker</a></li>
-<li><a href="http://wiki.zope.org/bluebream">Wiki</a></li>
-<li><a href="http://twitter.com/bluebream">Twitter</a></li>
-<li><a href="https://mail.zope.org/mailman/listinfo/zope3-users">Mailing list</a></li>
-<li><a href="http://webchat.freenode.net/?randomnick=1&channels=bluebream">IRC Channel: #bluebream at irc.freenode.net</a></li>
-</ul>
-<a href="@@login.html">Login</a>
-<br/>
-<a href="@@add">Add Sample application</a>
-</body></html>
-"""

Modified: bluebream/trunk/src/bluebream/tests/bluebream.txt
===================================================================
--- bluebream/trunk/src/bluebream/tests/bluebream.txt	2010-02-20 13:10:19 UTC (rev 109178)
+++ bluebream/trunk/src/bluebream/tests/bluebream.txt	2010-02-20 14:57:55 UTC (rev 109179)
@@ -64,6 +64,7 @@
         Copying configure.zcml_tmpl to ./sample/src/test_name/test_main/configure.zcml
         Copying debug.py to ./sample/src/test_name/test_main/debug.py
         Copying ftesting.zcml_tmpl to ./sample/src/test_name/test_main/ftesting.zcml
+        Copying index.pt_tmpl to ./sample/src/test_name/test_main/index.pt
         Copying interfaces.py to ./sample/src/test_name/test_main/interfaces.py
         Copying securitypolicy.zcml_tmpl to ./sample/src/test_name/test_main/securitypolicy.zcml
         Copying startup.py to ./sample/src/test_name/test_main/startup.py



More information about the checkins mailing list