Skip to content
Snippets Groups Projects
Commit db61e7f9 authored by Ron Lucke's avatar Ron Lucke Committed by David Siegfried
Browse files

fix #2584

Closes #2584

Merge request studip/studip!1743
parent 0af369c6
No related branches found
No related tags found
No related merge requests found
......@@ -57,7 +57,7 @@
</span>
</td>
<td class="responsive-hidden">
<a v-if="task.attributes.submitted" :href="getLinkToElement(element.id)">
<a v-if="task.attributes.submitted" :href="getLinkToElement(element)">
{{ element.attributes.title }}
</a>
<span v-else>{{ element.attributes.title }}</span>
......
......@@ -37,7 +37,7 @@
{{ taskGroup.attributes.title }}
</td>
<td>
<a :href="getLinkToElement(element.id)">{{ element.attributes.title }}</a>
<a :href="getLinkToElement(element)">{{ element.attributes.title }}</a>
</td>
<td>{{ task.attributes?.progress?.toFixed(2) || '-'}}%</td>
<td>{{ getReadableDate(task.attributes['submission-date']) }}</td>
......
......@@ -50,14 +50,13 @@ export default {
return status;
},
getLinkToElement(elementId) {
return (
STUDIP.URLHelper.base_url +
'dispatch.php/course/courseware/?cid=' +
STUDIP.URLHelper.parameters.cid +
'#/structural_element/' +
elementId
);
getLinkToElement(element) {
const unitId = element.relationships?.unit?.data?.id;
if (!unitId) {
return '';
}
return `${STUDIP.URLHelper.base_url}dispatch.php/course/courseware/courseware/${unitId}?cid=${STUDIP.URLHelper.parameters.cid}#/structural_element/${element.id}`;
},
getReadableDate(date) {
return new Date(date).toLocaleDateString();
......
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