some fixes for presentation of comments; use 'authors' attribute of adapted object (if present) for 'creators' instead of DC info
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3057 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
252ae21bbc
commit
1e5a79e8cd
4 changed files with 21 additions and 18 deletions
|
@ -203,15 +203,17 @@ class BaseView(GenericView, I18NView):
|
|||
|
||||
@Lazy
|
||||
def creators(self):
|
||||
cr = IZopeDublinCore(self.context).creators or []
|
||||
pau = component.getUtility(IAuthentication)
|
||||
creators = []
|
||||
for c in cr:
|
||||
try:
|
||||
principal = pau.getPrincipal(c)
|
||||
creators.append(principal.title)
|
||||
except PrincipalLookupError:
|
||||
creators.append(c)
|
||||
# TODO: use an IAuthorInfo (or similar) adapter
|
||||
creators = getattr(self.adapted, 'authors', None) or []
|
||||
if not creators:
|
||||
cr = IZopeDublinCore(self.context).creators or []
|
||||
pau = component.getUtility(IAuthentication)
|
||||
for c in cr:
|
||||
try:
|
||||
principal = pau.getPrincipal(c)
|
||||
creators.append(principal.title)
|
||||
except PrincipalLookupError:
|
||||
creators.append(c)
|
||||
return ', '.join(creators)
|
||||
|
||||
@Lazy
|
||||
|
@ -581,6 +583,7 @@ class BaseView(GenericView, I18NView):
|
|||
'dojo.require("dijit.form.TimeTextBox"); '
|
||||
'dojo.require("dijit.form.SimpleTextarea"); '
|
||||
'dojo.require("dijit.form.FilteringSelect"); '
|
||||
#'dojo.require("dijit.layout.TabContainer"); '
|
||||
'dojo.require("dojox.grid.DataGrid"); '
|
||||
'dojo.require("dojo.data.ItemFileWriteStore"); '
|
||||
'dojo.require("dojox.data.QueryReadStore"); ')
|
||||
|
|
|
@ -188,7 +188,7 @@
|
|||
<metal:actions define-macro="object_actions">
|
||||
<div style="float: right;" class="object-actions"
|
||||
tal:define="target nocall:target|nothing;"
|
||||
tal:attributes="style style|string:float: right">
|
||||
tal:attributes="style style|string:float: right;; margin-top: 0.4em">
|
||||
<tal:actions repeat="action python:view.getActions('object', target=target)">
|
||||
<metal:action use-macro="action/macro" />
|
||||
</tal:actions>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<metal:block define-macro="render">
|
||||
<div tal:attributes="ondblclick python: item.openEditWindow('configure.html')">
|
||||
<tal:body define="itemNum view/itemNum;
|
||||
id string:$itemNum.body;">
|
||||
<div metal:define-macro="render_base"
|
||||
tal:define="itemNum view/itemNum;
|
||||
id string:$itemNum.body;"
|
||||
tal:attributes="ondblclick python: item.openEditWindow('configure.html')">
|
||||
<tal:actions condition="view/showObjectActions">
|
||||
<div metal:use-macro="views/node_macros/object_actions" />
|
||||
</tal:actions>
|
||||
|
@ -14,15 +15,14 @@
|
|||
tal:content="structure item/render">
|
||||
The body
|
||||
</div>
|
||||
</tal:body>
|
||||
</div>
|
||||
<metal:fields use-macro="view/comment_macros/comments" />
|
||||
</div>
|
||||
</metal:block>
|
||||
|
||||
|
||||
<metal:block define-macro="render_note">
|
||||
<metal:block tal:define="description nothing">
|
||||
<metal:render use-macro="item/template/macros/render" />
|
||||
<metal:render use-macro="item/template/macros/render_base" />
|
||||
</metal:block>
|
||||
<div class="content-1" id="1.link"
|
||||
tal:define="linkUrl item/linkUrl"
|
||||
|
|
|
@ -55,7 +55,7 @@ class CommentsView(NodeView):
|
|||
|
||||
@Lazy
|
||||
def addUrl(self):
|
||||
return '%s/create_comment.html' % self.nodeView.getUrlForTarget(self.context)
|
||||
return '%s/create_comment.html' % self.getUrlForTarget(self.context)
|
||||
|
||||
@Lazy
|
||||
def addOnClick(self):
|
||||
|
@ -69,7 +69,7 @@ class CommentsView(NodeView):
|
|||
target = self.virtualTargetObject
|
||||
if None in (ts, target):
|
||||
return result
|
||||
for tr in reversed(list(ts.query(taskId=util.getUidForObject(target)))):
|
||||
for tr in ts.query(taskId=util.getUidForObject(target)):
|
||||
result.append(CommentDetails(self, tr))
|
||||
return result
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue