Repository: wagtail/wagtail

Issue:
Some icons from the styleguide not working in ModelAdmin
### Issue Summary

`menu_icon = 'media'` or `menu_icon = 'pick'` display the correct icon.
`menu_icon = 'thumbtack'` or `menu_icon = 'resubmit'` do not display anything.


### Technical details

Package | Name | Version
-- | -- | --
Django |   | 3.1
Python |   | 3.6.10
debug_toolbar | Debug Toolbar | 2.2
django_extensions | Django Extensions | 3.0.5
rest_framework | Django REST framework | 3.11.1
taggit | Taggit | 1.3.0
wagtail.core | Wagtail core | 2.10.1





Discussion:
1. How can I reproduce this? How do you define these icons?
2. AFAIK "thumbtack" and "resubmit" are not Wagtail icons. Do you use an icon package? Does `pip freeze` list wagtail-fontawesome? Which version?
I had used pip to install then later uninstall wagtailfontawesome. However these icons still appear in the styleguide
http://127.0.0.1:8000/admin/styleguide/#icons
![image](https://user-images.githubusercontent.com/37871091/92639290-31f4ba80-f2a1-11ea-9c46-a7f6e7ba437e.png)


```
class ShopItemAdmin(ThumbnailMixin, ModelAdmin):
    model = ShopItem
    menu_label = 'All Shop Items'  # ditch this to use verbose_name_plural from model
    menu_icon = 'resubmit'  # change as required
    ...
```

The menu item shows with the correct label, but no icon.
SVG file exists in site-packages.
site-packages\wagtail\admin\templates\wagtailadmin\icons\resubmit.svg
`thumbtack` and `resubmit` where added as purely SVG icons for the workflow work. Happy to move to an svg-only section in the styleguide to clarify that.

Note that the move to SVGs is not finished. #6107 is the tracker for the job, and still has `MenuItem`s not ready. A PR tackling the change to `MenuItem`s would be greatly appreciated.
> Happy to move to an svg-only section in the styleguide to clarify that.

Is not needed. Those icons will be supported in the future. The real problem is that ModelAdmin does not support SVG yet. That is known and on the todo list https://github.com/wagtail/wagtail/issues/6107

`MenuItems (including ModelAdminMenuItem and GroupMenuItem` 

We should focus on making this happen ^. Pull requests are welcome ;)

I don't think that new icons have to be backward compatible. We did not break anything that used to work. So I think this issue can be closed.
I agree, @allcaps. I will try to take on this item very soon.

Resolving patch:
diff --git a/wagtail/contrib/modeladmin/menus.py b/wagtail/contrib/modeladmin/menus.py
--- a/wagtail/contrib/modeladmin/menus.py
+++ b/wagtail/contrib/modeladmin/menus.py
@@ -9,10 +9,16 @@ class ModelAdminMenuItem(MenuItem):
     def __init__(self, model_admin, order):
         self.model_admin = model_admin
         url = model_admin.url_helper.index_url
-        classnames = 'icon icon-%s' % model_admin.get_menu_icon()
+        menu_icon = model_admin.get_menu_icon()
+        if menu_icon[:3] == 'fa-':
+            classnames = 'icon icon-%s' % menu_icon
+            icon_name = None
+        else:
+            classnames = ''
+            icon_name = menu_icon
         super().__init__(
             label=model_admin.get_menu_label(), url=url,
-            classnames=classnames, order=order)
+            classnames=classnames, icon_name=icon_name, order=order)
 
     def is_shown(self, request):
         return self.model_admin.permission_helper.user_can_list(request.user)
@@ -25,10 +31,16 @@ class GroupMenuItem(SubmenuMenuItem):
     pages
     """
     def __init__(self, modeladmingroup, order, menu):
-        classnames = 'icon icon-%s' % modeladmingroup.get_menu_icon()
+        menu_icon = modeladmingroup.get_menu_icon()
+        if menu_icon[:3] == 'fa-':
+            classnames = 'icon icon-%s' % menu_icon
+            icon_name = None
+        else:
+            classnames = ''
+            icon_name = menu_icon
         super().__init__(
             label=modeladmingroup.get_menu_label(), menu=menu,
-            classnames=classnames, order=order, )
+            classnames=classnames, icon_name=icon_name, order=order, )
 
     def is_shown(self, request):
         """
diff --git a/wagtail/contrib/modeladmin/options.py b/wagtail/contrib/modeladmin/options.py
--- a/wagtail/contrib/modeladmin/options.py
+++ b/wagtail/contrib/modeladmin/options.py
@@ -599,7 +599,7 @@ def get_app_label_from_subitems(self):
         return ''
 
     def get_menu_icon(self):
-        return self.menu_icon or 'icon-folder-open-inverse'
+        return self.menu_icon or 'folder-open-inverse'
 
     def get_menu_order(self):
         return self.menu_order or 999


Test patch: