Skip to content

Commit

Permalink
[DONE] Correctly counts the number of sub-theme videos in a theme (#1068
Browse files Browse the repository at this point in the history
)

* Correctly counts the number of sub-theme videos in a theme

* Displays different messages according to channel / theme / sub-theme level

* Translations added

* Add type hint, refactor some source code and manage theme as serializable (in the new function) so that tests pass
  • Loading branch information
LoicBonavent authored Mar 8, 2024
1 parent 6a190f0 commit a1c1a20
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 71 deletions.
89 changes: 49 additions & 40 deletions pod/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Pod\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-01 13:49+0100\n"
"POT-Creation-Date: 2024-03-06 12:13+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: obado <[email protected]>\n"
"Language-Team: Pod Team [email protected]\n"
Expand Down Expand Up @@ -2579,8 +2579,8 @@ msgid ""
"a>."
msgstr ""
"L’accès à l’ajout d’enregistrements externes a été limité. Si vous souhaitez "
"ajouter des enregistrements externes sur la plateforme, veuillez <a "
"href=\"%(url)s\">nous contacter</a>."
"ajouter des enregistrements externes sur la plateforme, veuillez <a href="
"\"%(url)s\">nous contacter</a>."

#: pod/import_video/templates/import_video/add_or_edit.html
msgid ""
Expand Down Expand Up @@ -2970,17 +2970,17 @@ msgstr ""
#: pod/import_video/views.py
#, python-format
msgid ""
"This video “%(name)s” was uploaded to Pod; its origin is %(type)s: <a "
"href=\"%(url)s\" target=\"_blank\">%(url)s</a><br><br>%(desc)s"
"This video “%(name)s” was uploaded to Pod; its origin is %(type)s: <a href="
"\"%(url)s\" target=\"_blank\">%(url)s</a><br><br>%(desc)s"
msgstr ""
"Cette vidéo « %(name)s » a été téléversée sur Pod ; son origine est "
"%(type)s : <a href=\"%(url)s\" target=\"_blank\">%(url)s</a><br><br>%(desc)s"

#: 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 ""
"Cette vidéo « %(name)s » a été téléversée sur Pod ; son origine est "
"Youtube : <a href=\"%(url)s\" target=\"_blank\">%(url)s</a>"
Expand Down Expand Up @@ -4822,17 +4822,6 @@ msgstr "Onglet additionnel de chaînes"
msgid "Additional channel Tabs"
msgstr "Onglets additionnels de chaînes"

#: pod/main/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éos et de ce fait, "
"d’encourager l’utilisation de celles-ci dans le cadre de l’enseignement et "
"la recherche."

#: pod/main/templates/403.html
msgid "Permission denied"
msgstr "Accès refusé"
Expand Down Expand Up @@ -5956,16 +5945,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 @@ -5991,8 +5980,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 @@ -7045,8 +7034,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 @@ -7123,10 +7112,9 @@ msgid ""
msgstr ""
"<p>Bonjour,<br> 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><p><a "
"href=\"%(link_url)s\">%(link_url)s</a><br><em>Si le lien n’est pas actif, il "
"faut le copier-coller dans la barre d’adresse de votre navigateur.</em></"
"p><p>Cordialement.</p>"
"l’ajouter, cliquez sur le lien ci-dessous.</p><p><a href=\"%(link_url)s\">"
"%(link_url)s</a><br><em>Si le lien n’est pas actif, il faut le copier-coller "
"dans la barre d’adresse de votre navigateur.</em></p><p>Cordialement.</p>"

#: pod/recorder/views.py
msgid "New recording added."
Expand Down Expand Up @@ -7475,8 +7463,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 @@ -7896,12 +7884,16 @@ msgstr[0] "%(counter)s thème trouvé dans cette chaine"
msgstr[1] "%(counter)s thèmes trouvés dans cette chaine"

#: pod/video/templates/channel/channel.html
#: pod/video/templates/videos/dashboard.html
#, python-format
msgid "%(counter)s video"
msgid_plural "%(counter)s videos"
msgstr[0] "%(counter)s vidéo"
msgstr[1] "%(counter)s vidéos"
msgid "%(counter)s video for this channel"
msgid_plural "%(counter)s videos for this channel"
msgstr[0] "%(counter)s vidéo trouvée dans cette chaine"
msgstr[1] "%(counter)s vidéos trouvées dans cette chaine"

#: pod/video/templates/channel/channel.html
msgid "%(counter)s subtheme found for this theme"
msgid_plural "%(counter)s subthemes found for this theme"
msgstr[0] "%(counter)s sous-thème trouvé dans ce thème"
msgstr[1] "%(counter)s sous-thèmes trouvés dans ce thème"

# python-format
#: pod/video/templates/channel/channel.html
Expand Down Expand Up @@ -8196,6 +8188,13 @@ msgstr "Nouvelle valeur pour le champ %(field_label)s"
msgid "No video found"
msgstr "Aucune vidéo trouvée."

#: pod/video/templates/videos/dashboard.html
#, python-format
msgid "%(counter)s video"
msgid_plural "%(counter)s videos"
msgstr[0] "%(counter)s vidéo"
msgstr[1] "%(counter)s vidéos"

