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

Fix overlapping of playlist dialog by Stud.IP header #1122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 14 additions & 38 deletions vueapp/components/Courses/CoursesSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</li>
</template>
<template v-else>
<li v-if="canEdit" @click="showCreateDefaultPlaylist">
<li v-if="canEdit" @click="showCreatePlaylist">
<studip-icon style="margin-top: -2px;" shape="add" role="clickable"/>
{{ $gettext('Kurswiedergabeliste hinzufügen') }}
</li>
Expand Down Expand Up @@ -206,7 +206,7 @@
{{ $gettext('Studierendenupload verbieten') }}
</a>
</li>
<li @click="showChangeDefaultPlaylist" v-if="canEdit" data-reject-toggle-sidebar="true">
<li @click="$emit('changeDefaultPlaylist')" v-if="canEdit" data-reject-toggle-sidebar="true">
<studip-icon style="margin-left: -20px;" shape="refresh" role="clickable"/>
{{ $gettext('Standard-Kurswiedergabeliste ändern') }}
</li>
Expand All @@ -221,19 +221,6 @@
</div>
</div>

<PlaylistAddCard v-if="addPlaylist"
:is-default="isDefault"
@done="closePlaylistAdd"
@cancel="closePlaylistAdd"
/>

<PlaylistsLinkCard v-if="showChangeDefaultDialog"
:is-default="true"
:custom-title="$gettext('Kurswiedergabeliste wechseln')"
@done="closeChangeDefaultPlaylist"
@cancel="closeChangeDefaultPlaylist"
/>

</template>
</template>

Expand All @@ -253,13 +240,20 @@ export default {
PlaylistsLinkCard,
},

emits: ['uploadVideo', 'recordVideo', 'copyAll', 'editPlaylist', 'sortVideo', 'saveSortVideo', 'cancelSortVideo'],
emits: [
'uploadVideo',
'recordVideo',
'copyAll',
'editPlaylist',
'sortVideo',
'saveSortVideo',
'cancelSortVideo',
'changeDefaultPlaylist'
],

data() {
return {
showAddDialog: false,
isDefault: false,
showChangeDefaultDialog: false,
semesterFilter: null,
schedulePlaylistToken: null,
livestreamPlaylistToken: null,
Expand All @@ -269,11 +263,11 @@ export default {
},

computed: {
...mapGetters(["playlists", "currentView", 'addPlaylist',
...mapGetters(["playlists", "currentView", 'opencastOffline',
"cid", "semester_list", "semester_filter", 'currentUser',
'simple_config_list', 'course_config', 'playlist',
'defaultPlaylist', 'videoSortMode', 'downloadSetting',
'schedule_playlist', 'livestream_playlist', 'opencastOffline'
'schedule_playlist', 'livestream_playlist'
]),

fragment() {
Expand Down Expand Up @@ -406,24 +400,6 @@ export default {
this.$store.dispatch('addPlaylistUI', true);
},

showCreateDefaultPlaylist() {
this.isDefault = true;
this.$store.dispatch('addPlaylistUI', true);
},

showChangeDefaultPlaylist() {
this.showChangeDefaultDialog = true;
},

closeChangeDefaultPlaylist() {
this.showChangeDefaultDialog = false;
},

closePlaylistAdd() {
this.isDefault = false;
this.$store.dispatch('addPlaylistUI', false);
},

openPlaylistAddVideosDialog() {
if (this.opencastOffline) {
return;
Expand Down
27 changes: 27 additions & 0 deletions vueapp/views/Course.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
@saveSortVideo="saveSort"
@cancelSortVideo="cancelSort"
@editPlaylist="editPlaylistDialog = true"
@changeDefaultPlaylist="showChangeDefaultPlaylistDialog = true"
@copyAll="copyAll">
</CoursesSidebar>
</Teleport>

<PlaylistAddCard v-if="addPlaylist"
:is-default="!hasDefaultPlaylist"
@done="closePlaylistAddDialog"
@cancel="closePlaylistAddDialog"
/>

<PlaylistAddVideos v-if="showPlaylistAddVideosDialog"
:canEdit="canEdit"
:canUpload="canUpload"
Expand All @@ -28,6 +35,13 @@
@cancel="closeCopyDialog"
/>

<PlaylistsLinkCard v-if="showChangeDefaultPlaylistDialog"
:is-default="true"
:custom-title="$gettext('Kurswiedergabeliste wechseln')"
@done="showChangeDefaultPlaylistDialog = false"
@cancel="showChangeDefaultPlaylistDialog = false"
/>

<MessageList />

<router-view></router-view>
Expand All @@ -39,6 +53,8 @@ import CoursesSidebar from "@/components/Courses/CoursesSidebar";
import PlaylistAddVideos from "@/components/Playlists/PlaylistAddVideos";
import VideoUpload from "@/components/Videos/VideoUpload";
import MessageList from "@/components/MessageList";
import PlaylistsLinkCard from '@/components/Playlists/PlaylistsLinkCard.vue';
import PlaylistAddCard from '@/components/Playlists/PlaylistAddCard.vue';
import PlaylistEditCard from '@/components/Playlists/PlaylistEditCard.vue';
import VideoCopyToSeminar from '@/components/Videos/Actions/VideoCopyToSeminar.vue';

Expand All @@ -48,6 +64,7 @@ export default {
name: "Course",

components: {
PlaylistsLinkCard, PlaylistAddCard,
PlaylistEditCard, CoursesSidebar,
VideoUpload, PlaylistAddVideos,
MessageList, VideoCopyToSeminar
Expand All @@ -58,6 +75,7 @@ export default {
'currentUser',
'showCourseCopyDialog',
'showPlaylistAddVideosDialog',
'addPlaylist',
'cid',
'course_config'
]),
Expand All @@ -78,6 +96,10 @@ export default {
return this.course_config.upload_allowed;
},

hasDefaultPlaylist() {
return this.course_config?.has_default_playlist;
},

toLayoutName() {
if (window.OpencastPlugin.STUDIP_VERSION >= 5.3) {
return "#sidebar";
Expand All @@ -92,6 +114,7 @@ export default {
return {
uploadDialog: false,
editPlaylistDialog: false,
showChangeDefaultPlaylistDialog: false,
}
},

Expand All @@ -116,6 +139,10 @@ export default {
this.$store.dispatch('togglePlaylistAddVideosDialog', false);
},

closePlaylistAddDialog() {
this.$store.dispatch('addPlaylistUI', false);
},

closeCopyDialog() {
this.resetCopyParams();
},
Expand Down
Loading