Skip to content

Commit

Permalink
inherited annotation tooltips fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-TBT committed Dec 7, 2023
1 parent ccfeb75 commit 3e38491
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@

<span class="tooltip_html" style='display:none'>
<% if (isInherited) { %>
<% if (ann.childNames.length > 1){ %>
You are viewing annotations inherited by <b><%- ann.childNames.length %></b> <%- ann.childClass %>s
<% if (ann.childNames.length > 1) { %>
You are viewing an annotation inherited by <b><%- ann.childNames.length %></b> <%- ann.childClass %>s<br />
<% } else { %>
You are viewing an inherited annotation<br />
<% } %>
<% } %>
<!-- ann.parentNames is a property of grouped annotations -->
<% if (ann.parentNames) { %>
You are
<% print (ann.permissions.canEdit && clientMapAnn ? 'editing' : 'viewing') %>
<b><%- ann.parentNames.length %></b> identical Key-Value annotations:
<% } %>
<% if (!ann.parentNames && ann.link) { %>
<b><%- ann.parentNames.length %></b> identical Key-Value annotations:<br />
<% } else if (ann.link) { %>
<!-- If single object show e.g. Image ID: (slice ImageI -> Image) -->
<b><%- ann.link.parent.class.slice(0, ann.link.parent.class.length-1) %>
ID:</b> <%- ann.link.parent.id %><br />
Expand All @@ -59,22 +61,20 @@
<% }) %>
<% } %>
<% if (ann.owner) { %>
<b>Owner:</b> <%- ann.owner.firstName %> <%- ann.owner.lastName %>
<b>Owner:</b> <%- ann.owner.firstName %> <%- ann.owner.lastName %><br />
<% } %>
<% if (ann.link) { %>
<br /><b>Linked by:</b> <%- ann.link.owner.firstName %> <%- ann.link.owner.lastName %>
<b>Linked by:</b> <%- ann.link.owner.firstName %> <%- ann.link.owner.lastName %><br />
<% if (ann.link.date) { %>
<br /><b>On:</b> <% print(OME.formatDate(ann.link.date)) %>
<b>On:</b> <% print(OME.formatDate(ann.link.date)) %><br />
<% } %>
<% } %>
<% if (isInherited) { %>
<% if (ann.childNames.length > 1) { %>
<br /><b>Inherited by:</b>
<b>Inherited by:</b><br />
<% _.each(ann.childNames, function(cname) { %>
<br />&nbsp <%- cname %>
&nbsp <%- cname %><br />
<% }) %>
<% } %>
<br /><b>Namespace:</b> <%- ann.ns.slice(0, 50) %><br />
<b>Namespace:</b> <%- ann.ns.slice(0, 50) %><br />
<% } %>
</span>
<% } else if (objCount && objCount > 1) { %>
Expand Down
9 changes: 7 additions & 2 deletions omeroweb/webclient/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -2141,8 +2141,13 @@ def parse_hql_id(hql_ids):
if len(requested[obj_type]) > 0:
for o in conn.getObjects(obj_type[:-1], requested[obj_type]):
details = {"id": o.getId(), "class": obj_type}
if obj_type not in ["PlateAcquisitionI", "WellI"]:
details["name"] = o.getName()
if obj_type == "WellI":
name = o.getWellPos()
else:
name = o.getName()
if (obj_type == "PlateAcquisitionI" and name is None):
name = f"Run {o.getId()}"
details["name"] = name
child_ref_d[obj_type][details["id"]] = details

service_opts = conn.SERVICE_OPTS.copy()
Expand Down

0 comments on commit 3e38491

Please sign in to comment.