diff --git a/airlock/api.py b/airlock/api.py index f421cfc3..3167e0d3 100644 --- a/airlock/api.py +++ b/airlock/api.py @@ -170,6 +170,13 @@ def abspath(self, relpath): # be a destination to copy to. return path + def file_set(self): + return { + request_file.relpath + for filegroup in self.filegroups.values() + for request_file in filegroup.files + } + class ProviderAPI: class APIException(Exception): diff --git a/airlock/templates/file_browser/index.html b/airlock/templates/file_browser/index.html index 4933ea05..7d33b2b9 100644 --- a/airlock/templates/file_browser/index.html +++ b/airlock/templates/file_browser/index.html @@ -89,6 +89,8 @@ {% endif %} {% endif %} {% #button type="link" href=workspace.get_url variant="success" id="workspace-home-button" %}Workspace Home{% /button %} + {% elif current_request %} + {% #button variant="success" type="link" href=current_request.get_url id="current-request-button" %}Current release request{% /button %} {% endif %} {% endfragment %} @@ -161,6 +163,7 @@ {% else %} {% fragment as add_button %} {% if context == "workspace" %} + {% if form %} {% #button variant="success" type="button" tooltip="Add this file to the current request, starting a new one if needed" data-modal="addRequestFile" id="add-file-modal-button"%} Add File to Request {% /button %} @@ -178,6 +181,11 @@ {% /card %} {% /modal %} + {% else %} + {% #button type="button" disabled=True tooltip="This file has already been added to the current request" id="add-file-modal-button-disabled" %} + Add File to Request + {% /button %} + {% endif %} {% elif is_author %}