Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show transcript for lectures with subtitles #1403

Merged
merged 10 commits into from
Dec 5, 2024
Prev Previous commit
Clean up and implement code style suggestions
  • Loading branch information
carlobortolan committed Dec 4, 2024
commit 2307c3914354d78dd76178575dde1320b26a4028
4 changes: 2 additions & 2 deletions web/template/admin/admin_tabs/info-pages.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
</div>
</div>
</div>
<div x-cloak="" x-show="editOpen" class="form-container-body">
<div x-cloak x-show="editOpen" class="form-container-body">
<textarea id="content-{{$i}}"
x-model="newContent"
rows="24"
class="p-2 resize-none font-normal outline-0 border-0 bg-transparent text-3">{{$text.RawContent}}</textarea>
</div>
<div x-cloak="" x-show="editOpen" class="flex items-center justify-end form-container-footer">
<div x-cloak x-show="editOpen" class="flex items-center justify-end form-container-footer">
<button id="save-{{$i}}"
type="reset"
class="btn h-fit mr-2"
Expand Down
4 changes: 2 additions & 2 deletions web/template/course-overview.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{{if or (.IndexData.TUMLiveContext.User.IsAdminOfCourse .IndexData.TUMLiveContext.Course) .IndexData.IsAdmin}}
<a class="hover:bg-gray-200 dark:hover:bg-gray-600 w-fit mx-2 inline-block rounded px-2 my-auto"
href="/admin/course/{{$course.Model.ID}}"
:title="'Edit course settings'">
title="Edit course settings">
<span class="font-semibold text-lg dark:text-white">
<i class="fa-solid w-5 py-2 fa-pen"></i>
</span>
Expand Down Expand Up @@ -125,7 +125,7 @@
</button>
<a class="hover:bg-gray-200 dark:hover:bg-gray-600 inline-block rounded px-2"
href="/api/download_ics/{{$course.Year}}/{{$course.TeachingTerm}}/{{$course.Slug}}/events.ics"
:title="'Export lecture dates'"
title="Export lecture dates"
x-show="lectures">
<span class="text-sm font-semibold uppercase dark:text-white">
<i class="fa-solid w-5 mr-1 fa-calendar"></i>ics
Expand Down
2 changes: 1 addition & 1 deletion web/template/partial/stream/transcript.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</button>
</div>
<div class="flex-grow overflow-hidden relative">
{{template "transcript-list" .}}
{{template "transcript-list"}}
</div>
</div>
</div>
Expand Down
18 changes: 9 additions & 9 deletions web/template/watch.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</div>
</div>
{{if .IndexData.TUMLiveContext.User}}
<div id="bookmarks-mobile" x-cloak="" x-show="sidebar === watch.SidebarState.Bookmarks"
<div id="bookmarks-mobile" x-cloak x-show="sidebar === watch.SidebarState.Bookmarks"
class="md:hidden flex absolute top-0 h-screen w-screen z-50 backdrop-brightness-50">
<div @click.outside="sidebar = watch.SidebarState.Hidden"
class="m-auto w-3/4 h-16/9 bg-white dark:bg-secondary-light border dark:border-gray-800 rounded-lg">
Expand Down Expand Up @@ -417,15 +417,15 @@

<!-- Bookmarks -->
{{if .IndexData.TUMLiveContext.User}}
<div id="bookmarks-desktop" x-cloak="" x-show="sidebar === watch.SidebarState.Bookmarks"
<div id="bookmarks-desktop" x-cloak x-show="sidebar === watch.SidebarState.Bookmarks"
:class="sidebar === watch.SidebarState.Bookmarks ? 'lg:basis-1/4' : 'lg:basis-0'"
class="hidden md:block basis-full h-16/9 lg:h-16/6 px-5 md:px-2 lg:order-none order-4">
{{template "bookmarks-modal" $stream.ID}}
</div>
{{end}}

<!-- Transcript -->
<div id="transcript-desktop" x-cloak="" x-show="sidebar === watch.SidebarState.Transcript && transcriptAvailable"
<div id="transcript-desktop" x-cloak x-show="sidebar === watch.SidebarState.Transcript && transcriptAvailable"
:class="sidebar === watch.SidebarState.Transcript ? 'lg:basis-1/4' : 'lg:basis-0'"
class="basis-full md:h-16/9 lg:h-16/6 px-2 lg:order-none order-4 grow">
{{template "transcript-modal" $stream.ID}}
Expand All @@ -442,7 +442,7 @@

<!-- Streams -->
{{if .IndexData.TUMLiveContext.User}}
<div id="streams-box" x-cloak="" x-show="sidebar === watch.SidebarState.Streams"
<div id="streams-box" x-cloak x-show="sidebar === watch.SidebarState.Streams"
:class="sidebar === watch.SidebarState.Streams ? 'lg:basis-1/4' : 'lg:basis-0'"
class="order-4 z-20 basis-full px-5 md:px-2 lg:order-none lg:h-16/6 h-16/9">
{{template "playlist" $stream.ID}}
Expand Down Expand Up @@ -478,12 +478,12 @@
<div class="rounded-lg px-3 text-4 py-2 h-fit w-fit bg-gray-100 dark:bg-secondary-light space-x-2">
<a
href="/admin/course/{{$course.Model.ID}}#lecture-li-{{$stream.Model.ID}}"
:title="'Edit course settings'">
title="Edit course settings">
<i class="fa-solid fa-pen text-4"></i>
</a>
<a
href="/admin/stats/{{$course.Model.ID}}/{{$stream.Model.ID}}"
:title="'Watch lecture stats'">
title="Watch lecture stats">
<i class="fa-solid fa-chart-simple text-4"></i>
</a>
</div>
Expand All @@ -492,21 +492,21 @@
{{if .IndexData.TUMLiveContext.User}}
<button @click="sidebar = (sidebar === watch.SidebarState.Bookmarks ? watch.SidebarState.Hidden : watch.SidebarState.Bookmarks)"
class="rounded-lg px-3 py-1 md:px-4 py-2 h-fit w-fit bg-gray-100 hover:bg-gray-200 dark:bg-secondary-light dark:hover:bg-gray-600"
:title="'New Bookmark'">
title="New Bookmark">
<i class="fa-solid fa-bookmark text-4"></i>
</button>
{{end}}

<!-- Transcript Button -->
<button x-show="transcriptAvailable" @toggletranscript.window="e => {transcriptAvailable=true}" @click="sidebar = (sidebar === watch.SidebarState.Transcript ? watch.SidebarState.Hidden : watch.SidebarState.Transcript)"
class="rounded-lg px-3 py-1 md:px-4 py-2 h-fit w-fit bg-gray-100 hover:bg-gray-200 dark:bg-secondary-light dark:hover:bg-gray-600"
:title="'Show Transcript'">
title="Show Transcript">
<i class="fa-solid fa-text-height text-4"></i>
</button>

<button @click="showShare = true;"
class="rounded-lg px-3 py-1 md:px-4 py-2 h-fit w-fit bg-gray-100 hover:bg-gray-200 dark:bg-secondary-light dark:hover:bg-gray-600"
:title="'Share'">
title="Share">
<i class="fa-solid fa-share text-4"></i>
</button>

Expand Down
Loading