[Checkins] SVN: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/ Added questionnaire package

Darryl Cousins darryl at darrylcousins.net.nz
Sat Jul 7 07:29:42 EDT 2007


Log message for revision 77564:
  Added questionnaire package

Changed:
  U   Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/application.zcml
  U   Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/browser/browser.py
  U   Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/browser/index.pt
  U   Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/configure.zcml
  U   Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/layer.py
  U   Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/message/message.py
  D   Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/message/what-values.csv
  A   Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/
  A   Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/README.txt
  A   Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/__init__.py
  A   Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/questionnaire.css
  A   Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/questionnaire.py
  A   Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/results.pt
  D   Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/skin/images/
  U   Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/skin/skin.py
  U   Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/tests.py

-=-
Modified: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/application.zcml
===================================================================
--- Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/application.zcml	2007-07-07 11:27:59 UTC (rev 77563)
+++ Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/application.zcml	2007-07-07 11:29:42 UTC (rev 77564)
@@ -57,7 +57,6 @@
 
   <include package="z3c.form" />
   <include package="z3c.formui" />
-  <include package="z3c.formdemo" />
   <include package="z3c.layer.pagelet" />
   <include package="z3c.macro" />
   <include package="z3c.pagelet" />

Modified: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/browser/browser.py
===================================================================
--- Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/browser/browser.py	2007-07-07 11:27:59 UTC (rev 77563)
+++ Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/browser/browser.py	2007-07-07 11:29:42 UTC (rev 77564)
@@ -1,3 +1,4 @@
+__docformat__ = "reStructuredText"
 from zope.app.folder.interfaces import IFolder
 
 import grok
@@ -11,10 +12,12 @@
 mars.layer.layer(IDemoDivBrowserLayer)
 
 class Index(mars.view.LayoutView):
+    """`home` for formdemo"""
     grok.name('index')
     grok.context(IFolder)
 
 class IndexTemplate(mars.template.LayoutFactory):
+    """layout template for `home`"""
     grok.context(Index)
     grok.template('index.pt') 
     

Modified: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/browser/index.pt
===================================================================
--- Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/browser/index.pt	2007-07-07 11:27:59 UTC (rev 77563)
+++ Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/browser/index.pt	2007-07-07 11:29:42 UTC (rev 77564)
@@ -6,10 +6,18 @@
   <div>
     <a href="../++skin++marsformdemo/addHelloWorld">Hello World</a>
   </div>
+  <div>
+    <a href="../++skin++marsformdemo/questionnaireResults">Questionnaire</a>
+  </div>
 
+
   <h4>Table based layout</h4>
   <div>
     <a href="../++skin++marstableformdemo/addHelloWorld">Hello World</a>
   </div>
+  <div>
+    <a href="../++skin++marstableformdemo/questionnaireResults">Questionnaire</a>
+  </div>
+
 </div>
 

Modified: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/configure.zcml
===================================================================
--- Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/configure.zcml	2007-07-07 11:27:59 UTC (rev 77563)
+++ Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/configure.zcml	2007-07-07 11:29:42 UTC (rev 77564)
@@ -4,16 +4,17 @@
 
   <grok package="." xmlns="http://namespaces.zope.org/grok" />
 
-  <!-- Examples -->
 
-  <!--include package=".message" />
-  <include package=".sqlmessage" />
-  <include package=".widgets" />
-  <include package=".questionnaire" />
-  <include package=".calculator" />
-  <include package=".wizard" />
-  <include package=".spreadsheet" />
-  <include package=".addressbook" /-->
+  <!-- ZC Table Resource Library inclusion -->
 
+  <configure package="zc.table">
+    <resourceLibrary
+        name="zc.table"
+        layer="mars.formdemo.layer.IDemoBrowserLayer">
+      <directory source="resources" include="sorting.js"/>
+    </resourceLibrary>
+  </configure>
+
+
 </configure>
 

Modified: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/layer.py
===================================================================
--- Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/layer.py	2007-07-07 11:27:59 UTC (rev 77563)
+++ Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/layer.py	2007-07-07 11:29:42 UTC (rev 77564)
@@ -1,3 +1,4 @@
+__docformat__ = "reStructuredText"
 import mars.layer
 
 class IDemoBrowserLayer(mars.layer.ILayer):

