kopia lustrzana https://github.com/wagtail/wagtail
Update help text to use SVG icons (#6457)
* Update help text to use SVG icons * Remove Sass for .object-help .icon-help-inverse This styling is no longer needed. I have left the general `icon-help-inverse` stuff in place, so as not to break that at this time.pull/6462/head
rodzic
423aefc72c
commit
646763ba48
|
@ -151,10 +151,8 @@
|
|||
padding-left: 3em;
|
||||
opacity: 1;
|
||||
|
||||
.icon-help-inverse {
|
||||
float: left;
|
||||
margin-left: -2em;
|
||||
margin-top: 0.3em;
|
||||
.icon-help {
|
||||
margin-left: -1.75em;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,10 +13,12 @@
|
|||
|
||||
{% endcomment %}
|
||||
|
||||
{% load wagtailadmin_tags %}
|
||||
|
||||
{% if help_text %}
|
||||
<span>
|
||||
<div class="help">
|
||||
<span class="icon-help-inverse" aria-hidden="true"></span>
|
||||
{% icon name="help" class_name="default" %}
|
||||
{{ help_text }}
|
||||
</div>
|
||||
</span>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
{% load wagtailadmin_tags %}
|
||||
|
||||
<div class="{{ classname }}">
|
||||
{% if help_text %}
|
||||
<span>
|
||||
<div class="help">
|
||||
<span class="icon-help-inverse" aria-hidden="true"></span>
|
||||
{% icon name="help" class_name="default" %}
|
||||
{{ help_text }}
|
||||
</div>
|
||||
</span>
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{% load wagtailadmin_tags %}
|
||||
|
||||
<ul class="objects">
|
||||
{% for child in self.children %}
|
||||
<li class="object {{ child.classes|join:" " }}">
|
||||
|
@ -11,7 +13,10 @@
|
|||
<div class="object-layout">
|
||||
{% if child.help_text %}
|
||||
<div class="object-layout_small-part">
|
||||
<div class="object-help help"><span class="icon-help-inverse" aria-hidden="true"></span>{{ child.help_text }}</div>
|
||||
<div class="object-help help">
|
||||
{% icon name="help" class_name="default" %}
|
||||
{{ child.help_text }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="object-layout_big-part">
|
||||
|
|
|
@ -388,7 +388,7 @@ class TestObjectList(TestCase):
|
|||
self.assertInHTML('<label for="id_date_from">Start date</label>', result)
|
||||
|
||||
# result should include help text for children
|
||||
self.assertIn('<div class="object-help help"><span class="icon-help-inverse" aria-hidden="true"></span>Not required if event is on a single day</div>', result)
|
||||
self.assertInHTML('<div class="object-help help"> <svg class="icon icon-help default" aria-hidden="true" focusable="false"><use href="#icon-help"></use></svg> Not required if event is on a single day</div>', result)
|
||||
|
||||
# result should contain rendered content from descendants
|
||||
self.assertIn('Abergavenny sheepdog trials</textarea>', result)
|
||||
|
|
|
@ -1630,7 +1630,7 @@ class TestStructBlock(SimpleTestCase):
|
|||
'link': 'http://www.wagtail.io',
|
||||
}), prefix='mylink')
|
||||
|
||||
self.assertInHTML('<div class="help"><span class="icon-help-inverse" aria-hidden="true"></span> Self-promotion is encouraged</div>', html)
|
||||
self.assertInHTML('<div class="help"> <svg class="icon icon-help default" aria-hidden="true" focusable="false"><use href="#icon-help"></use></svg> Self-promotion is encouraged</div>', html)
|
||||
|
||||
# check it can be overridden in the block constructor
|
||||
block = LinkBlock(help_text="Self-promotion is discouraged")
|
||||
|
@ -1639,7 +1639,7 @@ class TestStructBlock(SimpleTestCase):
|
|||
'link': 'http://www.wagtail.io',
|
||||
}), prefix='mylink')
|
||||
|
||||
self.assertInHTML('<div class="help"><span class="icon-help-inverse" aria-hidden="true"></span> Self-promotion is discouraged</div>', html)
|
||||
self.assertInHTML('<div class="help"> <svg class="icon icon-help default" aria-hidden="true" focusable="false"><use href="#icon-help"></use></svg> Self-promotion is discouraged</div>', html)
|
||||
|
||||
def test_media_inheritance(self):
|
||||
class ScriptedCharBlock(blocks.CharBlock):
|
||||
|
|
Ładowanie…
Reference in New Issue