Skip to content

Commit 25b10c4

Browse files
authored
order videos in channel or theme (EsupPortail#1232)
authored-by: Charneau Franck @fanfounet
1 parent 062b39e commit 25b10c4

File tree

9 files changed

+34
-17
lines changed

9 files changed

+34
-17
lines changed

pod/locale/fr/LC_MESSAGES/django.mo

131 Bytes
Binary file not shown.

pod/locale/fr/LC_MESSAGES/django.po

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ msgid ""
55
msgstr ""
66
"Project-Id-Version: Pod\n"
77
"Report-Msgid-Bugs-To: \n"
8-
"POT-Creation-Date: 2024-10-17 14:28+0000\n"
8+
"POT-Creation-Date: 2024-11-27 12:02+0100\n"
99
"PO-Revision-Date: \n"
1010
"Last-Translator: obado <[email protected]>\n"
1111
"Language-Team: Pod Team [email protected]\n"
@@ -4703,7 +4703,7 @@ msgstr "Obtenir la taille du fichier"
47034703
msgid "Get the file name"
47044704
msgstr "Obtenir le nom du fichier"
47054705

4706-
#: pod/main/models.py
4706+
#: pod/main/models.py pod/video/models.py
47074707
msgid "order"
47084708
msgstr "ordre"
47094709

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

9131+
#: pod/video/models.py
9132+
msgid "Order videos in channels or themes."
9133+
msgstr "Ordonner les vidéos dans les chaines ou les thèmes."
9134+
91319135
#: pod/video/models.py
91329136
msgid "Overview"
91339137
msgstr "Vue d’ensemble"

pod/locale/fr/LC_MESSAGES/djangojs.po

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ msgid ""
55
msgstr ""
66
"Project-Id-Version: Esup-Pod\n"
77
"Report-Msgid-Bugs-To: \n"
8-
"POT-Creation-Date: 2024-10-17 14:28+0000\n"
8+
"POT-Creation-Date: 2024-11-27 12:02+0100\n"
99
"PO-Revision-Date: \n"
1010
"Last-Translator: obado <[email protected]>\n"
1111
"Language-Team: \n"

pod/locale/nl/LC_MESSAGES/django.po

+16-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ msgid ""
55
msgstr ""
66
"Project-Id-Version: Pod\n"
77
"Report-Msgid-Bugs-To: \n"
8-
"POT-Creation-Date: 2024-10-17 14:28+0000\n"
8+
"POT-Creation-Date: 2024-11-27 12:02+0100\n"
99
"PO-Revision-Date: 2024-07-04 17:54+0200\n"
1010
"Last-Translator: obado <[email protected]>\n"
1111
"Language-Team: \n"
@@ -2771,15 +2771,15 @@ msgstr ""
27712771
#: pod/import_video/views.py
27722772
#, python-format
27732773
msgid ""
2774-
"This video “%(name)s” was uploaded to Pod; its origin is %(type)s: <a "
2775-
"href=\"%(url)s\" target=\"_blank\">%(url)s</a><br><br>%(desc)s"
2774+
"This video “%(name)s” was uploaded to Pod; its origin is %(type)s: <a href="
2775+
"\"%(url)s\" target=\"_blank\">%(url)s</a><br><br>%(desc)s"
27762776
msgstr ""
27772777

27782778
#: pod/import_video/views.py
27792779
#, python-format
27802780
msgid ""
2781-
"This video “%(name)s” was uploaded to Pod; its origin is Youtube: <a "
2782-
"href=\"%(url)s\" target=\"_blank\">%(url)s</a>"
2781+
"This video “%(name)s” was uploaded to Pod; its origin is Youtube: <a href="
2782+
"\"%(url)s\" target=\"_blank\">%(url)s</a>"
27832783
msgstr ""
27842784

27852785
#: pod/import_video/views.py
@@ -4457,7 +4457,7 @@ msgstr ""
44574457
msgid "Get the file name"
44584458
msgstr ""
44594459

4460-
#: pod/main/models.py
4460+
#: pod/main/models.py pod/video/models.py
44614461
msgid "order"
44624462
msgstr ""
44634463

@@ -6145,8 +6145,8 @@ msgstr ""
61456145
msgid ""
61466146
"\n"
61476147
" <p>Hello,</p>\n"
6148-
" <p>%(owner)s invites you to the meeting "
6149-
"<strong>%(meeting_title)s</strong>.</p>\n"
6148+
" <p>%(owner)s invites you to the meeting <strong>"
6149+
"%(meeting_title)s</strong>.</p>\n"
61506150
" <p>here the link to join the meeting:\n"
61516151
" <a href=\"%(join_link)s\">%(join_link)s</a></p>\n"
61526152
" <p>You need this password to enter: <strong>%(password)s</"
@@ -6160,8 +6160,8 @@ msgstr ""
61606160
msgid ""
61616161
"\n"
61626162
" <p>Hello,</p>\n"
6163-
" <p>%(owner)s invites you to the meeting "
6164-
"<strong>%(meeting_title)s</strong>.</p>\n"
6163+
" <p>%(owner)s invites you to the meeting <strong>"
6164+
"%(meeting_title)s</strong>.</p>\n"
61656165
" <p>Start date: %(start_date_time)s </p>\n"
61666166
" <p>End date: %(end_date)s </p>\n"
61676167
" <p>here the link to join the meeting:\n"
@@ -7736,8 +7736,8 @@ msgstr ""
77367736
#: pod/video/templates/videos/video-element.html
77377737
msgid ""
77387738
"To view this video please enable JavaScript, and consider upgrading to a web "
7739-
"browser that <a href=\"https://videojs.com/html5-video-support/\" "
7740-
"target=\"_blank\">supports HTML5 video</a>"
7739+
"browser that <a href=\"https://videojs.com/html5-video-support/\" target="
7740+
"\"_blank\">supports HTML5 video</a>"
77417741
msgstr ""
77427742

77437743
#: pod/recorder/templates/recorder/link_record.html
@@ -8503,6 +8503,10 @@ msgstr ""
85038503
msgid "The channel where you want your content to appear."
85048504
msgstr ""
85058505

8506+
#: pod/video/models.py
8507+
msgid "Order videos in channels or themes."
8508+
msgstr ""
8509+
85068510
#: pod/video/models.py
85078511
msgid "Overview"
85088512
msgstr ""

pod/locale/nl/LC_MESSAGES/djangojs.po

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ msgid ""
55
msgstr ""
66
"Project-Id-Version: Esup-Pod\n"
77
"Report-Msgid-Bugs-To: \n"
8-
"POT-Creation-Date: 2024-10-17 14:28+0000\n"
8+
"POT-Creation-Date: 2024-11-27 12:02+0100\n"
99
"PO-Revision-Date: 2024-06-04 16:20+0200\n"
1010
"Last-Translator: obado <[email protected]>\n"
1111
"Language-Team: \n"

pod/video/forms.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ class VideoForm(forms.ModelForm):
688688
{
689689
"legend": _("Advanced options"),
690690
"classes": "",
691-
"fields": ["allow_downloading", "is_360", "disable_comment"],
691+
"fields": ["allow_downloading", "is_360", "disable_comment", "order"],
692692
},
693693
),
694694
)

pod/video/models.py

+7
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,13 @@ class Video(models.Model):
833833
blank=True,
834834
null=True,
835835
)
836+
order = models.PositiveSmallIntegerField(
837+
_('order'),
838+
help_text=_("Order videos in channels or themes."),
839+
default=1,
840+
blank=True,
841+
null=True,
842+
)
836843
thumbnail = models.ForeignKey(
837844
CustomImageModel,
838845
on_delete=models.SET_NULL,

pod/video/utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ def sort_videos_list(videos_list: list, sort_field: str, sort_direction: str = "
228228
"type",
229229
"viewcount",
230230
"rank",
231+
"order",
231232
}:
232233
if sort_field in {"title", "title_fr", "title_en"}:
233234
sort_field = Lower(sort_field)

pod/video/views.py

+1
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ def paginator(videos_list, page):
359359
def channel(request, slug_c, slug_t=None):
360360
channel = get_object_or_404(Channel, slug=slug_c, site=get_current_site(request))
361361
videos_list = get_available_videos().filter(channel=channel)
362+
videos_list = sort_videos_list(videos_list, "order", "on")
362363
channel.video_count = videos_list.count()
363364

364365
theme = None

0 commit comments

Comments
 (0)