Modified: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/message/message.py
===================================================================
--- Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/message/message.py	2007-07-07 11:27:59 UTC (rev 77563)
+++ Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/message/message.py	2007-07-07 11:29:42 UTC (rev 77564)
@@ -12,6 +12,7 @@
 from z3c.form import button, field, form, widget
 from z3c.form.interfaces import IAddForm
 from z3c.formui import layout
+from z3c.formdemo.message.interfaces import IHelloWorld
 
 import grok
 
@@ -23,30 +24,6 @@
 
 mars.layer.layer(IDemoBrowserLayer)
 
-
-WhatVocabulary = CSVVocabulary(
-    os.path.join(os.path.dirname(__file__), 'what-values.csv'))
-
-class IHelloWorld(zope.interface.Interface):
-    """Information about a hello world message"""
-
-    who = zope.schema.TextLine(
-        title=u'Who',
-        description=u'Name of the person sending the message',
-        required=True)
-
-    when = zope.schema.Date(
-        title=u'When',
-        description=u'Date of the message sent.',
-        required=True)
-
-    what = zope.schema.Choice(
-        title=u'What',
-        description=u'What type of message it is.',
-        vocabulary=WhatVocabulary,
-        default=u'cool',
-        required=True)
-
 class DefaultDate(mars.adapter.AdapterFactory):
     grok.name('default')
     mars.adapter.factory(widget.ComputedWidgetAttribute(

Deleted: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/message/what-values.csv
===================================================================
--- Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/message/what-values.csv	2007-07-07 11:27:59 UTC (rev 77563)
+++ Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/message/what-values.csv	2007-07-07 11:29:42 UTC (rev 77564)
@@ -1,4 +0,0 @@
-"cool";"cool"
-"sunny";"sunny"
-"silent";"silent"
-"best";"best"

Added: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/README.txt
===================================================================
--- Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/README.txt	                        (rev 0)
+++ Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/README.txt	2007-07-07 11:29:42 UTC (rev 77564)
@@ -0,0 +1,155 @@
+==================
+Questionnaire Demo
+==================
+
+The purpose of the questionnaire demo is demonstrate the concept of field
+groups and attribute value adapters for fields.
+
+To start, we need to open a browser and go to the demo applications overview
+screen:
+
+  >>> from z3c.formdemo import testing
+  >>> from z3c.etestbrowser.testing import ExtendedTestBrowser
+  >>> user = ExtendedTestBrowser()
+  >>> user.handleErrors = False
+  >>> user.addHeader('Accept-Language', 'en')
+  >>> skinURL = 'http://localhost:8080/++skin++marsformdemo'
+  >>> user.open('http://localhost:8080')
+
+Since all demos are purely public, there is no need to log in. Let's now click
+on the "All widgets" link:
+
+  >>> user.open(skinURL + '/questionnaireResults')
+
+The first screen you see is the questionnaire results screen.
+
+  >>> testing.printElement(user, "//h1")
+  <h1>Zope Developer Questionnaire Results</h1>
+
+Initially there are no questionnaires, so the screen contains little
+information. Let's first fill out a questionnaire by click on the link below
+the table.
+
+  >>> user.getLink('Fill out Questionnaire').click()
+
+The user is now presented with the questionnaire screen, which is organized
+into three groups. Let's fill out the questionnaire:
+
+  >>> user.getControl('Name').value = u'Stephan Richter'
+  >>> user.getControl('Age').value = u'27'
+
+  >>> user.getControl('yes', index=0).click()
+  >>> user.getControl('no', index=1).click()
+  >>> user.getControl('yes', index=2).click()
+  >>> user.getControl('no', index=3).click()
+
+  >>> user.getControl('yes', index=4).click()
+  >>> user.getControl('have you contributed').value = u'5'
+  >>> user.getControl('What is your Zope Id?').value = u'srichter'
+
+  >>> user.getControl('Submit Questionnaire').click()
+
+Once the questionnaire has been submitted, the user is returned to the results
+screen. Now the table has an entry:
+
+  >>> testing.printElement(user, "//table/tbody/tr[1]")
+  <tr class="odd"><td
+     class="sorted-on">
+      Stephan Richter
+    </td>
+    <td class="right">
+      27
+    </td>
+    <td class="right">
+      yes
+    </td>
+    <td class="right">
+      no
+    </td>
+    <td class="right">
+      yes
+    </td>
+    <td class="right">
+      no
+    </td>
+    <td class="right">
+      yes
+    </td>
+    <td class="right">
+      5
+    </td>
+    <td class="right">
+      srichter
+    </td>
+  </tr>
+
+Let's now fill out another questionnaire:
+
+  >>> user.getLink('Fill out Questionnaire').click()
+
+  >>> user.getControl('Name').value = u'Roger Ineichen'
+  >>> user.getControl('Age').value = u'39'
+
+  >>> user.getControl('yes', index=0).click()
+  >>> user.getControl('yes', index=1).click()
+  >>> user.getControl('yes', index=2).click()
+  >>> user.getControl('no', index=3).click()
+
+  >>> user.getControl('yes', index=4).click()
+  >>> user.getControl('have you contributed').value = u'4'
+  >>> user.getControl('What is your Zope Id?').value = u'projekt01'
+
+  >>> user.getControl('Submit Questionnaire').click()
+
+Now that we have two entries, we can use the table headers cells to sort
+them. By default they are sorted by name:
+
+  >>> testing.printElement(user, "//table/tbody/tr/td[1]/text()",
+  ...                      multiple=True, serialize=False)
+  Roger Ineichen
+  Stephan Richter
+
+Clicking on the "Name" table header cell, will leave the order, since the
+ordering must be initialized. The second time the order is reversed:
+
+  >>> user.getLink('Name').click()
+  >>> user.getLink('Name').click()
+
+  >>> testing.printElement(user, "//table/tbody/tr/td[1]/text()",
+  ...                      multiple=True, serialize=False)
+  Stephan Richter
+  Roger Ineichen
+
+Selecting another header will sort on it. Let's choose the age; clicking on it
+once sorts it in ascending order:
+
+  >>> user.getLink('Age').click()
+  >>> testing.printElement(user, "//table/tbody/tr/td[2]/text()",
+  ...                      multiple=True, serialize=False)
+  27
+  39
+
+Clicking it again, reverses the order:
+
+  >>> user.getLink('Age').click()
+  >>> testing.printElement(user, "//table/tbody/tr/td[2]/text()",
+  ...                      multiple=True, serialize=False)
+  39
+  27
+
+Finally, let's make sure that all headers are linked:
+
+  >>> user.getLink('Zope 2')
+  <Link text='Zope 2' url='...?sort-on=formdemo.questionnaire.zope2'>
+  >>> user.getLink('Plone')
+  <Link text='Plone' url='...?sort-on=formdemo.questionnaire.plone'>
+  >>> user.getLink('Zope 3')
+  <Link text='Zope 3' url='...?sort-on=formdemo.questionnaire.zope3'>
+  >>> user.getLink('Five')
+  <Link text='Five' url='...?sort-on=formdemo.questionnaire.five'>
+  >>> user.getLink('Contrib.')
+  <Link text='Contrib.' url='...?sort-on=formdemo.questionnaire.contributor'>
+  >>> user.getLink('Years')
+  <Link text='Years' url='...?sort-on=formdemo.questionnaire.years'>
+  >>> user.getLink('Zope Id')
+  <Link text='Zope Id' url='...?sort-on=formdemo.questionnaire.zopeId'>


Property changes on: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/README.txt
___________________________________________________________________
Name: svn:keywords
   + Date Author

Added: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/__init__.py
===================================================================
--- Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/__init__.py	                        (rev 0)
+++ Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/__init__.py	2007-07-07 11:29:42 UTC (rev 77564)
@@ -0,0 +1,2 @@
+#
+


Property changes on: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Added: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/questionnaire.css
===================================================================
--- Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/questionnaire.css	                        (rev 0)
+++ Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/questionnaire.css	2007-07-07 11:29:42 UTC (rev 77564)
@@ -0,0 +1,111 @@
+body {
+  background: #629C9D;
+  padding: 20px;
+  color: #5E4A32;
+}
+
+h1 {
+  border-bottom: 2px solid #C89C6B;
+  margin-bottom: 5px;
+  font-weight: bold;
+  color: #5E4A32;
+}
+
+div#content {
+  background: #ECD7C2;
+  border: 2px solid #C89C6B;
+  padding: 10px 20px;
+  width: 700px;
+  -moz-border-radius: 15px;
+}
+
+fieldset {
+  margin-top: 15px;
+  border: 1px solid #C89C6B;
+  padding: 10px 15px 5px 15px;
+  -moz-border-radius: 7px;
+}
+
+fieldset legend {
+  color: #5E4A32;
+  font-variant: small-caps;
+  font-weight: bold;
+  font-size: 110%;
+  border: 1px solid #C89C6B;
+  padding: 2px 4px;
+  -moz-border-radius: 3px;
+}
+
+a, a:link, a:visited, a:hover {
+  color: #D36938;
+}
+
+div.required-info {
+  margin-bottom: 10px;
+}
+
+div.error {
+  display: inline;
+}
+
+span.option span.label {
+  margin-right: 50px;
+}
+
+input[type=text] {
+  padding: 1px 2px;
+  background: #FFFFA0;
+}
+
+input#form-widgets-age {
+  width: 3em;
+  text-align: right;
+}
+
+input#form-widgets-years {
+  width: 2em;
+  text-align: right;
+}
+
+input#form-widgets-zopeId {
+  width: 10em;
+}
+
+input[type=submit] {
+  background: #E6B95C;
+  border: 1px solid #DB9649;
+  color: #5E4A32;
+  text-shadow: 1px 1px white;
+}
+
+table {
+  margin-top: 15px;
+  margin-bottom: 15px;
+}
+
+table th {
+  background: #5E4A32;
+  color: white;
+  padding: 3px 2px;
+}
+
+table th a:link {
+  color: white;
+}
+
+table th a:hover {
+  color: white;
+}
+
+table th a:visited {
+  color: white;
+}
+
+table tr.even {
+  background: #D3C0AE;
+}
+
+table td.right {
+  text-align: right;
+}
+

