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/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/appstore_badge_fr_preorder.svg b/note_kfet/static/img/appstore_badge_fr_preorder.svg new file mode 100644 index 00000000..891fe91e --- /dev/null +++ b/note_kfet/static/img/appstore_badge_fr_preorder.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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..137e9e90 --- /dev/null +++ b/note_kfet/static/img/playstore_badge_fr.svg @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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 b30c9fb6..6523f529 100644 --- a/note_kfet/templates/registration/login.html +++ b/note_kfet/templates/registration/login.html @@ -39,6 +39,23 @@ SPDX-License-Identifier: GPL-2.0-or-later {% trans 'Forgotten your password or username?' %} + +
+ {% 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 %} +
{% endblock %} \ No newline at end of file