#: pod/video/templates/videos/dashboard.html
msgid "Clear selection"
msgstr "Effacer la sélection"
Expand Down Expand Up @@ -8320,8 +8319,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 @@ -9278,6 +9277,16 @@ msgstr "Résultats de la recherche"
msgid "Esup-Pod xAPI"
msgstr "xAPI Esup-Pod"

#~ 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éos et de ce "
#~ "fait, d’encourager l’utilisation de celles-ci dans le cadre de "
#~ "l’enseignement et la recherche."

#~ msgid "The HTML file for this recording was not found on the server."
#~ msgstr ""
#~ "Le fichier HTML de cet enregistrement est introuvable sur le serveur."
Expand Down
2 changes: 1 addition & 1 deletion pod/locale/fr/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Esup-Pod\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-01 13:49+0100\n"
"POT-Creation-Date: 2024-03-06 12:13+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: obado <[email protected]>\n"
"Language-Team: \n"
Expand Down
41 changes: 23 additions & 18 deletions pod/locale/nl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Pod\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-01 13:49+0100\n"
"POT-Creation-Date: 2024-03-06 12:13+0100\n"
"PO-Revision-Date: 2023-06-08 14:37+0200\n"
"Last-Translator: obado <[email protected]>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -2787,15 +2787,15 @@ msgstr ""
#: pod/import_video/views.py
#, python-format
msgid ""
"This video “%(name)s” was uploaded to Pod; its origin is %(type)s: <a "
"href=\"%(url)s\" target=\"_blank\">%(url)s</a><br><br>%(desc)s"
"This video “%(name)s” was uploaded to Pod; its origin is %(type)s: <a href="
"\"%(url)s\" target=\"_blank\">%(url)s</a><br><br>%(desc)s"
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 ""

#: pod/import_video/views.py
Expand Down Expand Up @@ -4563,14 +4563,6 @@ msgstr ""
msgid "Additional channel Tabs"
msgstr ""

#: pod/main/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/main/templates/403.html
msgid "Permission denied"
msgstr ""
Expand Down Expand Up @@ -6637,8 +6629,8 @@ msgstr ""
#: 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 ""

#: pod/recorder/templates/recorder/link_record.html
Expand Down Expand Up @@ -7394,10 +7386,16 @@ msgstr[0] ""
msgstr[1] ""

#: pod/video/templates/channel/channel.html
#: pod/video/templates/videos/dashboard.html
#, python-format
msgid "%(counter)s video"
msgid_plural "%(counter)s videos"
msgid "%(counter)s video for this channel"
msgid_plural "%(counter)s videos for this channel"
msgstr[0] ""
msgstr[1] ""

#: pod/video/templates/channel/channel.html
#, python-format
msgid "%(counter)s subtheme found for this theme"
msgid_plural "%(counter)s subthemes found for this theme"
msgstr[0] ""
msgstr[1] ""

Expand Down Expand Up @@ -7676,6 +7674,13 @@ msgstr ""
msgid "No video found"
msgstr ""

#: pod/video/templates/videos/dashboard.html
#, python-format
msgid "%(counter)s video"
msgid_plural "%(counter)s videos"
msgstr[0] ""
msgstr[1] ""

#: pod/video/templates/videos/dashboard.html
msgid "Clear selection"
msgstr ""
Expand Down
2 changes: 1 addition & 1 deletion pod/locale/nl/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Esup-Pod\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-01 13:49+0100\n"
"POT-Creation-Date: 2024-03-06 12:13+0100\n"
"PO-Revision-Date: 2023-02-08 15:22+0100\n"
"Last-Translator: obado <[email protected]>\n"
"Language-Team: \n"
Expand Down
14 changes: 10 additions & 4 deletions pod/video/templates/channel/channel.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,17 @@ <h2 class="parent_title">{{title}}</h2>
<!-- THEME SECTION -->
<section class="theme-section">
<p class="theme-count">
{% if count_themes > 0 %}
{% blocktrans count counter=count_themes %}{{ counter }} theme found for this channel{% plural %}{{ counter }} themes found for this channel{% endblocktrans %}
-
{% if not parent_title %}
{% if count_themes > 0 %}
{% blocktrans count counter=count_themes %}{{ counter }} theme found for this channel{% plural %}{{ counter }} themes found for this channel{% endblocktrans %}
-
{% endif %}
{% blocktrans count counter=channel.video_count %}{{counter}} video for this channel{% plural %}{{counter}} videos for this channel{% endblocktrans %}
{% else %}
{% if count_themes > 0 %}
{% blocktrans count counter=count_themes %}{{ counter }} subtheme found for this theme{% plural %}{{ counter }} subthemes found for this theme{% endblocktrans %}
{% endif %}
{% endif %}
{% blocktrans count counter=channel.video_count %}{{counter}} video{% plural %}{{counter}} videos{% endblocktrans %}
</p>
{% if theme_children|length %}
<div class="scroll_wrapper">
Expand Down
Loading

0 comments on commit a1c1a20

Please sign in to comment.