Skip to content

Commit

Permalink
order videos in channel or theme (#1232)
Browse files Browse the repository at this point in the history
authored-by: Charneau Franck @fanfounet
  • Loading branch information
fanfounet authored Nov 28, 2024
1 parent 062b39e commit 25b10c4
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 17 deletions.
Binary file modified pod/locale/fr/LC_MESSAGES/django.mo
Binary file not shown.
8 changes: 6 additions & 2 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-10-17 14:28+0000\n"
"POT-Creation-Date: 2024-11-27 12:02+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: obado <[email protected]>\n"
"Language-Team: Pod Team [email protected]\n"
Expand Down Expand Up @@ -4703,7 +4703,7 @@ msgstr "Obtenir la taille du fichier"
msgid "Get the file name"
msgstr "Obtenir le nom du fichier"

#: pod/main/models.py
#: pod/main/models.py pod/video/models.py
msgid "order"
msgstr "ordre"

Expand Down Expand Up @@ -9128,6 +9128,10 @@ msgstr "Date de l’évènement"
msgid "The channel where you want your content to appear."
msgstr "La chaîne où vous voulez que votre contenu apparaisse."

#: pod/video/models.py
msgid "Order videos in channels or themes."
msgstr "Ordonner les vidéos dans les chaines ou les thèmes."

#: pod/video/models.py
msgid "Overview"
msgstr "Vue d’ensemble"
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-10-17 14:28+0000\n"
"POT-Creation-Date: 2024-11-27 12:02+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: obado <[email protected]>\n"
"Language-Team: \n"
Expand Down
28 changes: 16 additions & 12 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-10-17 14:28+0000\n"
"POT-Creation-Date: 2024-11-27 12:02+0100\n"
"PO-Revision-Date: 2024-07-04 17:54+0200\n"
"Last-Translator: obado <[email protected]>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -2771,15 +2771,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 @@ -4457,7 +4457,7 @@ msgstr ""
msgid "Get the file name"
msgstr ""

#: pod/main/models.py
#: pod/main/models.py pod/video/models.py
msgid "order"
msgstr ""

Expand Down Expand Up @@ -6145,8 +6145,8 @@ msgstr ""
msgid ""
"\n"
" <p>Hello,</p>\n"
" <p>%(owner)s invites you to the meeting "
"<strong>%(meeting_title)s</strong>.</p>\n"
" <p>%(owner)s invites you to the meeting <strong>"
"%(meeting_title)s</strong>.</p>\n"
" <p>here the link to join the meeting:\n"
" <a href=\"%(join_link)s\">%(join_link)s</a></p>\n"
" <p>You need this password to enter: <strong>%(password)s</"
Expand All @@ -6160,8 +6160,8 @@ msgstr ""
msgid ""
"\n"
" <p>Hello,</p>\n"
" <p>%(owner)s invites you to the meeting "
"<strong>%(meeting_title)s</strong>.</p>\n"
" <p>%(owner)s invites you to the meeting <strong>"
"%(meeting_title)s</strong>.</p>\n"
" <p>Start date: %(start_date_time)s </p>\n"
" <p>End date: %(end_date)s </p>\n"
" <p>here the link to join the meeting:\n"
Expand Down Expand Up @@ -7736,8 +7736,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 @@ -8503,6 +8503,10 @@ msgstr ""
msgid "The channel where you want your content to appear."
msgstr ""

#: pod/video/models.py
msgid "Order videos in channels or themes."
msgstr ""

#: pod/video/models.py
msgid "Overview"
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-10-17 14:28+0000\n"
"POT-Creation-Date: 2024-11-27 12:02+0100\n"
"PO-Revision-Date: 2024-06-04 16:20+0200\n"
"Last-Translator: obado <[email protected]>\n"
"Language-Team: \n"
Expand Down
2 changes: 1 addition & 1 deletion pod/video/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ class VideoForm(forms.ModelForm):
{
"legend": _("Advanced options"),
"classes": "",
"fields": ["allow_downloading", "is_360", "disable_comment"],
"fields": ["allow_downloading", "is_360", "disable_comment", "order"],
},
),
)
Expand Down
7 changes: 7 additions & 0 deletions pod/video/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,13 @@ class Video(models.Model):
blank=True,
null=True,
)
order = models.PositiveSmallIntegerField(
_('order'),
help_text=_("Order videos in channels or themes."),
default=1,
blank=True,
null=True,
)
thumbnail = models.ForeignKey(
CustomImageModel,
on_delete=models.SET_NULL,
Expand Down
1 change: 1 addition & 0 deletions pod/video/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def sort_videos_list(videos_list: list, sort_field: str, sort_direction: str = "
"type",
"viewcount",
"rank",
"order",
}:
if sort_field in {"title", "title_fr", "title_en"}:
sort_field = Lower(sort_field)
Expand Down
1 change: 1 addition & 0 deletions pod/video/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ def paginator(videos_list, page):
def channel(request, slug_c, slug_t=None):
channel = get_object_or_404(Channel, slug=slug_c, site=get_current_site(request))
videos_list = get_available_videos().filter(channel=channel)
videos_list = sort_videos_list(videos_list, "order", "on")
channel.video_count = videos_list.count()

theme = None
Expand Down

0 comments on commit 25b10c4

Please sign in to comment.