some code clean-up; show description as td title
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3050 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
3582e85bb4
commit
23b6355386
3 changed files with 37 additions and 18 deletions
|
@ -166,8 +166,9 @@ Recent changes
|
|||
|
||||
>>> data[0].timeStamp
|
||||
u'... ...:...'
|
||||
>>> data[0].object
|
||||
{'url': '', 'object': <loops.resource.Resource ...>, 'title': 'Change Doc 001'}
|
||||
>>> data[0].objectData
|
||||
{'url': '', 'version': '', 'object': <loops.resource.Resource ...>,
|
||||
'title': 'Change Doc 001'}
|
||||
>>> data[0].user
|
||||
{'url': '', 'object': <loops.concept.Concept ...>, 'title': u'john'}
|
||||
>>> data[0].action
|
||||
|
|
|
@ -35,23 +35,36 @@
|
|||
<table class="listing">
|
||||
<tr>
|
||||
<th i18n:translate="">Title</th>
|
||||
<th i18n:translate=""
|
||||
tal:condition="view/useVersioning">V</th>
|
||||
<th i18n:translate="">User</th>
|
||||
<th i18n:translate="">Date/Time</th>
|
||||
<th i18n:translate="">New</th>
|
||||
</tr>
|
||||
<tr tal:repeat="row info/data"
|
||||
tal:attributes="class python: repeat['row'].odd() and 'even' or 'odd'">
|
||||
<td tal:define="url row/object/url">
|
||||
<a tal:attributes="href url"
|
||||
tal:omit-tag="not:url"
|
||||
tal:content="row/object/title" /></td>
|
||||
<td tal:define="url row/user/url">
|
||||
<a tal:attributes="href url"
|
||||
tal:omit-tag="not:url"
|
||||
tal:content="row/user/title" /></td>
|
||||
<td tal:content="row/timeStamp"></td>
|
||||
<td class="center"
|
||||
tal:content="row/markNew"></td>
|
||||
<tal:row define="object row/objectData;
|
||||
url object/url">
|
||||
<td tal:attributes="title object/object/description">
|
||||
<a tal:omit-tag="not:url"
|
||||
tal:attributes="href string:$url?version=this"
|
||||
tal:content="object/title" /></td>
|
||||
<tal:version tal:condition="view/useVersioning">
|
||||
<td class="center"
|
||||
tal:define="version object/version">
|
||||
<a tal:omit-tag="python: version == '1.1'"
|
||||
tal:attributes="href string:$url?loops.viewName=listversions"
|
||||
tal:content="version">1.1</a>
|
||||
</td>
|
||||
</tal:version>
|
||||
<td tal:define="url row/user/url">
|
||||
<a tal:attributes="href url"
|
||||
tal:omit-tag="not:url"
|
||||
tal:content="row/user/title" /></td>
|
||||
<td tal:content="row/timeStamp"></td>
|
||||
<td class="center"
|
||||
tal:content="row/markNew"></td>
|
||||
</tal:row>
|
||||
</tr>
|
||||
</table>
|
||||
</metal:recent>
|
||||
|
|
|
@ -36,6 +36,7 @@ from loops.browser.common import BaseView
|
|||
from loops.interfaces import IResource
|
||||
from loops import util
|
||||
from loops.util import _
|
||||
from loops.versioning.interfaces import IVersionable
|
||||
|
||||
|
||||
report_macros = ViewPageTemplateFile('report.pt')
|
||||
|
@ -142,7 +143,7 @@ class RecentChanges(TrackingStats):
|
|||
if track.data['action'] == 'add' and track.taskId not in new:
|
||||
sameChanged = changed.get(track.taskId)
|
||||
if sameChanged and sameChanged.timeStamp < track.timeStamp + 60:
|
||||
# change immediate after creation
|
||||
# skip change immediate after creation
|
||||
if result[-1].taskId == track.taskId:
|
||||
result.pop()
|
||||
new[track.taskId] = track
|
||||
|
@ -170,12 +171,16 @@ class TrackDetails(object):
|
|||
|
||||
@Lazy
|
||||
def object(self):
|
||||
obj = util.getObjectForUid(self.track.taskId)
|
||||
return util.getObjectForUid(self.track.taskId)
|
||||
|
||||
@Lazy
|
||||
def objectData(self):
|
||||
obj = self.object
|
||||
node = self.view.nodeView
|
||||
url = node is not None and node.getUrlForTarget(obj) or ''
|
||||
if url:
|
||||
url = url + '?version=this'
|
||||
return dict(object=obj, title=obj.title, url=url)
|
||||
versionable = IVersionable(self.object, None)
|
||||
version = versionable is not None and versionable.versionId or ''
|
||||
return dict(object=obj, title=obj.title, url=url, version=version)
|
||||
|
||||
@Lazy
|
||||
def user(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue