Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show status icons in file browser #441

Merged
merged 3 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 37 additions & 3 deletions airlock/static/assets/file_browser/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,53 @@
padding: 0.25rem 0.75rem;
}

.file-status--success {
.file-status__icon {
background-image: var(--icon-url);
background-size: 100%;
filter: var(--icon-filter);
height: 14px;
margin-right: 0.25rem;
width: 14px;
}

.file-status--approved {
--status-color: var(--color-green-800);
--status-bg: var(--color-green-100);
--icon-filter: invert(18%) sepia(77%) saturate(1712%) hue-rotate(142deg)
brightness(102%) contrast(95%);
--icon-url: url("/static/icons/check_circle_outline.svg");
}

.file-status--danger {
.file-status--rejected {
--status-color: var(--color-fuchsia-800);
--status-bg: var(--color-fuchsia-100);
--icon-filter: invert(17%) sepia(40%) saturate(5736%) hue-rotate(284deg)
brightness(89%) contrast(98%);
--icon-url: url("/static/icons/help_circle_outline.svg");
}

.file-status--warning {
.file-status--unknown {
--status-color: var(--color-yellow-800);
--status-bg: var(--color-yellow-100);
--icon-filter: invert(30%) sepia(79%) saturate(491%) hue-rotate(351deg)
brightness(95%) contrast(99%);
--icon-url: url("/static/icons/unknown.svg");
}

.file-status--withdrawn {
--status-color: var(--color-orange-800);
--status-bg: var(--color-orange-50);
--icon-filter: invert(25%) sepia(6%) saturate(7490%) hue-rotate(333deg)
brightness(115%) contrast(111%);
--icon-url: url("/static/icons/cancel_circle_outline.svg");
}

.file-status--supporting {
--status-color: var(--color-slate-800);
--status-bg: var(--color-slate-50);
--icon-filter: invert(10%) sepia(9%) saturate(3595%) hue-rotate(178deg)
brightness(93%) contrast(85%);
--icon-url: url("/static/icons/attach_file.svg");
}

/* More dropdown */
Expand Down
43 changes: 31 additions & 12 deletions airlock/templates/file_browser/file.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,18 @@
{% /button %}
{% endif %}
{% else %}{# request #}
{% if path_item.is_supporting %}
{% #description_item title="Supporting file" %}This is a supporting file and will not be released.{% /description_item%}
{% if path_item.is_supporting %}
<span class="file-status file-status--supporting relative group cursor-pointer">
<span class="file-status__icon"></span>
Supporting
{% tooltip content="This is a supporting file and will not be released." %}
</span>
{% elif path_item.is_withdrawn %}
{% #description_item title="Withdrawn file" %}This file has been withdrawn and will not be released.{% /description_item%}
<span class="file-status file-status--withdrawn relative group cursor-pointer">
<span class="file-status__icon"></span>
Withdrawn
{% tooltip content="This file has been withdrawn and will not be released." %}
</span>
{% endif %}

{% if is_author %}
Expand All @@ -43,15 +51,26 @@
</form>
{% endif %}
{% elif is_output_checker %}
<div>
{% if not file_reset_review_url %}
<span class="file-status file-status--warning">No status</span>
{% elif file_approve_url %}
<span class="file-status file-status--danger">Changes requested</span>
{% elif file_reject_url %}
<span class="file-status file-status--success">Approved</span>
{% endif %}
</div>
{% if path_item.is_output %}
<div>
{% if not file_reset_review_url %}
<span class="file-status file-status--unknown">
<span class="file-status__icon"></span>
No status
</span>
{% elif file_approve_url %}
<span class="file-status file-status--rejected">
<span class="file-status__icon"></span>
Changes requested
</span>
{% elif file_reject_url %}
<span class="file-status file-status--approved">
<span class="file-status__icon"></span>
Approved
</span>
{% endif %}
</div>
{% endif %}

<div class="btn-group">
{% if file_approve_url %}
Expand Down