provide view for single tracks
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3051 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
7b44820479
commit
bef6db8f1d
3 changed files with 48 additions and 6 deletions
|
@ -33,20 +33,21 @@ from cybertools.container.base import ContainerView, contents_template
|
|||
from cybertools.tracking.btree import timeStamp2ISO
|
||||
|
||||
|
||||
tracking_template = ViewPageTemplateFile('tracking.pt')
|
||||
tracks_template = ViewPageTemplateFile('tracks.pt')
|
||||
track_template = ViewPageTemplateFile('track.pt')
|
||||
|
||||
|
||||
class TrackingStorageView(ContainerView):
|
||||
|
||||
contents_template = contents_template
|
||||
template = tracking_template
|
||||
template = tracks_template
|
||||
|
||||
def __call__(self):
|
||||
return self.template()
|
||||
|
||||
def getTracks(self):
|
||||
for tr in reversed(removeSecurityProxy(self.context.values())):
|
||||
view = component.queryMultiAdapter((tr, self.request))
|
||||
view = component.queryMultiAdapter((tr, self.request), name='index.html')
|
||||
if view:
|
||||
yield view
|
||||
else:
|
||||
|
@ -55,10 +56,15 @@ class TrackingStorageView(ContainerView):
|
|||
|
||||
class TrackView(object):
|
||||
|
||||
template = track_template
|
||||
|
||||
def __init__(self, context, request):
|
||||
self.context = context
|
||||
self.request = request
|
||||
|
||||
def __call__(self):
|
||||
return self.template()
|
||||
|
||||
@Lazy
|
||||
def id(self):
|
||||
return getName(self.context)
|
||||
|
|
36
tracking/track.pt
Normal file
36
tracking/track.pt
Normal file
|
@ -0,0 +1,36 @@
|
|||
<html metal:use-macro="context/@@standard_macros/view"
|
||||
i18n:domain="zope">
|
||||
<body>
|
||||
|
||||
|
||||
<div metal:fill-slot="body">
|
||||
<h1>Track Details for <span tal:content="view/id" /></h1>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Task:</td>
|
||||
<td><a tal:omit-tag="not:view/taskUrl"
|
||||
tal:attributes="href view/taskUrl"
|
||||
tal:content="view/taskTitle" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Run:</td>
|
||||
<td tal:content="view/run"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>User:</td>
|
||||
<td><a tal:omit-tag="not:view/userUrl"
|
||||
tal:attributes="href view/userUrl"
|
||||
tal:content="view/userTitle" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Timestamp:</td>
|
||||
<td tal:content="view/timeStamp"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Data</h2>
|
||||
<div tal:content="context/data" />
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,5 +1,5 @@
|
|||
<html metal:use-macro="context/@@standard_macros/view"
|
||||
i18n:domain="zope">
|
||||
i18n:domain="zope">
|
||||
<body>
|
||||
|
||||
|
||||
|
@ -66,10 +66,10 @@
|
|||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Reference in a new issue