Skip to content

Commit

Permalink
display deleted files in a sensible way
Browse files Browse the repository at this point in the history
  • Loading branch information
rachaelcodes committed May 28, 2024
1 parent ab637fe commit 9b5aa15
Showing 1 changed file with 29 additions and 21 deletions.
50 changes: 29 additions & 21 deletions django_app/redbox_app/templates/documents.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,23 @@ <h1 class="govuk-heading-l govuk-!-margin-bottom-0">Documents</h1>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">Status</dt>
<dd class="govuk-summary-list__value">
{% if file.get_processing_status_text() | lower == 'complete' %}
<strong class="govuk-tag govuk-tag--green iai-docs__status">{{ file.get_processing_status_text() }}</strong>
{% if file.get_status_text() | lower == 'complete' %}
<strong class="govuk-tag govuk-tag--green iai-docs__status">{{ file.get_status_text() }}</strong>
{% elif file.get_status_text() | lower == 'deleted' %}
<strong class="govuk-tag govuk-tag--red iai-docs__status">{{ file.get_status_text() }}</strong>
{% else %}
<strong class="govuk-tag govuk-tag--yellow iai-docs__status" x-data="file-status" data-id="{{file.id}}" x-text="status">{{ file.get_processing_status_text() }}</strong>
<strong class="govuk-tag govuk-tag--yellow iai-docs__status" x-data="file-status" data-id="{{file.id}}" x-text="status">{{ file.get_status_text() }}</strong>
{% endif %}
</dd>
</div>
</dl>
{{ govukButton(
text="Remove" + "<span class=\"govuk-visually-hidden\">" + file.name + "</span>",
href=url('remove-doc', file.id),
classes="govuk-button--warning govuk-!-margin-bottom-0"
) }}
{% if file.get_status_text() | lower != 'deleted' %}
{{ govukButton(
text="Remove" + "<span class=\"govuk-visually-hidden\">" + file.name + "</span>",
href=url('remove-doc', file.id),
classes="govuk-button--warning govuk-!-margin-bottom-0"
) }}
{% endif %}
</li>
{% endfor %}
</ul>
Expand All @@ -83,24 +87,28 @@ <h1 class="govuk-heading-l govuk-!-margin-bottom-0">Documents</h1>
<td class="govuk-table__cell govuk-!-padding-top-3">
{% if file.get_status_text() | lower == 'complete' %}
<strong class="govuk-tag govuk-tag--green iai-docs__status govuk-!-margin-top-0">{{ file.get_status_text() }}</strong>
{% elif file.get_status_text() | lower == 'deleted' %}
<strong class="govuk-tag govuk-tag--red iai-docs__status govuk-!-margin-top-0">{{file.get_status_text()}}</strong>
{% else %}
<strong class="govuk-tag govuk-tag--yellow iai-docs__status govuk-!-margin-top-0" x-data="file-status" data-id="{{file.id}}" x-text="status">{{ file.get_status_text() }}</strong>
{% endif %}
</td>
<td class="govuk-table__cell iai-docs__actions">
{# Removed for now until we've validated a user need for this
{{ govukButton(
text="Download" + "<span class=\"govuk-visually-hidden\">" + file.name + "</span>",
href=file.url,
classes="govuk-button--secondary govuk-!-margin-bottom-0",
download=True
) }}
#}
{{ govukButton(
text="Remove" + "<span class=\"govuk-visually-hidden\">" + file.name + "</span>",
href=url('remove-doc', file.id),
classes="govuk-button--warning govuk-!-margin-bottom-0"
) }}
{% if file.get_status_text() | lower != 'deleted' %}
{# Removed for now until we've validated a user need for this
{{ govukButton(
text="Download" + "<span class=\"govuk-visually-hidden\">" + file.name + "</span>",
href=file.url,
classes="govuk-button--secondary govuk-!-margin-bottom-0",
download=True
) }}
#}
{{ govukButton(
text="Remove" + "<span class=\"govuk-visually-hidden\">" + file.name + "</span>",
href=url('remove-doc', file.id),
classes="govuk-button--warning govuk-!-margin-bottom-0"
) }}
{% endif %}
</td>
</tr>
{% endfor %}
Expand Down

0 comments on commit 9b5aa15

Please sign in to comment.