From abdf253aac03af64c6b17cfb97161ac5eeffccc7 Mon Sep 17 00:00:00 2001 From: percidae Date: Sun, 18 Feb 2024 15:24:50 +0100 Subject: [PATCH] Improved dashboard overview, slight tweaks to the sequence of data, showing talks needing a draft subtitle --- www/templates/dashboard.html | 259 +++++++++++++++++++++-------------- www/views.py | 25 ++-- 2 files changed, 168 insertions(+), 116 deletions(-) diff --git a/www/templates/dashboard.html b/www/templates/dashboard.html index 9d83c5e..1c52313 100755 --- a/www/templates/dashboard.html +++ b/www/templates/dashboard.html @@ -8,37 +8,43 @@

C3Subtitles Dashboard

{% if user.is_authenticated %}
-

[] Talks which need timing

+

[] Talks which need timing

- {% for any_talk in talks_needing_timing %} -

{{any_talk.id}} {{any_talk.title}}

+ {% for any_subt in subtitles_needing_timing %} +

{{any_subt.talk.id}} {{any_subt.talk.title}}

+
Internal Comment
+ {% if any_subt.talk.internal_comment != "" %} +
{{any_subt.talk.internal_comment}}
+ {% else %} +
-
+ {% endif %}
C3S Link
-
Link
-
Admin Link
-
Link
+
Link
+
Talk Admin Link
+
Link
+
Talk Admin Link
+
Link Adm Overview
+
Subt Admin Link
+
Link
+
Subt Admin Link
+
Link Adm Overview
Amara Link
- {% if any_talk.amara_key != "" %} -
Link
+ {% if any_subt.talk.amara_key != "" %} +
Link
{% else %}
-
{% endif %}
Pad Link
- {% if any_talk.link_to_writable_pad != "" %} -
Link
+ {% if any_subt.talk.link_to_writable_pad != "" %} +
Link
{% else %}
-
{% endif %}
Event
-
{{any_talk.event}}
+
{{any_subt.talk.event}}
Frab ID
-
{{any_talk.frab_id_talk}}
-
Internal Comment
- {% if any_talk.internal_comment != "" %} -
{{any_talk.internal_comment}}
- {% else %} -
-
- {% endif %} +
{{any_subt.talk.frab_id_talk}}

{%endfor%} @@ -49,6 +55,12 @@