Added: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/questionnaire.py
===================================================================
--- Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/questionnaire.py	                        (rev 0)
+++ Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/questionnaire.py	2007-07-07 11:29:42 UTC (rev 77564)
@@ -0,0 +1,177 @@
+__docformat__ = "reStructuredText"
+import zope.interface
+import zope.schema
+from zope.schema import fieldproperty
+from zope.traversing.browser import absoluteURL
+from zope.app.folder.interfaces import IFolder
+from zope.viewlet.viewlet import CSSViewlet
+
+from z3c.form import button, field, form, group, widget
+from z3c.form.interfaces import IAddForm
+from z3c.formdemo.message.interfaces import IHelloWorld
+from z3c.formdemo.questionnaire.interfaces import IQuestionnaire
+from z3c.formdemo.browser import formatter
+from z3c.formui import layout
+
+from zc.table import column
+
+import grok
+
+import mars.view
+import mars.template
+import mars.layer
+import mars.adapter
+import mars.resource
+from mars.formdemo.layer import IDemoBrowserLayer
+from mars.formdemo.skin import skin
+
+mars.layer.layer(IDemoBrowserLayer)
+
+
+class Questionnaire(grok.Model):
+    zope.interface.implements(IQuestionnaire)
+
+    name = fieldproperty.FieldProperty(IQuestionnaire['name'])
+    age = fieldproperty.FieldProperty(IQuestionnaire['age'])
+    zope2 = fieldproperty.FieldProperty(IQuestionnaire['zope2'])
+    plone = fieldproperty.FieldProperty(IQuestionnaire['plone'])
+    zope3 = fieldproperty.FieldProperty(IQuestionnaire['zope3'])
+    five = fieldproperty.FieldProperty(IQuestionnaire['five'])
+    contributor = fieldproperty.FieldProperty(IQuestionnaire['contributor'])
+    years = fieldproperty.FieldProperty(IQuestionnaire['years'])
+    zopeId = fieldproperty.FieldProperty(IQuestionnaire['zopeId'])
+
+    def __init__(self, **kw):
+        for name, value in kw.items():
+            setattr(self, name, value)
+
+# Groups
+class IQuestionnaireGroup(zope.interface.Interface):
+    """Questionnaire Group"""
+
+class IQuestionnairePage(zope.interface.Interface):
+    """Questionnaire Page"""
+
+class DevelopmentExperienceGroup(group.Group):
+    zope.interface.implements(IQuestionnaireGroup)
+    label = u'Development Experience'
+    fields = field.Fields(IQuestionnaire).select(
+        'zope2', 'plone', 'zope3', 'five')
+
+
+class ContributorExperienceGroup(group.Group):
+    zope.interface.implements(IQuestionnaireGroup)
+    label = u'Contributor Experience'
+    fields = field.Fields(IQuestionnaire).select(
+        'contributor', 'years', 'zopeId')
+
+
+class QuestionnaireAddForm(mars.view.FormView, layout.AddFormLayoutSupport,
+                          group.GroupForm, form.AddForm):
+    grok.name('addQuestionnaire')
+    grok.context(IFolder)
+    zope.interface.implements(IQuestionnairePage)
+
+    label = u'Zope Developer Questionnaire'
+    fields = field.Fields(IQuestionnaire).select('name', 'age')
+    groups = (DevelopmentExperienceGroup, ContributorExperienceGroup)
+
+    def create(self, data):
+        return Questionnaire(**data)
+
+    def add(self, object):
+        count = 0
+        while 'questionnaire-%i' %count in self.context:
+            count += 1;
+        self._name = 'questionnaire-%i' %count
+        self.context[self._name] = object
+        return object
+
+    def nextURL(self):
+        url = absoluteURL(self.context, self.request)
+        return url + '/questionnaireResults'
+
+
+class DataColumn(column.SortingColumn):
+
+    def __init__(self, field):
+        super(DataColumn, self).__init__(field.title, field.__name__)
+
+    def renderCell(self, item, formatter):
+        return item.widgets[self.name].render()
+
+    def getSortKey(self, item, formatter):
+        return item.widgets[self.name].value
+
+
+class QuestionnaireRow(form.DisplayForm):
+    fields = field.Fields(IQuestionnaire)
+
+
+class QuestionnaireResults(mars.view.PageletView):
+    grok.name('questionnaireResults')
+    grok.context(IFolder)
+    zope.interface.implements(IQuestionnairePage)
+
+    rowFields = field.Fields(IQuestionnaire)
+
+    def getContent(self):
+        return [obj for obj in self.context.values()
+                if IQuestionnaire.providedBy(obj)]
+
+    def update(self):
+        super(QuestionnaireResults, self).update()
+
+        rows = []
+        for questionnaire in self.getContent():
+            row = QuestionnaireRow(questionnaire, self.request)
+            row.update()
+            rows.append(row)
+
+        columns = [DataColumn(field.field)
+                   for field in self.rowFields.values()]
+
+        self.table = formatter.ListFormatter(
+            self.context, self.request, rows,
+            prefix = 'formdemo.questionnaire.', columns=columns,
+            sort_on=[('name', False)])
+        self.table.widths = (160, 45, 65, 55, 65, 50, 70, 55, 100)
+        for col in ('age', 'zope2', 'plone', 'zope3', 'five',
+                    'contributor', 'years', 'zopeId'):
+            self.table.columnCSS[col] = 'right'
+        self.table.sortKey = 'formdemo.questionnaire.sort-on'
+
+class ResultsTemplate(mars.template.TemplateFactory):
+    grok.context(QuestionnaireResults)
+    grok.template('results.pt')
+
+## CSS requirement
+class QuestionnaireStyle(mars.resource.ResourceFactory):
+    """File resource"""
+    grok.name('questionnaire.css')
+    mars.resource.file('questionnaire.css')
+
+QuestionnaireCSSViewlet = CSSViewlet('questionnaire.css')
+class FormQuestionnaireSSViewlet(mars.viewlet.SimpleViewlet, QuestionnaireCSSViewlet):
+    """css viewlet"""
+    grok.name('questionnaire.css')
+    grok.context(zope.interface.Interface)
+    mars.viewlet.view(IQuestionnairePage)
+    mars.viewlet.manager(skin.CSSManager)
+
+
+## Form labels
+class SubmitLabel(mars.adapter.AdapterFactory):
+    grok.name('title')
+    mars.adapter.factory(button.StaticButtonActionAttribute(
+        u'Submit Questionnaire', button=form.AddForm.buttons['add'],
+        form=QuestionnaireAddForm))
+
+def getDescriptionAsLabel(value):
+    return value.field.description
+
+class QuestionLabel(mars.adapter.AdapterFactory):
+    grok.name('label')
+    mars.adapter.factory(widget.ComputedWidgetAttribute(
+        getDescriptionAsLabel, view=IQuestionnaireGroup))
+


