From 04001202f257b35e5ad3aa5f0541412421f9b74a Mon Sep 17 00:00:00 2001 From: Alexis Mercier des Rochettes Date: Thu, 30 Oct 2025 01:31:25 +0100 Subject: [PATCH 1/5] apps: add download links on login page * Add Badges with official links to store pages on login page * Add AppStore/Google Play badges in static img assets [1][2] * Add translation for "Download on the AppStore" and "Get it on Google Play" [1] https://developer.apple.com/app-store/marketing/guidelines/ [2] https://partnermarketinghub.withgoogle.com/brands/google-play/visual-identity/badge-guidelines/ Signed-off-by: Alexis Mercier des Rochettes --- locale/de/LC_MESSAGES/django.po | 8 ++++ locale/es/LC_MESSAGES/django.po | 8 ++++ locale/fr/LC_MESSAGES/django.po | 8 ++++ note_kfet/static/img/appstore_badge_fr.svg | 50 +++++++++++++++++++++ note_kfet/static/img/playstore_badge_fr.svg | 49 ++++++++++++++++++++ note_kfet/templates/registration/login.html | 11 +++++ 6 files changed, 134 insertions(+) create mode 100644 note_kfet/static/img/appstore_badge_fr.svg create mode 100644 note_kfet/static/img/playstore_badge_fr.svg diff --git a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index 7ca27bd5..af34ba7e 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -4366,6 +4366,14 @@ msgstr "" msgid "Forgotten your password or username?" msgstr "Passwort oder Username vergessen?" +#: note_kfet/templates/registration/login.html:44 +msgid "Download on the AppStore" +msgstr "Im AppStore herunterladen" + +#: note_kfet/templates/registration/login.html:48 +msgid "Get it on Google Play" +msgstr "Bei Google Play herunterladen" + #: note_kfet/templates/registration/password_change_done.html:13 msgid "Your password was changed." msgstr "Ihr Passwort wurde geändert." diff --git a/locale/es/LC_MESSAGES/django.po b/locale/es/LC_MESSAGES/django.po index 6612e6ec..d737aa21 100644 --- a/locale/es/LC_MESSAGES/django.po +++ b/locale/es/LC_MESSAGES/django.po @@ -4281,6 +4281,14 @@ msgstr "" msgid "Forgotten your password or username?" msgstr "¿ Contraseña o nombre de usuario olvidado ?" +#: note_kfet/templates/registration/login.html:44 +msgid "Download on the AppStore" +msgstr "Descargar en la AppStore" + +#: note_kfet/templates/registration/login.html:48 +msgid "Get it on Google Play" +msgstr "Descargar en Google Play" + #: note_kfet/templates/registration/password_change_done.html:13 msgid "Your password was changed." msgstr "Su contraseña fue cambiada con éxito." diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 2f3c6752..96f1621b 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -4584,6 +4584,14 @@ msgstr "" msgid "Forgotten your password or username?" msgstr "Mot de passe ou pseudo oublié ?" +#: note_kfet/templates/registration/login.html:44 +msgid "Download on the AppStore" +msgstr "Télécharger sur l'AppStore" + +#: note_kfet/templates/registration/login.html:48 +msgid "Get it on Google Play" +msgstr "Télécharger sur Google Play" + #: note_kfet/templates/registration/password_change_done.html:13 msgid "Your password was changed." msgstr "Votre mot de passe a bien été changé." diff --git a/note_kfet/static/img/appstore_badge_fr.svg b/note_kfet/static/img/appstore_badge_fr.svg new file mode 100644 index 00000000..329e8dc3 --- /dev/null +++ b/note_kfet/static/img/appstore_badge_fr.svg @@ -0,0 +1,50 @@ + + Download_on_the_App_Store_Badge_FR_RGB_blk_100517 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/note_kfet/static/img/playstore_badge_fr.svg b/note_kfet/static/img/playstore_badge_fr.svg new file mode 100644 index 00000000..17b118eb --- /dev/null +++ b/note_kfet/static/img/playstore_badge_fr.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + DISPONIBLE SUR + \ No newline at end of file diff --git a/note_kfet/templates/registration/login.html b/note_kfet/templates/registration/login.html index b30c9fb6..e83c9d93 100644 --- a/note_kfet/templates/registration/login.html +++ b/note_kfet/templates/registration/login.html @@ -39,6 +39,17 @@ SPDX-License-Identifier: GPL-2.0-or-later {% trans 'Forgotten your password or username?' %} + + {% endblock %} \ No newline at end of file From cae86bcd464179a4b35535ca9cd2f4f33fc61673 Mon Sep 17 00:00:00 2001 From: Alexis Mercier des Rochettes Date: Sat, 1 Nov 2025 16:24:34 +0100 Subject: [PATCH 2/5] apps: display appstore badges based on UA * on iPhone, only AppStore badge displays * on Android, only PlayStore badge displays * on any other platform, both display --- apps/member/views.py | 9 +++++++++ note_kfet/templates/registration/login.html | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/apps/member/views.py b/apps/member/views.py index 72ad446e..84275db1 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -50,6 +50,15 @@ class CustomLoginView(LoginView): self.request.session['permission_mask'] = form.cleaned_data['permission_mask'].rank return super().form_valid(form) + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + user_agent = self.request.META.get('HTTP_USER_AGENT', '').lower() + + context['display_appstore_badge'] = 'iphone' in user_agent or 'android' not in user_agent + context['display_playstore_badge'] = 'android' in user_agent or 'iphone' not in user_agent + + return context + class UserUpdateView(ProtectQuerysetMixin, LoginRequiredMixin, UpdateView): """ diff --git a/note_kfet/templates/registration/login.html b/note_kfet/templates/registration/login.html index e83c9d93..af2a3f5b 100644 --- a/note_kfet/templates/registration/login.html +++ b/note_kfet/templates/registration/login.html @@ -41,14 +41,18 @@ SPDX-License-Identifier: GPL-2.0-or-later
+ {% if display_appstore_badge %} {% trans 'Download on the AppStore' %} + {% endif %} + {% if display_playstore_badge %} {% trans 'Get it on Google Play' %} + {% endif %}
From 37beb8f42173d15e66533467d3da92ca7dd920f0 Mon Sep 17 00:00:00 2001 From: Alexis Mercier des Rochettes Date: Sat, 1 Nov 2025 16:54:42 +0100 Subject: [PATCH 3/5] apps: fix playstore badge google sans font --- note_kfet/static/img/playstore_badge_fr.svg | 48 +++++++++++++-------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/note_kfet/static/img/playstore_badge_fr.svg b/note_kfet/static/img/playstore_badge_fr.svg index 17b118eb..137e9e90 100644 --- a/note_kfet/static/img/playstore_badge_fr.svg +++ b/note_kfet/static/img/playstore_badge_fr.svg @@ -1,6 +1,6 @@ - + - - + + - - - - + + + + + + + + + + + + + + + + + + + + + - DISPONIBLE SUR \ No newline at end of file From e119e2295c75c399710c2257127584c9cc57c4ab Mon Sep 17 00:00:00 2001 From: Alexis Mercier des Rochettes Date: Sat, 1 Nov 2025 17:21:53 +0100 Subject: [PATCH 4/5] apps: add preorder badges * add appstore_badge_fr_preorder.svg static asset * add playstore_badge_fr_preorder.svg static asset * now displays preorder badges instead of download before 01 feb 2026 (estimated availability date) --- .../static/img/appstore_badge_fr_preorder.svg | 220 ++++++++++++++++++ .../img/playstore_badge_fr_preorder.svg | 66 ++++++ note_kfet/templates/registration/login.html | 6 +- 3 files changed, 290 insertions(+), 2 deletions(-) create mode 100644 note_kfet/static/img/appstore_badge_fr_preorder.svg create mode 100644 note_kfet/static/img/playstore_badge_fr_preorder.svg diff --git a/note_kfet/static/img/appstore_badge_fr_preorder.svg b/note_kfet/static/img/appstore_badge_fr_preorder.svg new file mode 100644 index 00000000..c5f3d0e6 --- /dev/null +++ b/note_kfet/static/img/appstore_badge_fr_preorder.svg @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/note_kfet/static/img/playstore_badge_fr_preorder.svg b/note_kfet/static/img/playstore_badge_fr_preorder.svg new file mode 100644 index 00000000..558a7f66 --- /dev/null +++ b/note_kfet/static/img/playstore_badge_fr_preorder.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/note_kfet/templates/registration/login.html b/note_kfet/templates/registration/login.html index af2a3f5b..6523f529 100644 --- a/note_kfet/templates/registration/login.html +++ b/note_kfet/templates/registration/login.html @@ -41,15 +41,17 @@ SPDX-License-Identifier: GPL-2.0-or-later
+ {% now "Ymd" as current_date_str %} + {% if display_appstore_badge %} - {% trans 'Download on the AppStore' %} {% endif %} {% if display_playstore_badge %} - {% trans 'Get it on Google Play' %} {% endif %} From 73b63186fd531ede7fed1001076213a1c4655a16 Mon Sep 17 00:00:00 2001 From: alexismdr Date: Tue, 4 Nov 2025 09:18:27 +0100 Subject: [PATCH 5/5] fix: remove margin below App Store preorder badge --- .../static/img/appstore_badge_fr_preorder.svg | 277 ++++-------------- 1 file changed, 57 insertions(+), 220 deletions(-) diff --git a/note_kfet/static/img/appstore_badge_fr_preorder.svg b/note_kfet/static/img/appstore_badge_fr_preorder.svg index c5f3d0e6..891fe91e 100644 --- a/note_kfet/static/img/appstore_badge_fr_preorder.svg +++ b/note_kfet/static/img/appstore_badge_fr_preorder.svg @@ -1,220 +1,57 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file