Skip to content
Snippets Groups Projects
Commit e00a7ed5 authored by Ron Lucke's avatar Ron Lucke
Browse files

fix #3090

Closes #3090

Merge request studip/studip!2077
parent b16c206d
No related branches found
No related tags found
No related merge requests found
...@@ -636,7 +636,12 @@ ...@@ -636,7 +636,12 @@
v-if="currentElement !== ''" v-if="currentElement !== ''"
:msgCompanion="textCompanionWrongContext" :msgCompanion="textCompanionWrongContext"
mood="sad" mood="sad"
/> >
<template v-slot:companionActions >
<a class="button" :href="unitRootUrl">{{ $gettext('Lernmaterial neu laden') }}</a>
<a class="button" :href="shelfURL">{{ $gettext('Zurück zur Lernmaterialübersicht') }}</a>
</template>
</courseware-companion-box>
</div> </div>
</div> </div>
</focus-trap> </focus-trap>
...@@ -863,13 +868,26 @@ export default { ...@@ -863,13 +868,26 @@ export default {
}, },
validContext() { validContext() {
let valid = false; if (this.context.type === 'sharedusers') {
if (this.context.id === this.courseware.relationships.root.data.id) {
return true;
}
}
if (this.context.type === 'public') {
return true;
}
if (this.context.unit !== this.currentElement.relationships?.unit?.data?.id) {
return false;
}
if (this.context.type === 'courses' && this.currentElement.relationships) { if (this.context.type === 'courses' && this.currentElement.relationships) {
if ( if (
this.currentElement.relationships.course && this.currentElement.relationships.course &&
this.context.id === this.currentElement.relationships.course.data.id this.context.id === this.currentElement.relationships.course.data.id
) { ) {
valid = true; return true;
} }
} }
...@@ -878,20 +896,12 @@ export default { ...@@ -878,20 +896,12 @@ export default {
this.currentElement.relationships.user && this.currentElement.relationships.user &&
this.context.id === this.currentElement.relationships.user.data.id this.context.id === this.currentElement.relationships.user.data.id
) { ) {
valid = true; return true;
}
}
if (this.context.type === 'sharedusers') {
if (this.context.id === this.courseware.relationships.root.data.id) {
valid = true;
} }
} }
if (this.context.type === 'public') { return false;
valid = true;
}
return valid;
}, },
image() { image() {
...@@ -1225,6 +1235,18 @@ export default { ...@@ -1225,6 +1235,18 @@ export default {
}, },
progressTitle() { progressTitle() {
return ''; return '';
},
shelfURL() {
return STUDIP.URLHelper.getURL(
'dispatch.php/course/courseware/',
{cid: this.context.id}
);
},
unitRootUrl() {
return STUDIP.URLHelper.getURL(
'dispatch.php/course/courseware/courseware/' + this.context.unit,
{cid: this.context.id}
);
} }
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment