tomdyson / wagalytics

A Google Analytics dashboard in your Wagtail admin
MIT License
217 stars 42 forks source link

Menu icon only displaying on analytics page #3

Closed chrxr closed 8 years ago

chrxr commented 8 years ago

Hi @tomdyson,

One tiny thing, the fontawesome icon for analytics in the menu is only displaying on the actual analytics dashboard.

All of the other menu pages show the title without the icon.

screen shot 2016-02-25 at 14 03 55

tomdyson commented 8 years ago

Yes, I spotted this belatedly - this was the motivation for https://github.com/torchbox/wagtail/pull/2276. Once that's in Wagtail 1.4 I'll switch the hook so it shows properly for all pages.

coredumperror commented 8 years ago

I also noticed this. Oddly enough, the icon does appear when I'm on a custom admin page that I defined myself. I wonder if that page counts as an editor page?

alexgleason commented 8 years ago

Fixed via alexgleason/wagtailfontawesome@0dfe6d60701d9e585ea664b2e00c75a5ad5ca8f9

Make sure you're using wagtailfontawesome version >= 1.0.2 and Wagtail >= 1.4 in order for it to work.

coredumperror commented 8 years ago

Hmmm, perhaps this is just my own ignorance at work, but when I updated my dev machine's copy of wagtailfontawesome to 1.0.2, pip did quite a bit more than just updating that one package:

$ pip install --upgrade wagtailfontawesome
Collecting wagtailfontawesome
  Downloading wagtailfontawesome-1.0.2-py2.py3-none-any.whl (516kB)
    100% |████████████████████████████████| 522kB 588kB/s 
Collecting wagtail>=1.4.0 (from wagtailfontawesome)
  Downloading wagtail-1.4.1-py2.py3-none-any.whl (6.5MB)
    100% |████████████████████████████████| 6.5MB 196kB/s 
Collecting Django>=1.7.1 (from wagtailfontawesome)
  Downloading Django-1.9.4-py2.py3-none-any.whl (6.6MB)
    100% |████████████████████████████████| 6.6MB 194kB/s 
Collecting djangorestframework>=3.1.3 (from wagtail>=1.4.0->wagtailfontawesome)
  Downloading djangorestframework-3.3.3-py2.py3-none-any.whl (662kB)
    100% |████████████████████████████████| 665kB 1.9MB/s 
Requirement already up-to-date: django-taggit>=0.17.5 in /Users/rrollins/.pyenv/versions/wagtail-multitenant/lib/python2.7/site-packages (from wagtail>=1.4.0->wagtailfontawesome)
Requirement already up-to-date: Unidecode>=0.04.14 in /Users/rrollins/.pyenv/versions/wagtail-multitenant/lib/python2.7/site-packages (from wagtail>=1.4.0->wagtailfontawesome)
Requirement already up-to-date: beautifulsoup4>=4.3.2 in /Users/rrollins/.pyenv/versions/wagtail-multitenant/lib/python2.7/site-packages (from wagtail>=1.4.0->wagtailfontawesome)
Collecting django-treebeard<5.0,>=3.0 (from wagtail>=1.4.0->wagtailfontawesome)
  Downloading django-treebeard-4.0.tar.gz (92kB)
    100% |████████████████████████████████| 102kB 8.4MB/s 
Requirement already up-to-date: html5lib<1,>=0.999 in /Users/rrollins/.pyenv/versions/wagtail-multitenant/lib/python2.7/site-packages (from wagtail>=1.4.0->wagtailfontawesome)
Collecting Willow<0.4,>=0.3b4 (from wagtail>=1.4.0->wagtailfontawesome)
  Downloading Willow-0.3-py2.py3-none-any.whl (110kB)
    100% |████████████████████████████████| 112kB 9.7MB/s 
Requirement already up-to-date: Pillow>=2.6.1 in /Users/rrollins/.pyenv/versions/wagtail-multitenant/lib/python2.7/site-packages (from wagtail>=1.4.0->wagtailfontawesome)
Requirement already up-to-date: django-modelcluster<1.2,>=1.1 in /Users/rrollins/.pyenv/versions/wagtail-multitenant/lib/python2.7/site-packages (from wagtail>=1.4.0->wagtailfontawesome)
Requirement already up-to-date: six in /Users/rrollins/.pyenv/versions/wagtail-multitenant/lib/python2.7/site-packages (from html5lib<1,>=0.999->wagtail>=1.4.0->wagtailfontawesome)
Collecting pytz>=2015.2 (from django-modelcluster<1.2,>=1.1->wagtail>=1.4.0->wagtailfontawesome)
  Downloading pytz-2016.1-py2.py3-none-any.whl (476kB)
    100% |████████████████████████████████| 481kB 3.0MB/s 
