diff --git a/airlock/templates/base.html b/airlock/templates/base.html index 3bbd11f9..abb151b1 100644 --- a/airlock/templates/base.html +++ b/airlock/templates/base.html @@ -33,117 +33,117 @@
-
- +
{% alerts messages=messages %} diff --git a/airlock/templates/file_browser/csv.html b/airlock/templates/file_browser/csv.html index 020a92a0..77acef44 100644 --- a/airlock/templates/file_browser/csv.html +++ b/airlock/templates/file_browser/csv.html @@ -5,17 +5,17 @@ {% for header in csv_data.headers %} - {{ header }} + {{ header }} {% endfor %} {% for row in csv_data.rows %} - - {% for cell in row %} - {{ cell }} - {% endfor %} - + + {% for cell in row %} + {{ cell }} + {% endfor %} + {% endfor %} diff --git a/airlock/templates/file_browser/index.html b/airlock/templates/file_browser/index.html index a5d23ffb..a33d7065 100644 --- a/airlock/templates/file_browser/index.html +++ b/airlock/templates/file_browser/index.html @@ -5,201 +5,201 @@ {% load django_htmx %} {% block extra_styles %} - + ul.tree { + list-style: none; + + details ul { + border-left: 1px dotted grey; + padding-left: 0.75rem; + margin-left: 0.5rem; + } + } + + + .tree summary { + cursor: pointer; + } + + .tree summary:has(>a.selected), .tree li:has(>a.selected) { + background-color: lightblue; + } + + .tree .selected { + font-weight: bold; + cursor: pointer; + } + + .tree .filegroup { + text-transform: uppercase; + } + + .tree summary:has(>a.filegroup) { + background-color: lightgrey; + } + + .tree a.dir { + background-image: url("{% static "folder.png" %}"); + background-repeat: no-repeat; + background-size: 1.4rem; + background-position: left 0 top 0; + padding-left: 1.3rem; + } + .tree summary { + padding-left: 0.25rem; + } + + + .content { + width:100%; + max-width: 100%; + height: 75vh; + overflow: scroll; + } + + .datatable thead { + position: sticky; + top: 0; + } + + + {% endblock extra_styles %} {% block full_width_content %} -{% fragment as action_button %} -
- {% if context == "request" %} + {% fragment as action_button %} +
+ {% if context == "request" %} {% if is_author %} - {% if release_request.status.name == "PENDING" %} + {% if release_request.status.name == "PENDING" %}
- {% csrf_token %} - {% #button type="submit" tooltip="This request is ready to be reviewed" variant="success" class="action-button" id="submit-for-review-button" %}Submit For Review{% /button %} + {% csrf_token %} + {% #button type="submit" tooltip="This request is ready to be reviewed" variant="success" class="action-button" id="submit-for-review-button" %}Submit For Review{% /button %}
- {% endif %} + {% endif %} {% elif is_output_checker %} - {% if release_request.status.name == "SUBMITTED" %} + {% if release_request.status.name == "SUBMITTED" %}
- {% csrf_token %} - {% #button type="submit" tooltip="Reject this request" variant="danger" class="action-button" id="reject-request-button" %}Reject Request{% /button %} + {% csrf_token %} + {% #button type="submit" tooltip="Reject this request" variant="danger" class="action-button" id="reject-request-button" %}Reject Request{% /button %}
- {% csrf_token %} - {% #button type="submit" tooltip="Release files to jobs.opensafely.org" variant="warning" id="release-files-button" %}Release Files{% /button %} + {% csrf_token %} + {% #button type="submit" tooltip="Release files to jobs.opensafely.org" variant="warning" id="release-files-button" %}Release Files{% /button %}
- {% endif %} + {% 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 %} + {% elif current_request %} + {% #button variant="success" type="link" href=current_request.get_url id="current-request-button" %}Current release request{% /button %} + {% endif %} +
+ {% endfragment %} -{% #card title=title custom_button=action_button %} -{% if context == "request" %} -{% #description_item title="Status:" %}{{ release_request.status.name }}{% /description_item %} -{% endif %} -{% /card %} + {% #card title=title custom_button=action_button %} + {% if context == "request" %} + {% #description_item title="Status:" %}{{ release_request.status.name }}{% /description_item %} + {% endif %} + {% /card %} -{% #breadcrumbs %} + {% #breadcrumbs %} {% for crumb in path_item.breadcrumbs %} - {% breadcrumb title=crumb.name url=crumb.url active=forloop.last %} + {% breadcrumb title=crumb.name url=crumb.url active=forloop.last %} {% endfor %} -{% /breadcrumbs %} - -
+ {% /breadcrumbs %} -
- {% #card %} -
    - {% include "file_browser/tree.html" with path=root %} -
- {% /card %} -
+
-
-
- - {% if path_item.is_directory %} - - {% #card title=path_item.name %} - {% #list_group %} - {% if not path_item.children %} - {% list_group_empty icon=True title="Empty Directory" %} - {% else %} - {% for entry in path_item.children %} - {% #list_group_item href=entry.url %} - {{ entry.name}} - {% if entry.is_directory %} - {% icon_folder_outline class="h-6 w-6 text-slate-600 inline" %} - {% endif %} - {% /list_group_item %} - {% endfor %} - {% endif %} - {% /list_group %} +
+ {% #card %} +
    + {% include "file_browser/tree.html" with path=root %} +
{% /card %} +
+ +
+
+ + {% if path_item.is_directory %} + + {% #card title=path_item.name %} + {% #list_group %} + {% if not path_item.children %} + {% list_group_empty icon=True title="Empty Directory" %} + {% else %} + {% for entry in path_item.children %} + {% #list_group_item href=entry.url %} + {{ entry.name}} + {% if entry.is_directory %} + {% icon_folder_outline class="h-6 w-6 text-slate-600 inline" %} + {% endif %} + {% /list_group_item %} + {% endfor %} + {% endif %} + {% /list_group %} + {% /card %} + + {% else %} + {% fragment as add_button %} + {% if context == "workspace" %} + {% if form %} + {% #modal id="addRequestFile" button_text="Add File to Request" variant="success" %} + {% #card container=True title="Add a file" %} +
+ {% csrf_token %} + {% form_select class="w-full max-w-lg mx-auto" label="Select a file group" field=form.filegroup choices=form.filegroup.field.choices %} + {% form_input class="w-full max-w-lg mx-auto" label="Or create a new file group" field=form.new_filegroup %} + +
+ {% #button type="submit" variant="success" id="add-file-button" %}Add File to Request{% /button %} + {% #button variant="danger" type="cancel" %}Cancel{% /button %} +
+
+ {% /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 %} +
+ {% csrf_token %} + {% #button type="submit" tooltip="Remove this file from this request" variant="warning" %}Remove File from Request{% /button %} +
- {% else %} - {% fragment as add_button %} - {% if context == "workspace" %} - {% if form %} - {% #modal id="addRequestFile" button_text="Add File to Request" variant="success" %} - {% #card container=True title="Add a file" %} -
- {% csrf_token %} - {% form_select class="w-full max-w-lg mx-auto" label="Select a file group" field=form.filegroup choices=form.filegroup.field.choices %} - {% form_input class="w-full max-w-lg mx-auto" label="Or create a new file group" field=form.new_filegroup %} - -
- {% #button type="submit" variant="success" id="add-file-button" %}Add File to Request{% /button %} - {% #button variant="danger" type="cancel" %}Cancel{% /button %} -
-
- {% /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 %} -
- {% csrf_token %} - {% #button type="submit" tooltip="Remove this file from this request" variant="warning" %}Remove File from Request{% /button %} -
- - {% endif %} - {% endfragment %} - - {% #card title=path_item.name container=True custom_button=add_button %} - -
- {% if path_item.suffix == '.html' %} - - {% elif path_item.suffix == '.csv' %} - {% include "file_browser/csv.html" with contents=path_item.contents %} - {% else %} -
{{ path_item.contents }}
{% endif %} -
- {% /card %} + {% endfragment %} + + {% #card title=path_item.name container=True custom_button=add_button %} + +
+ {% if path_item.suffix == '.html' %} + + {% elif path_item.suffix == '.csv' %} + {% include "file_browser/csv.html" with contents=path_item.contents %} + {% else %} +
{{ path_item.contents }}
+ {% endif %} +
+ {% /card %} - {% endif %} + {% endif %} +
+
-
-
{% endblock full_width_content %} @@ -209,21 +209,21 @@ {% endblock %} diff --git a/airlock/templates/file_browser/tree.html b/airlock/templates/file_browser/tree.html index 531acc69..8cf19d72 100644 --- a/airlock/templates/file_browser/tree.html +++ b/airlock/templates/file_browser/tree.html @@ -1,18 +1,18 @@ {% for child in path.children %} -
  • - {% if child.is_directory %} -
    - - {{ child.display }} - - {% if child.children %} -
      - {% include "file_browser/tree.html" with path=child %} -
    +
  • + {% if child.is_directory %} +
    + + {{ child.display }} + + {% if child.children %} +
      + {% include "file_browser/tree.html" with path=child %} +
    + {% endif %} +
    + {% else %} + {{ child.display }} {% endif %} -
  • - {% else %} - {{ child.display }} - {% endif %} -
  • + {% endfor %} diff --git a/airlock/templates/index.html b/airlock/templates/index.html index 5583345b..1f8624bd 100644 --- a/airlock/templates/index.html +++ b/airlock/templates/index.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% block content %} -

    Airlock

    -

    Hello World

    +

    Airlock

    +

    Hello World

    {% endblock content %} diff --git a/airlock/templates/jobserver-error.html b/airlock/templates/jobserver-error.html index d0906123..02f9efda 100644 --- a/airlock/templates/jobserver-error.html +++ b/airlock/templates/jobserver-error.html @@ -1,21 +1,21 @@ {% extends "base.html" %} {% block content %} -

    Job Server error

    -
    -
    -

    Response Headers:

    -
      +

      Job Server error

      +
      +
      +

      Response Headers:

      +
        {% for header, value in response.headers.items %} -
      • {{ header }}: {{ value }}
      • +
      • {{ header }}: {{ value }}
      • {% endfor %} -
      -
      -
      -

      Response Body:

      -{% if type == "text/html" %} - -{% else %} +
    +
    +
    +

    Response Body:

    + {% if type == "text/html" %} + + {% else %}
    {{ response.text }}
     {% endif %}
     
    diff --git a/airlock/templates/login.html b/airlock/templates/login.html
    index 9f07b551..5aec049e 100644
    --- a/airlock/templates/login.html
    +++ b/airlock/templates/login.html
    @@ -3,42 +3,42 @@
     {% block metatitle %}Login | OpenSAFELY Airlock{% endblock metatitle %}
     
     {% block content %}
    -
    -

    - Login -

    +
    +

    + Login +

    - {% #card title="Login with Single Use Token" subtitle="Log in from Level 4 environments with a Single Use Token" container=True class="md:col-span-2" %} - {% if dev_users_file %} - {% #alert variant="warning" title="Development login mode" class="mb-6" dismissible=True %} - Use credentials specified in:
    - {{ dev_users_file }} - {% /alert %} - {% endif %} -
    - {% csrf_token %} - + {% #card title="Login with Single Use Token" subtitle="Log in from Level 4 environments with a Single Use Token" container=True class="md:col-span-2" %} + {% if dev_users_file %} + {% #alert variant="warning" title="Development login mode" class="mb-6" dismissible=True %} + Use credentials specified in:
    + {{ dev_users_file }} + {% /alert %} + {% endif %} + + {% csrf_token %} + - {% form_input type="text" field=token_login_form.user label="GitHub username or Email address" required=True class="mb-3" placeholder="opensafely" input_class="max-w-md" %} - {% form_input type="text" field=token_login_form.token label="Single Use Token" required=True placeholder="three random words" show_placeholder=True class="mb-3" input_class="max-w-md" %} + {% form_input type="text" field=token_login_form.user label="GitHub username or Email address" required=True class="mb-3" placeholder="opensafely" input_class="max-w-md" %} + {% form_input type="text" field=token_login_form.token label="Single Use Token" required=True placeholder="three random words" show_placeholder=True class="mb-3" input_class="max-w-md" %} - {% #button type="submit" variant="primary-outline" %} - Log in with token - {% /button %} -
    -
    -

    - You cannot access Github to login from Level 4. Instead, you - must generate a single user token to log in with. -

    -

    - To do so, you will need to login with Github on your usual - browser, outside Level 4. Then click on the Account drop down - on the top right, and click Settings. Then click the button - "Generate Single User Token". You can then use that token to - login on Level 4. -

    -
    + {% #button type="submit" variant="primary-outline" %} + Log in with token + {% /button %} + +
    +

    + You cannot access Github to login from Level 4. Instead, you + must generate a single user token to log in with. +

    +

    + To do so, you will need to login with Github on your usual + browser, outside Level 4. Then click on the Account drop down + on the top right, and click Settings. Then click the button + "Generate Single User Token". You can then use that token to + login on Level 4. +

    +
    {% /card %} {% endblock content %} diff --git a/airlock/templates/requests.html b/airlock/templates/requests.html index 36503570..c6e741bb 100644 --- a/airlock/templates/requests.html +++ b/airlock/templates/requests.html @@ -2,22 +2,22 @@ {% block content %} -{% #card title="Requests by "|add:request.user.username %} - {% #list_group id="authored-requests" %} - {% for request in authored_requests %} - {% #list_group_item href=request.get_url %}{{ request.workspace }}: {{ request.status.name }}{% /list_group_item %} - {% endfor %} - {% /list_group %} -{% /card %} + {% #card title="Requests by "|add:request.user.username %} + {% #list_group id="authored-requests" %} + {% for request in authored_requests %} + {% #list_group_item href=request.get_url %}{{ request.workspace }}: {{ request.status.name }}{% /list_group_item %} + {% endfor %} + {% /list_group %} + {% /card %} -{% if request.user.output_checker %} -{% #card title="Outstanding requests awaiting review" %} - {% #list_group id="outstanding-requests" %} - {% for request in outstanding_requests %} - {% #list_group_item href=request.get_url %}{{ request.workspace }} by {{ request.author }}{% /list_group_item %} - {% endfor %} - {% /list_group %} -{% /card %} -{% endif %} + {% if request.user.output_checker %} + {% #card title="Outstanding requests awaiting review" %} + {% #list_group id="outstanding-requests" %} + {% for request in outstanding_requests %} + {% #list_group_item href=request.get_url %}{{ request.workspace }} by {{ request.author }}{% /list_group_item %} + {% endfor %} + {% /list_group %} + {% /card %} + {% endif %} {% endblock content %} diff --git a/airlock/templates/workspaces.html b/airlock/templates/workspaces.html index 10490425..95a5a26f 100644 --- a/airlock/templates/workspaces.html +++ b/airlock/templates/workspaces.html @@ -1,11 +1,11 @@ {% extends "base.html" %} {% block content %} -{% #card title="Workspaces for "|add:request.user.username %} - {% #list_group id="workspaces" %} - {% for workspace in workspaces %} - {% #list_group_item href=workspace.get_url %}{{ workspace.name }}{% /list_group_item %} - {% endfor %} - {% /list_group %} -{% /card %} + {% #card title="Workspaces for "|add:request.user.username %} + {% #list_group id="workspaces" %} + {% for workspace in workspaces %} + {% #list_group_item href=workspace.get_url %}{{ workspace.name }}{% /list_group_item %} + {% endfor %} + {% /list_group %} + {% /card %} {% endblock content %}