Explorar el Código

Switch styleguide icon preview to use the real icon tag

Thibaud Colas hace 1 año
padre
commit
9c4d5e4feb

+ 1 - 4
wagtail/contrib/styleguide/templates/wagtailstyleguide/base.html

@@ -521,10 +521,7 @@
                     <tbody>
                         {% for item in icons %}
                             <tr>
-                                {# Renders the icon’s SVG within a SVG element, #}
-                                {# so we fully control the rendering without changing the icon’s markup. #}
-                                {# Icons are loaded with render_to_string, so need |safe. #}
-                                <td><svg width="32" height="32" fill="currentColor">{{ item.icon|safe }}</svg></td>
+                                <td>{% icon name=item.name classname="w-w-8 w-h-8" %}</td>
                                 <td><code>{{ item.name }}</code></td>
                                 <td>{{ item.source }}</td>
                                 <td><code>{{ item.file_path }}</code></td>

+ 0 - 1
wagtail/contrib/styleguide/views.py

@@ -159,7 +159,6 @@ class IndexView(WagtailAdminTemplateMixin, TemplateView):
                     "file_path": icon_path,
                     "name": name,
                     "source": source_match.group(1) if source_match else None,
-                    "icon": icon,
                 }
             )
         return all_icons.items()