Building wheels for collected packages: django-treebeard
  Running setup.py bdist_wheel for django-treebeard ... done
  Stored in directory: /Users/rrollins/Library/Caches/pip/wheels/4d/86/56/0eca65a0a432037604df3f4a03d81ae97b767b5a0e3bb6832f
Successfully built django-treebeard
Installing collected packages: djangorestframework, Django, django-treebeard, Willow, wagtail, wagtailfontawesome, pytz
  Found existing installation: djangorestframework 3.3.2
    Uninstalling djangorestframework-3.3.2:
      Successfully uninstalled djangorestframework-3.3.2
  Found existing installation: Django 1.9.3
    Uninstalling Django-1.9.3:
      Successfully uninstalled Django-1.9.3
  Found existing installation: django-treebeard 3.0
    Uninstalling django-treebeard-3.0:
      Successfully uninstalled django-treebeard-3.0
  Found existing installation: Willow 0.2.2
    Uninstalling Willow-0.2.2:
      Successfully uninstalled Willow-0.2.2
  Found existing installation: wagtail 1.4a0
    Uninstalling wagtail-1.4a0:
      Successfully uninstalled wagtail-1.4a0
  Found existing installation: wagtailfontawesome 1.0.1
    Uninstalling wagtailfontawesome-1.0.1:
      Successfully uninstalled wagtailfontawesome-1.0.1
  Found existing installation: pytz 2015.7
    Uninstalling pytz-2015.7:
      Successfully uninstalled pytz-2015.7
Successfully installed Django-1.9.4 Willow-0.3 django-treebeard-4.0 djangorestframework-3.3.3 pytz-2016.1 wagtail-1.4a0 wagtailfontawesome-1.0.2

Is this my fault for using pip wrong, or is wagtailfontawesome's dependency setup at fault? I'm especially surprised by that django update, as I don't think 1.9.4 specifically would actually be required, so why didn't pip just leave 1.9.3 in place?

alexgleason commented 8 years ago

@coredumperror I think that's a pip thing. I've done the same, with other packages, followed by a "no no no no no!!" It's pretty annoying. I don't know how to actually do it properly.

But if you edit the requirements.txt for your project and set wagtailfontawesome==1.0.2, you can just pip install -r requirements.txt and it handles it correctly.

I think the --upgrade command doesn't do what we want it to do, here.

coredumperror commented 8 years ago

Ah, I hadn't thought of explicitly specifying the version number for wagtailfontawesome. Thanks!

mx-moth commented 8 years ago

Yeah, pip install --upgrade will upgrade all the installed packages, rather than only upgrading any named packages. You can pip install wagtailfontawesome==1.0.2 wagtail==1.4.1, which will only install the named versions, and upgrade any dependencies that are no longer satisfied.

alexgleason commented 8 years ago

Thanks for the clarification. That is so bad, IMO

coredumperror commented 8 years ago

Agreed, especially when you consider that pip itself tells you to use pip install --upgrade <package_name> for this purpose.

mx-moth commented 8 years ago

Oh wait no, I was slightly wrong. Doing a pip install --upgrade package will fetch and install the latest version of package. It will not upgrade all of your installed packages. However, if package depends on wagtail>=1.3, even if you already satisfy that dependency by having wagtail==1.3 installed, it will look for an updated wagtail package to install in order to better satisfy the dependency from package. Still an annoying way to work, but not quite as horrible as I initially said.

This can lead to the situation where wagtail==1.4.1 is installed, which does satisfy the dependency of package, but violates the dependencies of your project. pip does not remember and enforce previously set version requirements for packages, which can lead to broken environments with incorrect versions.

The best way to fix this is to do as @alexgleason suggested, and update your requirements for your project, and then install by running pip install -r requirements.txt.

alexfromvl commented 8 years ago

I suggest using class='icon icon-site', which is in the initial setup. Then icon is inserted. I think that the formal ''icon-site" within the meaning fits.

tomdyson commented 8 years ago

Closing this as fixed in wagtailfontawesome version >= 1.0.2 and Wagtail >= 1.4