Skip to content
Open
Changes from 1 commit
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
18 changes: 16 additions & 2 deletions readthedocsext/theme/templates/builds/includes/status_icon.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load i18n %}
{% load trans from i18n %}

{% comment "rst" %}

Expand Down Expand Up @@ -113,5 +113,19 @@
'loading grey fa-spinner-third': state.code !== 'finished' && state.code !== 'triggered' && state.code !== 'cancelled',
}
{% endspaceless %}"{% endif %}></i>
{% endspaceless %}"{% endif %}
title="{% if build.state == 'finished' %}
{% if build.success %}
{% trans "Build finished successfully" %}
{% else %}
{% trans "Build finished with errors" %}
{% endif %}
{% elif build.state == 'cancelled' %}
{% trans "Build cancelled" %}
{% elif build.is_stale %}
{% trans "Build queued" %}
{% else %}
{% trans "Build in progress" %}
{% endif %}">
</i>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid a multiline attribute, this should all be wrapped with spaceless similar to the attributes above this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure spaceless is working..

Screenshot 2025-09-30 at 12 42 38 PM

Copy link
Member Author

@ericholscher ericholscher Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaceless only removes spaces between HTML tags, not inside of text content: https://docs.djangoproject.com/en/5.2/ref/templates/builtins/#spaceless

Only space between tags is removed – not space between tags and text.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bah yeah you're right. This is going to be another case of fighting with Django templates to do something really basic. There might be a way to use {% filter cut:"" %} but this almost certainly requires a small, custom filter.

These blocks are all trying to do the same thing, so should all match.

{# fmt:on #}