Fix icon alignment in page listings

pull/11870/head
Sage Abdullah 2024-04-19 06:44:41 +07:00 zatwierdzone przez Thibaud Colas
rodzic 56e69bc3ea
commit 4a208928e8
3 zmienionych plików z 9 dodań i 11 usunięć

Wyświetl plik

@ -231,6 +231,7 @@ ul.listing {
gap: theme('spacing.2'); gap: theme('spacing.2');
margin: 0; margin: 0;
vertical-align: middle; vertical-align: middle;
align-items: center;
a { a {
color: inherit; color: inherit;
@ -242,11 +243,6 @@ ul.listing {
} }
} }
} }
.icon-folder {
margin: 3px 0.3em 0 0;
vertical-align: top;
}
} }
.actions { .actions {

Wyświetl plik

@ -5,7 +5,7 @@
<div class="title-wrapper"> <div class="title-wrapper">
{% if page.is_site_root %} {% if page.is_site_root %}
{% if perms.wagtailcore.add_site or perms.wagtailcore.change_site or perms.wagtailcore.delete_site %} {% if perms.wagtailcore.add_site or perms.wagtailcore.change_site or perms.wagtailcore.delete_site %}
<a href="{% url 'wagtailsites:index' %}" title="{% trans 'Sites menu' %}">{% icon name="site" classname="initial" %}</a> <a href="{% url 'wagtailsites:index' %}" title="{% trans 'Sites menu' %}" class="w-flex w-items-center">{% icon name="site" classname="initial" %}</a>
{% endif %} {% endif %}
{% endif %} {% endif %}
@ -17,7 +17,7 @@
without also reading out the buttons and indicators. without also reading out the buttons and indicators.
{% endcomment %} {% endcomment %}
{% fragment as page_title %} {% fragment as page_title %}
<span id="page_{{ page.pk|unlocalize|admin_urlquote }}_title"> <span id="page_{{ page.pk|unlocalize|admin_urlquote }}_title" class="w-flex w-items-center w-gap-2">
{% if not page.is_site_root and not page.is_leaf %}{% icon name="folder" classname="initial" %}{% endif %} {% if not page.is_site_root and not page.is_leaf %}{% icon name="folder" classname="initial" %}{% endif %}
{{ page.get_admin_display_title }} {{ page.get_admin_display_title }}
</span> </span>

Wyświetl plik

@ -133,13 +133,15 @@ class TestPageExplorer(WagtailTestUtils, TestCase):
def test_explore_root_shows_icon(self): def test_explore_root_shows_icon(self):
response = self.client.get(reverse("wagtailadmin_explore_root")) response = self.client.get(reverse("wagtailadmin_explore_root"))
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
soup = self.get_soup(response.content)
# Administrator (or user with add_site permission) should see the # Administrator (or user with add_site permission) should see the
# sites link with its icon # sites link with its icon
self.assertContains( url = reverse("wagtailsites:index")
response, link = soup.select_one(f'td a[href="{url}"]')
'<a href="/admin/sites/" title="Sites menu"><svg', self.assertIsNotNone(link)
) icon = link.select_one("svg use[href='#icon-site']")
self.assertIsNotNone(icon)
def test_ordering(self): def test_ordering(self):
response = self.client.get( response = self.client.get(