[Zope-CVS] CVS: Packages/JobBoardEx/Views/Browser - JobListView.py:1.1 summary.pt:1.1

Jeremy Hylton jeremy@zope.com
Wed, 20 Mar 2002 14:26:36 -0500


Update of /cvs-repository/Packages/JobBoardEx/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv20421/Views/Browser

Added Files:
	JobListView.py summary.pt 
Log Message:
Move the summary view into Views/Browser.

Use a nifty ENTITY to make the .zcml shorter.




=== Added File Packages/JobBoardEx/Views/Browser/JobListView.py ===
from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
from Zope.PageTemplate import PageTemplateFile

from ZopeProducts.JobBoardEx.IJobList import IJobList
from ZopeProducts.JobBoardEx.IJob import JobState

class JobListSummaryView(AttributePublisher):

    def __init__(self, joblist):
        self.joblist = joblist

    def getContext(self):
        return self.joblist

    __used_for__ = IJobList

    def getApprovedJobs(self):
        return self.joblist.query(JobState.Approved)

    index = PageTemplateFile("summary.pt", globals())


=== Added File Packages/JobBoardEx/Views/Browser/summary.pt ===
<HTML>
<TITLE>Job Board</TITLE>
<h1>Job Board</h1>

<A href="NewJob.html">Submit a new job</A>

<H2>Job Listings</H2>

<table>

<tr tal:repeat="job container/getApprovedJobs">
<td>
<a href="jobid" tal:attributes="href string:${job/id}">
<span tal:replace="job/summary">A job summary</span></A>
</td>
</tr>

</table>
</HTML>