From 466cbd9878538a058a7fe4d59545bcda284f42ef Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Tue, 5 Oct 2021 17:24:06 +0200 Subject: [PATCH] Replace Font Awesome with inline SVG icons Font Awesome 4 adds 106kB of dependencies on each page and require to query multiple assets. It also sometimes causes icons to appear after page loading. Font Awesome 4 is deprecated and replaced by version 5 which is not packaged in every GNU/Linux distributions. This commit replaces icons with inline SVG which does not require external assets, does not require an additionnal dependency and is widely supported by modern browsers. It makes the page loading faster and enables us to no longer require fonts-font-awesome Debian package. --- Dockerfile | 2 +- README.md | 4 +- ansible/roles/1-apt-basic/tasks/main.yml | 1 - .../templates/activity/activity_list.html | 4 +- apps/member/templates/member/base.html | 10 +- apps/member/templates/member/club_detail.html | 17 +++- .../templates/member/includes/club_info.html | 4 +- .../member/includes/profile_info.html | 13 ++- .../templates/member/profile_detail.html | 10 +- apps/member/templates/member/user_list.html | 6 +- apps/note/templates/note/conso_form.html | 5 +- apps/wei/templates/wei/bus_detail.html | 18 +++- apps/wei/templates/wei/busteam_detail.html | 13 ++- apps/wei/templates/wei/weiclub_detail.html | 23 ++++- .../wei/templates/wei/weimembership_list.html | 8 +- docs/install-dev.rst | 2 +- docs/install.rst | 2 +- note_kfet/templates/base.html | 95 +++++++++++++++---- 18 files changed, 191 insertions(+), 46 deletions(-) diff --git a/Dockerfile b/Dockerfile index 95a62437..c099f655 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN apt-get update && \ python3-babel python3-lockfile python3-pip python3-phonenumbers python3-memcache ipython3 \ python3-bs4 python3-setuptools \ uwsgi uwsgi-plugin-python3 \ - texlive-xetex gettext libjs-bootstrap4 fonts-font-awesome && \ + texlive-xetex gettext libjs-bootstrap4 && \ rm -rf /var/lib/apt/lists/* # Instal PyPI requirements diff --git a/README.md b/README.md index 26ced30c..0cba71c0 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Bien que cela permette de créer une instance sur toutes les distributions, $ sudo apt update $ sudo apt install --no-install-recommends -y \ ipython3 python3-setuptools python3-venv python3-dev \ - texlive-xetex gettext libjs-bootstrap4 fonts-font-awesome git + texlive-xetex gettext libjs-bootstrap4 git ``` 2. **Clonage du dépot** là où vous voulez : @@ -115,7 +115,7 @@ Sinon vous pouvez suivre les étapes décrites ci-dessous. python3-babel python3-lockfile python3-pip python3-phonenumbers python3-memcache ipython3 \ python3-bs4 python3-setuptools python3-docutils \ memcached uwsgi uwsgi-plugin-python3 \ - texlive-xetex gettext libjs-bootstrap4 fonts-font-awesome \ + texlive-xetex gettext libjs-bootstrap4 \ nginx python3-venv git acl ``` diff --git a/ansible/roles/1-apt-basic/tasks/main.yml b/ansible/roles/1-apt-basic/tasks/main.yml index 7c57646f..e4f2037d 100644 --- a/ansible/roles/1-apt-basic/tasks/main.yml +++ b/ansible/roles/1-apt-basic/tasks/main.yml @@ -17,7 +17,6 @@ - ipython3 # Front-end dependencies - - fonts-font-awesome - libjs-bootstrap4 # Python dependencies diff --git a/apps/activity/templates/activity/activity_list.html b/apps/activity/templates/activity/activity_list.html index 3316d698..b4008c4e 100644 --- a/apps/activity/templates/activity/activity_list.html +++ b/apps/activity/templates/activity/activity_list.html @@ -34,7 +34,9 @@ SPDX-License-Identifier: GPL-3.0-or-later {% endif %} diff --git a/apps/member/templates/member/base.html b/apps/member/templates/member/base.html index e1e9335b..7182d0cc 100644 --- a/apps/member/templates/member/base.html +++ b/apps/member/templates/member/base.html @@ -45,7 +45,10 @@ SPDX-License-Identifier: GPL-3.0-or-later