[{{any_talk.id}} {{any_talk.title}}

+
Internal Comment
+ {% if any_talk.internal_comment != "" %} +
{{any_talk.internal_comment}}
+ {% else %} +
-
+ {% endif %}
C3S Link
Link
Admin Link
@@ -75,12 +87,6 @@

{{any_talk.id}} {{any_talk.title}}

{% for speaker in any_talk.persons.all %}
{{speaker.name}}
{% endfor %} -
Internal Comment
- {% if any_talk.internal_comment != "" %} -
{{any_talk.internal_comment}}
- {% else %} -
-
- {% endif %}

{%endfor%} @@ -91,6 +97,12 @@

[{{any_talk.id}} {{any_talk.title}}

+
Internal Comment
+ {% if any_talk.internal_comment != "" %} +
{{any_talk.internal_comment}}
+ {% else %} +
-
+ {% endif %}
C3S Link
Link
Admin Link
@@ -117,12 +129,6 @@

{{any_talk.id}} {{any_talk.title}}

{% for speaker in any_talk.persons.all %}
{{speaker.name}}
{% endfor %} -
Internal Comment
- {% if any_talk.internal_comment != "" %} -
{{any_talk.internal_comment}}
- {% else %} -
-
- {% endif %}

{%endfor%} @@ -133,6 +139,11 @@

[{{any_talk.id}} {{any_talk.title}}

+ {% if any_talk.internal_comment != "" %} +
{{any_talk.internal_comment}}
+ {% else %} +
-
+ {% endif %}
C3S Link
Link
Admin Link
@@ -146,11 +157,6 @@

{{any_talk.id}} {{any_talk.title}}

Frab ID
{{any_talk.frab_id_talk}}
Internal Comment
- {% if any_talk.internal_comment != "" %} -
{{any_talk.internal_comment}}
- {% else %} -
-
- {% endif %}

{%endfor%} @@ -161,6 +167,12 @@

[{{any_talk.id}} {{any_talk.title}}

+
Internal Comment
+ {% if any_talk.internal_comment != "" %} +
{{any_talk.internal_comment}}
+ {% else %} +
-
+ {% endif %}
C3S Link
Link
Admin Link
@@ -173,12 +185,6 @@

{{any_talk.id}} {{any_talk.title}}

{{any_talk.event}}
Frab ID
{{any_talk.frab_id_talk}}
-
Internal Comment
- {% if any_talk.internal_comment != "" %} -
{{any_talk.internal_comment}}
- {% else %} -
-
- {% endif %}

{%endfor%} @@ -192,6 +198,12 @@

[{{any_talk.id}} {{any_talk.title}}

+
Internal Comment
+ {% if any_talk.internal_comment != "" %} +
{{any_talk.internal_comment}}
+ {% else %} +
-
+ {% endif %}
C3S Link
Link
Admin Link
@@ -200,12 +212,6 @@

{{any_talk.id}} {{any_talk.title}}

{{any_talk.event}}
Frab ID
{{any_talk.frab_id_talk}}
-
Internal Comment
- {% if any_talk.internal_comment != "" %} -
{{any_talk.internal_comment}}
- {% else %} -
-
- {% endif %}

{%endfor%} @@ -216,6 +222,12 @@

[{{any_talk.id}} {{any_talk.title}}

+
Internal Comment
+ {% if any_talk.internal_comment != "" %} +
{{any_talk.internal_comment}}
+ {% else %} +
-
+ {% endif %}
C3S Link
Link
Amara Link
@@ -230,12 +242,6 @@

{{any_talk.id}} {{any_talk.title}}

{{any_talk.event}}
Frab ID
{{any_talk.frab_id_talk}}
-
Internal Comment
- {% if any_talk.internal_comment != "" %} -
{{any_talk.internal_comment}}
- {% else %} -
-
- {% endif %}

{%endfor%} @@ -246,6 +252,12 @@

[{{any_talk.id}} {{any_talk.title}}

+
Internal Comment
+ {% if any_talk.internal_comment != "" %} +
{{any_talk.internal_comment}}
+ {% else %} +
-
+ {% endif %}
C3S Link
Link
Amara Link
@@ -268,12 +280,6 @@

{{any_talk.id}} {{any_talk.title}}

{{any_talk.event}}
Frab ID
{{any_talk.frab_id_talk}}
-
Internal Comment
- {% if any_talk.internal_comment != "" %} -
{{any_talk.internal_comment}}
- {% else %} -
-
- {% endif %}

{%endfor%} @@ -284,6 +290,12 @@

[{{any_talk.id}} {{any_talk.title}}

+
Internal Comment
+ {% if any_talk.internal_comment != "" %} +
{{any_talk.internal_comment}}
+ {% else %} +
-
+ {% endif %}
C3S Link
Link
Admin Link
@@ -300,12 +312,6 @@

{{any_talk.id}} {{any_talk.title}}

{{any_talk.frab_id_talk}}
Language:
{{any_talk.orig_language}}
-
Internal Comment
- {% if any_talk.internal_comment != "" %} -
{{any_talk.internal_comment}}
- {% else %} -
-
- {% endif %}

{%endfor%} @@ -316,6 +322,12 @@

[{{any_talk.id}} {{any_talk.title}}

+
Internal Comment
+ {% if any_talk.internal_comment != "" %} +
{{any_talk.internal_comment}}
+ {% else %} +
-
+ {% endif %}
C3S Link
Link
Admin Link
@@ -330,17 +342,55 @@

{{any_talk.id}} {{any_talk.title}}

{{any_talk.event}}
Frab ID
{{any_talk.frab_id_talk}}
+
+
+ {%endfor%} +
+ +

[] Talk visible in right state but no draft subtitle

+
+ {% for any_subt in subtitles_from_talks_needing_draft_subtitle %} +

{{any_subt.talk.id}} {{any_subt.talk.title}}

+
Internal Comment
- {% if any_talk.internal_comment != "" %} -
{{any_talk.internal_comment}}
+ {% if any_subt.talk.internal_comment != "" %} +
{{any_subt.talk.internal_comment}}
+ {% else %} +
-
+ {% endif %} +
C3S Link
+
Link
+
Talk Admin Link
+
Link
+
Talk Admin Link
+
Link Adm Overview
+
Subt Admin Link
+
Link
+
Subt Admin Link
+
Link Adm Overview
+
Amara Link
+ {% if any_subt.talk.amara_key != "" %} +
Link
+ {% else %} +
-
+ {% endif %} +
Pad Link
+ {% if any_subt.talk.link_to_writable_pad != "" %} +
Link
{% else %}
-
{% endif %} +
Event
+
{{any_subt.talk.event}}
+
Frab ID
+
{{any_subt.talk.frab_id_talk}}

{%endfor%}
+ +
@@ -349,6 +399,12 @@

[{{any_talk.id}} {{any_talk.title}}

+
Internal Comment
+ {% if any_talk.internal_comment != "" %} +
{{any_talk.internal_comment}}
+ {% else %} +
-
+ {% endif %}
C3S Link
Link
Admin Link
@@ -363,12 +419,6 @@

{{any_talk.id}} {{any_talk.title}}

{{any_talk.event}}
Frab ID
{{any_talk.frab_id_talk}}
-
Internal Comment
- {% if any_talk.internal_comment != "" %} -
{{any_talk.internal_comment}}
- {% else %} -
-
- {% endif %}

{%endfor%} @@ -379,6 +429,12 @@

[{{any_talk.id}} {{any_talk.title}}

+
Internal Comment
+ {% if any_talk.internal_comment != "" %} +
{{any_talk.internal_comment}}
+ {% else %} +
-
+ {% endif %}
C3S Link
Link
Admin Link
@@ -419,12 +475,6 @@

{{any_talk.id}} {{any_talk.title}}

{{any_talk.frab_id_talk}}
Language:
{{any_talk.orig_language}}
-
Internal Comment
- {% if any_talk.internal_comment != "" %} -
{{any_talk.internal_comment}}
- {% else %} -
-
- {% endif %}

{%endfor%} @@ -435,6 +485,12 @@

[{{any_talk.id}} {{any_talk.title}}

+
Internal Comment
+ {% if any_talk.internal_comment != "" %} +
{{any_talk.internal_comment}}
+ {% else %} +
-
+ {% endif %}
C3S Link
Link
Admin Link
@@ -488,12 +544,6 @@

{{any_talk.id}} {{any_talk.title}}

{{any_talk.frab_id_talk}}
Language:
{{any_talk.orig_language}}
-
Internal Comment
- {% if any_talk.internal_comment != "" %} -
{{any_talk.internal_comment}}
- {% else %} -
-
- {% endif %}

{%endfor%} @@ -504,6 +554,12 @@

[{{any_event.id}} {{any_event.title}}

+
Internal Comment
+ {% if any_event.internal_comment != "" %} +
{{any_event.internal_comment}}
+ {% else %} +
-
+ {% endif %}
C3S Link
Link
Admin Link
@@ -512,12 +568,6 @@

{{any_event.id}} {{any_event.titl
{{any_event.title}}
Acronym
{{any_event.acronym}}
-
Internal Comment
- {% if any_event.internal_comment != "" %} -
{{any_event.internal_comment}}
- {% else %} -
-
- {% endif %}


{%endfor%} @@ -528,6 +578,12 @@

[{{any_event.id}} {{any_event.title}}

+
Internal Comment
+ {% if any_event.internal_comment != "" %} +
{{any_event.internal_comment}}
+ {% else %} +
-
+ {% endif %}
C3S Link
Link
Admin Link
@@ -536,12 +592,6 @@

{{any_event.id}} {{any_event.titl
{{any_event.title}}
Acronym
{{any_event.acronym}}
-
Internal Comment
- {% if any_event.internal_comment != "" %} -
{{any_event.internal_comment}}
- {% else %} -
-
- {% endif %}


{%endfor%} @@ -552,6 +602,12 @@

[{{any_event.id}} {{any_event.title}}

+
Internal Comment
+ {% if any_event.internal_comment != "" %} +
{{any_event.internal_comment}}
+ {% else %} +
-
+ {% endif %}
C3S Link
Link
Admin Link
@@ -566,21 +622,12 @@

{{any_event.id}} {{any_event.titl
{{any_event.endings_to_remove_from_filenames}}
Use all webpages urls to find filenames and video urls
{{any_event.use_all_webpages_urls_to_find_filenames_and_video_urls}}
-
Internal Comment
- {% if any_event.internal_comment != "" %} -
{{any_event.internal_comment}}
- {% else %} -
-
- {% endif %}


{%endfor%}
- - - {% else %} diff --git a/www/views.py b/www/views.py index f5927ce..3fd4dfd 100755 --- a/www/views.py +++ b/www/views.py @@ -628,6 +628,10 @@ def media_export(request, timestamp=None, *argh, **kwargs): # Dashboard def dashboard(request): + # LEFT COLUMN + # Talks which need timing + subtitles_needing_timing = Subtitle.objects.filter(talk__unlisted=False, blocked = True).order_by("-talk") + # Talks without statistics data talks_one_speaker_no_statistics = [] talks_several_speakers_no_statistics = [] @@ -646,6 +650,7 @@ def dashboard(request): else: talks_several_speakers_no_statistics.append(any.talk) + # MIDDLE COLUMN # Visible talks with incomplete data talks_visible_no_amara_key = Talk.objects.filter(unlisted = False, amara_key = "").order_by("-id") talks_visible_no_filename = Talk.objects.filter(unlisted = False, filename = "").order_by("-id") @@ -653,14 +658,6 @@ def dashboard(request): talks_visible_no_cdn_link = Talk.objects.filter(unlisted = False, link_to_video_file = "").order_by("-id") talks_visible_no_etherpad_link = Talk.objects.filter(unlisted = False, link_to_writable_pad = "").order_by("-id") - talks_visible_no_amara_video_link = Talk.objects.filter(unlisted = False, primary_amara_video_link = "").order_by("-id") - talks_visible_transcript_by_none = Talk.objects.filter(unlisted = False, transcript_by__id = 0).order_by("-id") - - # Talks which need timing - talks_needing_timing = [] - for any in Subtitle.objects.filter(talk__unlisted=False, blocked = True).order_by("-talk"): - talks_needing_timing.append(any.talk) - # Needs to be more specific only talks in transcribing or qc talks_needing_c3s_yt_link = [] @@ -681,6 +678,13 @@ def dashboard(request): #for any_talk in my_talks: # talks_needing_c3s_yt_link_general.append(any_talk) + # Talks which need a draft subtitle + subtitles_from_talks_needing_draft_subtitle = Subtitle.objects.filter(talk__unlisted=False, has_draft_subtitle_file = False, state_id = 2).order_by("-talk") + + # RIGHT COLUMN + talks_visible_no_amara_video_link = Talk.objects.filter(unlisted = False, primary_amara_video_link = "").order_by("-id") + talks_visible_transcript_by_none = Talk.objects.filter(unlisted = False, transcript_by__id = 0).order_by("-id") + talks_with_subtitles_in_video_links = [] my_talks = Talk.objects.all().order_by("-id") for any_talk in my_talks: @@ -711,11 +715,12 @@ def dashboard(request): "talks_visible_transcript_by_none": talks_visible_transcript_by_none,\ "talks_needing_c3s_yt_link": talks_needing_c3s_yt_link,\ "talks_needing_c3s_yt_link_general": talks_needing_c3s_yt_link_general,\ - "talks_needing_timing": talks_needing_timing,\ "events_without_releasing_folder": events_without_releasing_folder,\ "events_without_hashtag": events_without_hashtag,\ "talks_with_subtitles_in_video_links": talks_with_subtitles_in_video_links,\ - "events_without_links_to_find_the_filenames_and_video_urls": events_without_links_to_find_the_filenames_and_video_urls + "events_without_links_to_find_the_filenames_and_video_urls": events_without_links_to_find_the_filenames_and_video_urls,\ + "subtitles_needing_timing": subtitles_needing_timing,\ + "subtitles_from_talks_needing_draft_subtitle": subtitles_from_talks_needing_draft_subtitle }) # Trint Webhook Receiver