diff --git a/pod/live/templates/live/live.html b/pod/live/templates/live/live.html index 6d7d8e24b2..cfbb7540ba 100644 --- a/pod/live/templates/live/live.html +++ b/pod/live/templates/live/live.html @@ -129,6 +129,15 @@

{% trans 'Send message' %}

{% block page_aside %} +{% if request.user.is_superuser %} +
+
 {% trans "Manage live"%}
+
+ + +
+
+{% endif %}
diff --git a/pod/locale/fr/LC_MESSAGES/django.mo b/pod/locale/fr/LC_MESSAGES/django.mo index 9c512d10e2..96fa4db792 100644 Binary files a/pod/locale/fr/LC_MESSAGES/django.mo and b/pod/locale/fr/LC_MESSAGES/django.mo differ diff --git a/pod/locale/fr/LC_MESSAGES/django.po b/pod/locale/fr/LC_MESSAGES/django.po index bfbf7acd39..36578ab450 100644 --- a/pod/locale/fr/LC_MESSAGES/django.po +++ b/pod/locale/fr/LC_MESSAGES/django.po @@ -1068,7 +1068,7 @@ msgstr "sous-titres" #: pod/completion/models.py:44 msgid "captions" -msgstr "sous titres" +msgstr "légendes" #: pod/completion/models.py:59 msgid "lastname / firstname" diff --git a/pod/locale/fr/LC_MESSAGES/djangojs.mo b/pod/locale/fr/LC_MESSAGES/djangojs.mo index e7f3ecd828..08b7c976e0 100644 Binary files a/pod/locale/fr/LC_MESSAGES/djangojs.mo and b/pod/locale/fr/LC_MESSAGES/djangojs.mo differ diff --git a/pod/locale/nl/LC_MESSAGES/django.mo b/pod/locale/nl/LC_MESSAGES/django.mo index 5f4127dddb..6cd02ab317 100644 Binary files a/pod/locale/nl/LC_MESSAGES/django.mo and b/pod/locale/nl/LC_MESSAGES/django.mo differ diff --git a/pod/locale/nl/LC_MESSAGES/djangojs.mo b/pod/locale/nl/LC_MESSAGES/djangojs.mo index 23f46f056c..2e4dc31b55 100644 Binary files a/pod/locale/nl/LC_MESSAGES/djangojs.mo and b/pod/locale/nl/LC_MESSAGES/djangojs.mo differ diff --git a/pod/playlist/static/js/playlist.js b/pod/playlist/static/js/playlist.js index 478ab395d6..f68790dd8d 100644 --- a/pod/playlist/static/js/playlist.js +++ b/pod/playlist/static/js/playlist.js @@ -161,22 +161,34 @@ $(window).ready(function () { } }); - $("#info-video").on("click", ".playlist-item", function () { - const vmslug = window.location.href.match(/video\/(\d{4}\-[^/?]*)/); - if (!vmslug) { + $("#info-video").on("click", ".playlist-item", function (e) { + e.preventDefault(); + const url = window.location.href; + const regex = new RegExp('(.*)/video/(\\d+-(.*))/'); + const checkslug = regex.test(url); + const foundslug = url.match(regex); + if (!checkslug) { showalert( gettext("The video can not be added from this page."), "alert-danger" ); return; } - const slug = $(this).attr("data-slug"), - jqxhr = $.ajax({ + if (!foundslug[2]) { + showalert( + gettext("The video slug not found."), + "alert-danger" + ); + return; + } + const slug = $(this).attr("data-slug"); + const link = $(this); + const jqxhr = $.ajax({ method: "POST", url: "/playlist/edit/" + slug + "/", data: { action: "add", - video: vmslug[1], + video: foundslug[2], csrfmiddlewaretoken: $(this) .parents(".dropdown-menu") .find("input") @@ -195,7 +207,8 @@ $(window).ready(function () { } else { if (response.success) { showalert(response.success, "alert-success"); - window.location.reload(); + //window.location.reload(); //hide link playlist + link.addClass("disabled").removeClass("playlist-item").append('') } else { showalert(response.fail, "alert-danger"); } diff --git a/pod/playlist/templates/playlist/playlist_list.html b/pod/playlist/templates/playlist/playlist_list.html index 1cfa557796..0fe1a2bcb5 100644 --- a/pod/playlist/templates/playlist/playlist_list.html +++ b/pod/playlist/templates/playlist/playlist_list.html @@ -17,7 +17,7 @@
{% blocktrans count counter=playlist.v
{% trans 'Edit' %}   - {% if playlist.first.video.slug %} + {% if playlist.videos %} {% trans 'Launch' %} {% endif %}
diff --git a/pod/video/templates/channel/channel.html b/pod/video/templates/channel/channel.html index 42c319d397..2aba7a9acd 100644 --- a/pod/video/templates/channel/channel.html +++ b/pod/video/templates/channel/channel.html @@ -60,7 +60,7 @@

{% if theme %} {% trans 'Statistics views' %} {% else %} - {% trans 'Statistics views' %} + {% trans 'Statistics views' %} {% endif %} {% endif %} {% if theme %} @@ -109,12 +109,16 @@

{{title}}

{% endif %}
-

{% blocktrans count counter=videos|length %}{{ counter }} video found{% plural %}{{ counter }} videos found{% endblocktrans %}

- {% include "videos/video_list.html" %} - {% if has_more_videos %} -
- -
+ {% if videos %} +

+ {% blocktrans count counter=count_videos %}{{ counter }} video found{% plural %}{{ counter }} videos found{% endblocktrans %} +

+ {% include "videos/video_list.html" %} + {% if has_more_videos %} +
+ +
+ {% endif %} {% endif %}
diff --git a/pod/video/templates/videos/video-all-info.html b/pod/video/templates/videos/video-all-info.html index 276b09e7f1..cef04adc72 100644 --- a/pod/video/templates/videos/video-all-info.html +++ b/pod/video/templates/videos/video-all-info.html @@ -90,11 +90,13 @@

diff --git a/pod/video/tests/test_views.py b/pod/video/tests/test_views.py index 0b56acad81..e9cf1ca14d 100644 --- a/pod/video/tests/test_views.py +++ b/pod/video/tests/test_views.py @@ -82,6 +82,7 @@ def test_regroup_videos_by_theme(self): "has_more_themes": False, "has_more_videos": False, "videos": [self.v], + "count_videos": 1, "count_themes": 1, "theme": None, "channel": self.c, @@ -126,6 +127,7 @@ def test_regroup_videos_by_theme(self): ) expected.pop("next_videos", None) expected.pop("has_more_videos", None) + expected.pop("count_videos", None) self.assertEqual(response.status_code, HTTPStatus.OK) self.assertCountEqual(expected, response.json()) @@ -138,6 +140,7 @@ def test_regroup_videos_by_theme(self): ) expected["next_videos"] = None expected["has_more_videos"] = False + expected["count_videos"] = 1 expected.pop("next", None) expected.pop("previous", None) diff --git a/pod/video/views.py b/pod/video/views.py index 80983f1573..1cbff90847 100644 --- a/pod/video/views.py +++ b/pod/video/views.py @@ -193,6 +193,7 @@ def _regroup_videos_by_theme(request, videos, channel, theme=None): response = { **response, "videos": list(videos), + "count_videos": count, "has_more_videos": (offset + limit) < count, }