Property changes on: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/questionnaire.py
___________________________________________________________________
Name: svn:keywords
   + Id

Added: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/results.pt
===================================================================
--- Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/results.pt	                        (rev 0)
+++ Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/questionnaire/results.pt	2007-07-07 11:29:42 UTC (rev 77564)
@@ -0,0 +1,8 @@
+<h1>Zope Developer Questionnaire Results</h1>
+
+<div tal:replace="structure view/table" />
+
+<div class="actions">
+  <a href="addQuestionnaire">[Fill out Questionnaire]</a>
+</div>
+

Modified: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/skin/skin.py
===================================================================
--- Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/skin/skin.py	2007-07-07 11:27:59 UTC (rev 77563)
+++ Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/skin/skin.py	2007-07-07 11:29:42 UTC (rev 77564)
@@ -25,35 +25,39 @@
 
 mars.layer.layer(IDemoBrowserLayer)
 
-# main template for pages (note the context!)
 class Template(mars.template.LayoutFactory):
+    """main template for pages (note the context!)"""
     grok.context(IBrowserPage)
     grok.template('template.pt')
 
-# css viewletmanager
-class CSS(mars.viewlet.ViewletManager):
+class CSSManager(mars.viewlet.ViewletManager):
+    """css viewletmanager"""
     zope.interface.implements(z3c.formui.interfaces.ICSS)
     grok.name('ICSS')
     grok.context(zope.interface.Interface)
 
-# javascript viewletmanager
 class JavaScript(mars.viewlet.ViewletManager):
+    """javascript viewletmanager"""
     grok.name('IJavaScript')
     grok.context(zope.interface.Interface)
 
-# css viewlet
 DemoCSSViewlet = CSSViewlet('demo.css')
 class FormDemoCSSViewlet(mars.viewlet.SimpleViewlet, DemoCSSViewlet):
+    """css viewlet"""
     grok.name('demo.css')
     grok.context(zope.interface.Interface)
-    mars.viewlet.manager(CSS)
+    mars.viewlet.manager(CSSManager)
 
-
-# resources (++resource++demo.css)
 class DemoStyle(mars.resource.ResourceFactory):
+    """resources (++resource++demo.css)"""
     grok.name('demo.css')
     mars.resource.file('demo.css')
 
-# image resource directory (++resource++images)
-class Images(mars.resource.ResourceDirectoryFactory):
+class Img(mars.resource.ResourceDirectoryFactory):
+    """image resource directory (++resource++img)"""
+    mars.resource.directory('img')
+
+class SpreadSheetImages(mars.resource.ResourceDirectoryFactory):
+    """image resource directory (++resource++SpreadsheetImages)"""
+    grok.name('SpreadsheetImages')
     mars.resource.directory('images')

Modified: Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/tests.py
===================================================================
--- Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/tests.py	2007-07-07 11:27:59 UTC (rev 77563)
+++ Sandbox/darrylcousins/mars.formdemo/src/mars/formdemo/tests.py	2007-07-07 11:29:42 UTC (rev 77564)
@@ -10,6 +10,7 @@
 def test_suite():
     suites = []
     for docpath in (('message', 'README.txt'),
+                    ('questionnaire', 'README.txt'),
                     ):
         suite = functional.FunctionalDocFileSuite(
             os.path.join(*docpath),



More information about the Checkins mailing list