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

feat: Style preformatted alert messages better #5152

Merged
merged 3 commits into from
Feb 16, 2023
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
2 changes: 1 addition & 1 deletion ietf/nomcom/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1973,7 +1973,7 @@ def do_common_work(self,url,expected_form):
response = self.client.get(url)
self.assertEqual(response.status_code,200)
q=PyQuery(response.content)
text_bits = [x.xpath('./text()') for x in q('.alert-warning')]
text_bits = [x.xpath('.//text()') for x in q('.alert-warning')]
flat_text_bits = [item for sublist in text_bits for item in sublist]
self.assertTrue(any(['not yet' in y for y in flat_text_bits]))
self.assertEqual(bool(q('form:not(.navbar-form)')),expected_form)
Expand Down
5 changes: 5 additions & 0 deletions ietf/static/css/ietf.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ pre {
width: 60px;
}

// Style preformatted alert messages better.
.preformatted {
rjsparks marked this conversation as resolved.
Show resolved Hide resolved
white-space: pre-line;
}

.leftmenu {
width: 13em;

Expand Down
4 changes: 2 additions & 2 deletions ietf/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@
</div>
</noscript>
{% for message in messages %}
<div class="alert {% if message.level_tag %} alert-{% if message.level_tag == 'error' %}danger{% else %}{{ message.level_tag }}{% endif %} {% endif %} {% if message.extra_tags %} {{ message.extra_tags }}{% endif %} alert-dismissable fade show">
<div class="alert {% if message.level_tag %} alert-{% if message.level_tag == 'error' %}danger{% else %}{{ message.level_tag }}{% endif %} {% endif %} alert-dismissable fade show">
<button type="button"
class="btn-close float-end"
data-bs-dismiss="alert"
aria-label="Close"></button>
{{ message.message }}
<div{% if message.extra_tags %} class="{{ message.extra_tags }}"{% endif %}>{{ message.message }}</div>
</div>
{% endfor %}
{% block content %}{{ content|safe }}{% endblock %}
Expand Down