children and resources listings: show predicate in item description tooltip only if not default predicate
This commit is contained in:
parent
233ece8dfd
commit
8b4be98993
2 changed files with 12 additions and 12 deletions
|
@ -196,6 +196,12 @@ class BaseRelationView(BaseView):
|
||||||
return u''
|
return u''
|
||||||
return self.predicateTitle
|
return self.predicateTitle
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
def relationInfo(self):
|
||||||
|
predInfo = ', ' .join(p.title for p in self.predicates
|
||||||
|
if p != self.defaultPredicate)
|
||||||
|
return ' | '.join(t for t in (self.description, predInfo) if t)
|
||||||
|
|
||||||
|
|
||||||
class ConceptView(BaseView):
|
class ConceptView(BaseView):
|
||||||
|
|
||||||
|
|
|
@ -159,11 +159,8 @@
|
||||||
tal:attributes="dojoType python:
|
tal:attributes="dojoType python:
|
||||||
item.editable and 'dojo.dnd.Source' or ''">
|
item.editable and 'dojo.dnd.Source' or ''">
|
||||||
<tal:items repeat="related children">
|
<tal:items repeat="related children">
|
||||||
<tal:item define="class python: repeat['related'].odd() and 'even' or 'odd';
|
<tal:item define="class python:
|
||||||
description related/description;
|
repeat['related'].odd() and 'even' or 'odd';">
|
||||||
predicate related/predicateTitle;
|
|
||||||
info python: ' | '.join(
|
|
||||||
t for t in (description, predicate) if t)">
|
|
||||||
<tr tal:attributes="class string:$class dojoDndItem dojoDndHandle;
|
<tr tal:attributes="class string:$class dojoDndItem dojoDndHandle;
|
||||||
id related/uniqueId">
|
id related/uniqueId">
|
||||||
<td tal:condition="item/showCheckboxes|nothing"
|
<td tal:condition="item/showCheckboxes|nothing"
|
||||||
|
@ -173,7 +170,7 @@
|
||||||
tal:attributes="value uid;" /></td>
|
tal:attributes="value uid;" /></td>
|
||||||
<td valign="top">
|
<td valign="top">
|
||||||
<a tal:attributes="href python: view.getUrlForTarget(related);
|
<a tal:attributes="href python: view.getUrlForTarget(related);
|
||||||
title info">
|
title related/relationInfo">
|
||||||
<span tal:replace="related/title">Resource Title</span>
|
<span tal:replace="related/title">Resource Title</span>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -242,11 +239,8 @@
|
||||||
tal:attributes="dojoType python:
|
tal:attributes="dojoType python:
|
||||||
item.editable and 'dojo.dnd.Source' or ''">
|
item.editable and 'dojo.dnd.Source' or ''">
|
||||||
<tal:items repeat="related resources">
|
<tal:items repeat="related resources">
|
||||||
<tal:item define="class python: repeat['related'].odd() and 'even' or 'odd';
|
<tal:item define="class python:
|
||||||
description related/description;
|
repeat['related'].odd() and 'even' or 'odd';">
|
||||||
predicate related/predicateTitle;
|
|
||||||
info python: ' | '.join(
|
|
||||||
t for t in (description, predicate) if t)">
|
|
||||||
<tr tal:attributes="class string:$class dojoDndItem dojoDndHandle;
|
<tr tal:attributes="class string:$class dojoDndItem dojoDndHandle;
|
||||||
id related/uniqueId">
|
id related/uniqueId">
|
||||||
<td tal:condition="item/showCheckboxes|nothing"
|
<td tal:condition="item/showCheckboxes|nothing"
|
||||||
|
@ -263,7 +257,7 @@
|
||||||
<img tal:attributes="src icon/src" />
|
<img tal:attributes="src icon/src" />
|
||||||
</a>
|
</a>
|
||||||
<a tal:attributes="href python: view.getUrlForTarget(related);
|
<a tal:attributes="href python: view.getUrlForTarget(related);
|
||||||
title info">
|
title related/relationInfo">
|
||||||
<div tal:content="related/title">Resource Title</div>
|
<div tal:content="related/title">Resource Title</div>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
|
Loading…
Add table
Reference in a new issue