[Zope-CVS] CVS: Packages/JobBoardEx/Views/Browser - EndUserJobDisplay.pt:1.1 JobView.pt:1.1 JobView.py:1.1 browser.zcml:1.1
Barry Warsaw
barry@wooz.org
Wed, 20 Mar 2002 14:18:05 -0500
Update of /cvs-repository/Packages/JobBoardEx/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv17901/Views/Browser
Added Files:
EndUserJobDisplay.pt JobView.pt JobView.py browser.zcml
Log Message:
New zcml control files, new views for job preview/end user display,
etc.
=== Added File Packages/JobBoardEx/Views/Browser/EndUserJobDisplay.pt ===
<html>
<body>
<form action="." method="post">
<div tal:replace="structure container/getJobView" />
<table border=0>
<tr><td>
<input name="back:method" type="submit" value="Back to summary">
</td></tr>
</table>
</form>
</body>
</html>
=== Added File Packages/JobBoardEx/Views/Browser/JobView.pt ===
<table border=0>
<tr><td>Submitter:</td>
<td tal:content="container/getSubmitter">aperson@dom.ain</td>
</tr>
<tr><td>Summary:</td>
<td tal:content="container/getSummary">The best job on the Internet</td>
</tr>
<tr><td>Description:</td>
<td tal:content="container/getDescription">This is really really
really the best job on the Internet</td>
</tr>
<tr><td>Contact:</td>
<td tal:content="container/getContact">bperson@dom.ain</td>
</tr>
</table>
=== Added File Packages/JobBoardEx/Views/Browser/JobView.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
"""
Revision information: $Id: JobView.py,v 1.1 2002/03/20 19:18:04 bwarsaw Exp $
"""
import os
from Zope.PageTemplate.PageTemplateFile import PageTemplateFile
from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
from Zope.ComponentArchitecture.ContextDependent import ContextDependent
class JobView(AttributePublisher, ContextDependent):
index = PageTemplateFile('EndUserJobDisplay.pt')
simpleView = PageTemplateFile('JobView.pt')
def back(self, REQUEST):
# This gets us back to the job summary view (i.e. JobListView)
return REQUEST.response('../')
# Add accessor methods so the security framework can do assertion. The
# page template can't use the attributes on the Job object directly. :(
def getSubmitter(self):
return self.getContext().submitter
def getSummary(self):
return self.getContext().summary
def getDescription(self):
return self.getContext().description
def getContact(self):
return self.getContext().contact
=== Added File Packages/JobBoardEx/Views/Browser/browser.zcml ===
<zopeConfigure
xmlns='http://namespaces.zope.org/zope'
xmlns:security='http://namespaces.zope.org/security'
xmlns:browser='http://namespaces.zope.org/browser'
>
<security:protectClass name=".JobBoardEx.View.Browser.ApproveJobs."
permission_id="Zope.View"
methods="index, cancel, submit"
/>
<browser:defaultView for=".JobBoardEx.IJobList."
name="summary"
factory=".JobBoardEx.Views.Browser.JobListView." />
<security:protectClass name=".JobBoardEx.View.Browser.JobView."
permission_id="Zope.View"
methods="index, simpleView, back,
getSubmitter, getSummary, getDescriptor,
getContact"
/>
<browser:view for=".JobBoardEx.IJob."
name="JobView"
factory=".JobBoardEx.Views.Browser.JobView." />
<security:protectClass name=".JobBoardEx.View.Browser.NewJob."
permission_id="Zope.View"
methods="index, preview, waiting, getJobView,
cancel, home, submit"
/>
<browser:view for=".JobBoardEx.IJobList."
name="NewJob"
factory=".JobBoardEx.Views.Browser.NewJob." />
</zopeConfigure>