diff --git a/omeroweb/webclient/static/webclient/image/image_locked_slash16.png b/omeroweb/webclient/static/webclient/image/image_locked_slash16.png new file mode 100644 index 0000000000..83b03f2079 Binary files /dev/null and b/omeroweb/webclient/static/webclient/image/image_locked_slash16.png differ diff --git a/omeroweb/webclient/static/webclient/javascript/ome.tree.js b/omeroweb/webclient/static/webclient/javascript/ome.tree.js index deba57a0a8..9d84b2df4b 100644 --- a/omeroweb/webclient/static/webclient/javascript/ome.tree.js +++ b/omeroweb/webclient/static/webclient/javascript/ome.tree.js @@ -619,6 +619,9 @@ $(function() { rv.children = true; rv.type = value.set ? 'tagset' : 'tag'; rv.text = value.value; + } else if (type === 'image' && value.archived) { + rv.a_attr = {title: 'Image is archived'}; + rv.icon = WEBCLIENT.URLS.static_webclient + 'image/image_locked_slash16.png'; } return rv; } @@ -1347,4 +1350,4 @@ $(function() { } } }); -}); \ No newline at end of file +}); diff --git a/omeroweb/webclient/templates/webclient/annotations/includes/core_metadata.html b/omeroweb/webclient/templates/webclient/annotations/includes/core_metadata.html index 19f6cd73f0..16bd79fc4f 100644 --- a/omeroweb/webclient/templates/webclient/annotations/includes/core_metadata.html +++ b/omeroweb/webclient/templates/webclient/annotations/includes/core_metadata.html @@ -32,6 +32,12 @@ Import Date: + {% if image.archived %} + + Archived: + {{ image.archived }} + + {% endif %} Dimensions (XY): {{ image.getSizeX }} x {{ image.getSizeY }} diff --git a/omeroweb/webclient/tree.py b/omeroweb/webclient/tree.py index 2fa9107940..0faa9588ca 100644 --- a/omeroweb/webclient/tree.py +++ b/omeroweb/webclient/tree.py @@ -531,6 +531,7 @@ def _marshal_image( """Given an Image row (list) marshals it into a dictionary. Order and type of columns in row is: * id (rlong) + * archived (boolean) * name (rstring) * details.owner.id (rlong) * details.permissions (dict) @@ -549,9 +550,10 @@ def _marshal_image( @param row_pixels The Image row pixels data to marshal @type row_pixels L{list} """ - image_id, name, owner_id, permissions, fileset_id = row + image_id, archived, name, owner_id, permissions, fileset_id = row image = dict() image["id"] = unwrap(image_id) + image["archived"] = unwrap(archived) is True image["name"] = unwrap_to_str(name) image["ownerId"] = unwrap(owner_id) image["permsCss"] = parse_permissions_css(permissions, unwrap(owner_id), conn) @@ -670,6 +672,7 @@ def marshal_images( q = ( """ select new map(image.id as id, + image.archived as archived, image.name as name, image.details.owner.id as ownerId, image as image_details_permissions, @@ -753,12 +756,13 @@ def marshal_images( e = unwrap(e)[0] d = [ e["id"], + e["archived"], e["name"], e["ownerId"], e["image_details_permissions"], e["filesetId"], ] - kwargs = {"conn": conn, "row": d[0:5]} + kwargs = {"conn": conn, "row": d[0:6]} if load_pixels: d = [e["sizeX"], e["sizeY"], e["sizeZ"], e["sizeT"]] kwargs["row_pixels"] = d @@ -1514,6 +1518,7 @@ def marshal_tagged( q = """ select distinct new map(obj.id as id, + obj.archived as archived, obj.name as name, lower(obj.name) as lowername, obj.details.owner.id as ownerId, @@ -1534,6 +1539,7 @@ def marshal_tagged( e = unwrap(e) row = [ e[0]["id"], + e[0]["archived"], e[0]["name"], e[0]["ownerId"], e[0]["image_details_permissions"], diff --git a/omeroweb/webgateway/marshal.py b/omeroweb/webgateway/marshal.py index 65b32c3ec3..187ca9d0c6 100644 --- a/omeroweb/webgateway/marshal.py +++ b/omeroweb/webgateway/marshal.py @@ -145,6 +145,7 @@ def imageMarshal(image, key=None, request=None): "imageName": image.name or "", "imageDescription": image.description or "", "imageAuthor": image.getAuthor(), + "imageArchived": image.archived or False, "projectName": pr and pr.name or "Multiple", "projectId": pr and pr.id or None, "projectDescription": pr and pr.description or "",