Skip to content

Commit be09519

Browse files
committed
Remove rendering for django-messages-extends
Related readthedocs/readthedocs.org#10994
1 parent b20682f commit be09519

File tree

1 file changed

+13
-23
lines changed

1 file changed

+13
-23
lines changed

readthedocsext/theme/templates/includes/utils/messages.html

+13-23
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,23 @@
22

33
{% comment %}
44
This template is used by the base template to provide a list of messages on
5-
the top of the page. If the message has a pk it is a persisent or sticky
6-
message level. Otherwise, Django default level notifications are treated as
5+
the top of the page. Django default level notifications are treated as
76
temporary messages, using SUI toast messages instead of block elements in the
87
page content pane.
98
{% endcomment %}
109

1110
{% if messages %}
1211
{% for message in messages %}
13-
{# Message is sticky/persistent, show these like normal. #}
14-
{% if message.pk %}
15-
<div class="ui message {{ message.tags }}"
16-
data-bind="message: {dismiss_url: '{% url "message_mark_read" message.pk %}'}">
17-
<i class="fa-duotone fa-circle-xmark close icon"></i>
18-
{{ message }}
19-
</div>
20-
{% else %}
21-
{% comment %}
22-
This is a little bit of a hack, as toasts are purely JS and don't
23-
require an underlying element. Django messages uses "tags" to specify
24-
info/success/error classes on the messages, which just happen to align
25-
with SUI classes too.
26-
{% endcomment %}
27-
{# fmt:off #}
28-
{% spaceless %}
29-
<div style="display: none;"
30-
data-bind="
12+
{% comment %}
13+
This is a little bit of a hack, as toasts are purely JS and don't
14+
require an underlying element. Django messages uses "tags" to specify
15+
info/success/error classes on the messages, which just happen to align
16+
with SUI classes too.
17+
{% endcomment %}
18+
{# fmt:off #}
19+
{% spaceless %}
20+
<div style="display: none;"
21+
data-bind="
3122
semanticui: {
3223
toast: {
3324
message: '{{ message|escapejs }}',
@@ -38,8 +29,7 @@
3829
}
3930
}">
4031
</div>
41-
{% endspaceless %}
42-
{# fmt:on #}
43-
{% endif %}
32+
{% endspaceless %}
33+
{# fmt:on #}
4434
{% endfor %}
4535
{% endif %}

0 commit comments

Comments
 (0)