From 95bfb345327d8ce9bcb1f87e30e5854a3424f608 Mon Sep 17 00:00:00 2001 From: William Moore Date: Fri, 22 Jul 2022 12:00:26 +0100 Subject: [PATCH 1/4] Add Fileset.id to original_file_paths JSON --- omeroweb/webgateway/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/omeroweb/webgateway/views.py b/omeroweb/webgateway/views.py index 771d971538..7e5b1db63b 100644 --- a/omeroweb/webgateway/views.py +++ b/omeroweb/webgateway/views.py @@ -2686,7 +2686,12 @@ def original_file_paths(request, iid, conn=None, **kwargs): if image is None: raise Http404 paths = image.getImportedImageFilePaths() - return {"repo": paths["server_paths"], "client": paths["client_paths"]} + fileset_id = image.fileset.id.val + return { + "repo": paths["server_paths"], + "client": paths["client_paths"], + "fileset": {"id": fileset_id} + } @login_required() From cf814d0c9bed61799a1d23be894d6942a1704d32 Mon Sep 17 00:00:00 2001 From: William Moore Date: Fri, 22 Jul 2022 12:01:14 +0100 Subject: [PATCH 2/4] Show Fileset ID in 'file paths' panel --- .../templates/webclient/annotations/includes/toolbar.html | 2 +- .../templates/webclient/annotations/metadata_general.html | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/omeroweb/webclient/templates/webclient/annotations/includes/toolbar.html b/omeroweb/webclient/templates/webclient/annotations/includes/toolbar.html index a120d8a22b..87c2ec7616 100644 --- a/omeroweb/webclient/templates/webclient/annotations/includes/toolbar.html +++ b/omeroweb/webclient/templates/webclient/annotations/includes/toolbar.html @@ -355,7 +355,7 @@ {% if not share %} {% if image.showOriginalFilePaths %} - {% endif %} diff --git a/omeroweb/webclient/templates/webclient/annotations/metadata_general.html b/omeroweb/webclient/templates/webclient/annotations/metadata_general.html index c997131222..477ad94350 100644 --- a/omeroweb/webclient/templates/webclient/annotations/metadata_general.html +++ b/omeroweb/webclient/templates/webclient/annotations/metadata_general.html @@ -149,7 +149,8 @@ var repo = data.repo, client = data.client, html = ""; - $panel_title.html(repo.length + " Image file" + (repo.length>1 ? "s:" : ":")); + let title = `Fileset ID: ${data.fileset.id} contains ${repo.length} Image file${ repo.length>1 ? "s" : ""}:` + $panel_title.html(title); if (importTransfer) { html += "

Imported with --transfer="+ importTransfer; From 767faa08dad1f5234aae27bb1d28fc04d22db3bb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 22 Jul 2022 11:06:53 +0000 Subject: [PATCH 3/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- omeroweb/webgateway/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omeroweb/webgateway/views.py b/omeroweb/webgateway/views.py index 7e5b1db63b..c9bd449895 100644 --- a/omeroweb/webgateway/views.py +++ b/omeroweb/webgateway/views.py @@ -2690,7 +2690,7 @@ def original_file_paths(request, iid, conn=None, **kwargs): return { "repo": paths["server_paths"], "client": paths["client_paths"], - "fileset": {"id": fileset_id} + "fileset": {"id": fileset_id}, } From b757d16fa301c5f0c117dd4c2c2afdd1293864d0 Mon Sep 17 00:00:00 2001 From: William Moore Date: Tue, 2 Aug 2022 13:58:07 +0100 Subject: [PATCH 4/4] Re-format fileset info --- .../webclient/annotations/metadata_general.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/omeroweb/webclient/templates/webclient/annotations/metadata_general.html b/omeroweb/webclient/templates/webclient/annotations/metadata_general.html index 477ad94350..2329d61954 100644 --- a/omeroweb/webclient/templates/webclient/annotations/metadata_general.html +++ b/omeroweb/webclient/templates/webclient/annotations/metadata_general.html @@ -149,12 +149,14 @@ var repo = data.repo, client = data.client, html = ""; - let title = `Fileset ID: ${data.fileset.id} contains ${repo.length} Image file${ repo.length>1 ? "s" : ""}:` - $panel_title.html(title); + $panel_title.html("Fileset Info"); + + html += `

Fileset ID: ${data.fileset.id}

` + + html += `

File count: ${repo.length}

` if (importTransfer) { - html += "

Imported with --transfer="+ importTransfer; - html += "


"; + html += "

Imported with: --transfer="+ importTransfer + "

"; } html += "

Imported from:

";