Skip to content

Commit

Permalink
[DONE] Yaal Coop/Add PWA functionality to app and notifications capab…
Browse files Browse the repository at this point in the history
…ilities (EsupPortail#937)

* Add PWA functionality to app and notifications capabilities

Owners can set their notification preference.
Notifications are sent when video encoding is complete.

Co-authored-by: Éloi Rivard <eloi@yaal.coop>
Co-authored-by: Loan Robert <loan.rbrt@gmail.com>

* Implement a PWA installation menu entry

---------

Co-authored-by: Éloi Rivard <eloi@yaal.coop>
  • Loading branch information
2 people authored and vsabatie committed Nov 22, 2023
1 parent 064953b commit 1e93d97
Show file tree
Hide file tree
Showing 39 changed files with 825 additions and 35 deletions.
7 changes: 7 additions & 0 deletions dockerfile-dev-with-volumes/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ MIGRATION_MODULES = {'flatpages': 'pod.db_migrations'}
# pour avoir le maximum de log sur la console
LOGGING = {}
# PUSH NOTIFICATIONS
# Les clés VAPID peuvent être générées avec https://web-push-codelab.glitch.me/
WEBPUSH_SETTINGS = {
"VAPID_PUBLIC_KEY": "",
"VAPID_PRIVATE_KEY": "",
"VAPID_ADMIN_EMAIL": "contact@example.org"
}
----

== Commandes
Expand Down
11 changes: 11 additions & 0 deletions pod/authentication/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ class Meta(object):
fields = []


class SetNotificationForm(forms.ModelForm):
"""Push notification preferences form."""

def __init__(self, *args, **kwargs):
super(SetNotificationForm, self).__init__(*args, **kwargs)

class Meta(object):
model = Owner
fields = ["accepts_notifications"]


User = get_user_model()


Expand Down
6 changes: 6 additions & 0 deletions pod/authentication/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ class Owner(models.Model):
)
accessgroups = models.ManyToManyField("authentication.AccessGroup", blank=True)
sites = models.ManyToManyField(Site)
accepts_notifications = models.BooleanField(
verbose_name=_("Accept notifications"),
default=None,
null=True,
help_text=_("Receive push notifications on your devices."),
)

class Meta:
verbose_name = _("Owner")
Expand Down
123 changes: 100 additions & 23 deletions pod/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ msgstr ""
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
"POT-Creation-Date: 2023-08-30 12:33+0200\n"
=======
"POT-Creation-Date: 2023-07-05 15:50+0200\n"
Expand Down Expand Up @@ -70,6 +71,9 @@ msgstr ""
=======
"POT-Creation-Date: 2023-09-22 16:41+0200\n"
>>>>>>> 21497cba ([DONE] Features for meeting: manage recording with token and send email when BBB recording available (#958))
=======
"POT-Creation-Date: 2023-09-27 12:16+0000\n"
>>>>>>> afb1f348 ([DONE] Yaal Coop/Add PWA functionality to app and notifications capabilities (#937))
"PO-Revision-Date: \n"
"Last-Translator: obado <bado@unice.fr>\n"
"Language-Team: Pod Team pod@esup-portail.org\n"
Expand Down Expand Up @@ -165,6 +169,14 @@ msgstr "Commentaire"
msgid "Picture"
msgstr "Image"

#: pod/authentication/models.py
msgid "Accept notifications"
msgstr "Accepter les notifications"

#: pod/authentication/models.py
msgid "Receive push notifications on your devices."
msgstr "Recevez des notifications push sur vos appareils"

#: pod/authentication/models.py pod/live/models.py pod/meeting/models.py
#: pod/podfile/models.py pod/video/admin.py pod/video/models.py
#: pod/video_search/templates/search/search.html
Expand Down Expand Up @@ -897,6 +909,7 @@ msgstr "Le fichier doit être au format VTT."

#: pod/chapter/models.py pod/completion/models.py pod/enrichment/models.py
#: pod/playlist/templates/playlist/playlist_card.html pod/video/models.py
#: pod/video_encode_transcript/utils.py
msgid "video"
msgstr "vidéo"

Expand Down Expand Up @@ -2368,8 +2381,8 @@ msgid ""
msgstr ""
"Les champs \"Début\" et \"Fin\" doivent contenir des valeurs en secondes. "
"Lancez la lecture de la vidéo, mettez sur pause et cliquez sur \"Récupérer "
"le temps depuis le lecteur\" pour renseigner automatiquement le champ \"Début"
"\". Vous pouvez le faire également pour remplir le champ \"Fin\"."
"le temps depuis le lecteur\" pour renseigner automatiquement le champ "
"\"Début\". Vous pouvez le faire également pour remplir le champ \"Fin\"."

#: pod/enrichment/templates/enrichment/edit_enrichment.html
msgid "You cannot overlap enrichments."
Expand Down Expand Up @@ -2881,6 +2894,7 @@ msgstr ""
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
"Cette vidéo a été téléversée sur Pod ; son origine est %(type)s : <a "
=======
"Cette vidéo a été téléversée sur Pod; son origine est %(type)s : <a "
Expand Down Expand Up @@ -2909,6 +2923,10 @@ msgstr ""
"Cette vidéo a été téléversée sur Pod ; son origine est %(type)s : <a href="
"\"%(url)s\" target=\"_blank\">%(url)s</a>"
>>>>>>> 21497cba ([DONE] Features for meeting: manage recording with token and send email when BBB recording available (#958))
=======
"Cette vidéo a été téléversée sur Pod ; son origine est %(type)s : <a "
"href=\"%(url)s\" target=\"_blank\">%(url)s</a>"
>>>>>>> afb1f348 ([DONE] Yaal Coop/Add PWA functionality to app and notifications capabilities (#937))

#: pod/import_video/views.py pod/meeting/views.py
msgid "Try changing the record type or address for this recording."
Expand All @@ -2919,8 +2937,8 @@ msgstr ""
#: pod/import_video/views.py
#, python-format
msgid ""
"This video '%(name)s' was uploaded to Pod; its origin is Youtube: <a href="
"\"%(url)s\" target=\"_blank\">%(url)s</a>"
"This video '%(name)s' was uploaded to Pod; its origin is Youtube: <a "
"href=\"%(url)s\" target=\"_blank\">%(url)s</a>"
msgstr ""
<<<<<<< HEAD
<<<<<<< HEAD
Expand Down Expand Up @@ -5031,6 +5049,14 @@ msgstr "Mes fichiers"
msgid "Claim a record"
msgstr "Revendiquer un enregistrement"

#: pod/main/templates/navbar.html pod/progressive_web_app/templates/debug.html
msgid "Notifications settings"
msgstr "Paramètres de notifications"

#: pod/main/templates/navbar.html
msgid "Install"
msgstr "Installer"

#: pod/main/templates/navbar.html
msgid "Log out"
msgstr "Déconnexion"
Expand Down Expand Up @@ -5866,16 +5892,16 @@ msgid ""
msgstr ""
"\n"
" <p>Bonjour,\n"
" <p>%(owner)s vous invite à une réunion récurrente <b>"
"%(meeting_title)s</b>.</p>\n"
" <p>%(owner)s vous invite à une réunion récurrente "
"<b>%(meeting_title)s</b>.</p>\n"
" <p>Date de début : %(start_date_time)s </p>\n"
" <p>Récurrent jusqu’à la date : %(end_date)s </p>\n"
" <p>La réunion se tiendra tou(te)s les %(frequency)s %(recurrence)s </"
"p>\n"
" <p>Voici le lien pour rejoindre la réunion :\n"
" <a href=\"%(join_link)s\">%(join_link)s</a></p>\n"
" <p>Vous avez besoin de ce mot de passe pour entrer : <b>"
"%(password)s</b> </p>\n"
" <p>Vous avez besoin de ce mot de passe pour entrer : "
"<b>%(password)s</b> </p>\n"
" <p>Cordialement</p>\n"
" "

Expand All @@ -5901,8 +5927,8 @@ msgstr ""
" <p>Date de fin : %(end_date)s </p>\n"
" <p>Voici le lien pour rejoindre la réunion :\n"
" <a href=\"%(join_link)s\">%(join_link)s</a></p>\n"
" <p>Vous avez besoin de ce mot de passe pour entrer : <b>"
"%(password)s</b> </p>\n"
" <p>Vous avez besoin de ce mot de passe pour entrer : "
"<b>%(password)s</b> </p>\n"
" <p>Cordialement</p>\n"
" "

Expand Down Expand Up @@ -6889,6 +6915,22 @@ msgstr "Vous ne pouvez pas voir ce dossier."
msgid "You cannot edit this file."
msgstr "Vous ne pouvez pas éditer ce fichier."

#: pod/progressive_web_app/templates/notification_toast.html
msgid "Get application notifications"
msgstr "Recevez les notifications de l'application"

#: pod/progressive_web_app/templates/notification_toast.html
msgid ""
"Get notified for specific events (when one of your video encoding is "
"completed)."
msgstr ""
"Recevez des notifications pour des événements spécifiques (lorsque "
"l'encodage d'une de vos vidéos est terminé)"

#: pod/progressive_web_app/templates/notification_toast.html
msgid "Allow"
msgstr "Autoriser"

#: pod/recorder/admin.py
msgid "Delete selected Recording file treatments + source files"
msgstr ""
Expand Down Expand Up @@ -7173,8 +7215,8 @@ msgstr "Prévisualisation d’enregistrement"
#: pod/video/templates/videos/video-element.html
msgid ""
"To view this video please enable JavaScript, and consider upgrading to a web "
"browser that <a href=\"https://videojs.com/html5-video-support/\" target="
"\"_blank\">supports HTML5 video</a>"
"browser that <a href=\"https://videojs.com/html5-video-support/\" "
"target=\"_blank\">supports HTML5 video</a>"
msgstr ""
"Pour visionner cette vidéo, veuillez activer JavaScript et envisager de "
"passer à un navigateur Web qui <a href=\"https://videojs.com/html5-video-"
Expand Down Expand Up @@ -7253,9 +7295,10 @@ msgid ""
msgstr ""
"Bonjour, <p>un nouvel enregistrement a été ajouté sur la plateforme "
"%(title_site)s à partir de l’enregistreur \"%(recorder)s\".<br>Pour "
"l’ajouter, cliquez sur le lien ci dessous.</p><a href=\"%(link_url)s\">"
"%(link_url)s</a><br><i>Si le lien n’est pas actif, il faut le copier-coller "
"dans la barre d’adresse de votre navigateur.</i><p><p>Cordialement</p>"
"l’ajouter, cliquez sur le lien ci dessous.</p><a "
"href=\"%(link_url)s\">%(link_url)s</a><br><i>Si le lien n’est pas actif, il "
"faut le copier-coller dans la barre d’adresse de votre navigateur.</"
"i><p><p>Cordialement</p>"

#: pod/recorder/views.py
msgid "New recording added."
Expand All @@ -7269,6 +7312,17 @@ msgstr "L’enregistrement a été supprimé."
msgid "Recorder for Studio not found."
msgstr "Enregistreur studio non trouvé."

#: pod/settings.py
msgid ""
"Pod is aimed at users of our institutions, by allowing the publication of "
"videos in the fields of research (promotion of platforms, etc.), training "
"(tutorials, distance training, student reports, etc.), institutional life "
"(video of events), offering several days of content."
msgstr ""
"Pod a pour but de faciliter la mise à disposition de vidéo et de ce "
"fait, d’encourager l’utilisation de celles-ci dans le cadre de "
"l’enseignement et la recherche."

#: pod/urls.py
msgid "Pod Administration"
msgstr "Administration de Pod"
Expand Down Expand Up @@ -7603,8 +7657,8 @@ msgid ""
"%(url)s</a></p>\n"
msgstr ""
"vous pouvez changer la date de suppression en éditant votre vidéo :</p>\n"
"<p><a href=\"%(scheme)s:%(url)s\" rel=\"noopener\" target=\"_blank\">"
"%(scheme)s:%(url)s</a></p>\n"
"<p><a href=\"%(scheme)s:%(url)s\" rel=\"noopener\" "
"target=\"_blank\">%(scheme)s:%(url)s</a></p>\n"
"\n"

#: pod/video/management/commands/check_obsolete_videos.py
Expand Down Expand Up @@ -7813,10 +7867,6 @@ msgstr ""
msgid "Date of event"
msgstr "Date de l’évènement"

#: pod/video/models.py
msgid "The password is / will be encrypted."
msgstr "Le mot de passe est / sera encrypté."

#: pod/video/models.py
msgid "Overview"
msgstr "Vue d’ensemble"
Expand Down Expand Up @@ -8361,8 +8411,8 @@ msgid ""
"This video is chaptered. Click the chapter button <span class=\"vjs-icon-"
"chapters\"></span> on the video player to view them."
msgstr ""
"Cette vidéo est chapitrée. Cliquez sur le bouton de chapitre <span class="
"\"vjs-icon-chapters\"></span> sur le lecteur vidéo pour les voir."
"Cette vidéo est chapitrée. Cliquez sur le bouton de chapitre <span "
"class=\"vjs-icon-chapters\"></span> sur le lecteur vidéo pour les voir."

#: pod/video/templates/videos/video-all-info.html
msgid "Other versions"
Expand Down Expand Up @@ -9184,6 +9234,24 @@ msgstr "le :"
msgstr "le :"
>>>>>>> 84406de6 ([DONE] RGAA 03.02 (#951))

#: pod/video_encode_transcript/utils.py
#, fuzzy
#| msgid "Content"
msgid "content"
msgstr "Contenu"

#: pod/video_encode_transcript/utils.py
#, fuzzy
#| msgid "Transcript"
msgid "Transcripting"
msgstr "Transcrire"

#: pod/video_encode_transcript/utils.py
#, fuzzy
#| msgid "automatically transcripted"
msgid "automatically transcript"
msgstr "automatiquement transcrit"

#: pod/video_search/apps.py
msgid "Video search"
msgstr "Recherche de vidéo"
Expand Down Expand Up @@ -9212,6 +9280,7 @@ msgstr "Résultats de la recherche"
msgid "Esup-Pod xAPI"
msgstr "xAPI Esup-Pod"
<<<<<<< HEAD
<<<<<<< HEAD

<<<<<<< HEAD
<<<<<<< HEAD
Expand Down Expand Up @@ -9301,3 +9370,11 @@ msgstr "xAPI Esup-Pod"
#~ msgstr "publié"
=======
>>>>>>> 84406de6 ([DONE] RGAA 03.02 (#951))
=======

#~ msgid "Deny on all devices"
#~ msgstr "Refuser sur tous les appareils"

#~ msgid "The password is / will be encrypted."
#~ msgstr "Le mot de passe est / sera encrypté."
>>>>>>> afb1f348 ([DONE] Yaal Coop/Add PWA functionality to app and notifications capabilities (#937))
Binary file modified pod/locale/fr/LC_MESSAGES/djangojs.mo
Binary file not shown.
Loading

0 comments on commit 1e93d97

Please sign in to comment.