Skip to content
Snippets Groups Projects
Commit 1ab2d042 authored by Ron Lucke's avatar Ron Lucke Committed by Elmar Ludwig
Browse files

fix #3065

Closes #3065

Merge request studip/studip!2092
parent 33055151
No related branches found
No related tags found
No related merge requests found
......@@ -2352,14 +2352,9 @@ d a s h b o a r d e n d
* * * * * * * * * * * */
.cw-unit-progress {
.cw-unit-progress-breadcrumb {
padding: 10px;
span {
color: $base-color;
cursor: pointer;
&:hover {
color: $active-color;
}
padding: 10px 0;
a img {
vertical-align: top;
}
}
......@@ -2389,7 +2384,7 @@ d a s h b o a r d e n d
border-top: solid thin $content-color-40;
padding: 0 1em 0 1em;
.cw-dashboard-empty-info {
.cw-unit-empty-info {
margin-top: 10px;
}
}
......
......@@ -40,6 +40,8 @@
</template>
<script>
import { mapGetters } from 'vuex';
export default {
name: "courseware-tile",
props: {
......@@ -103,6 +105,9 @@ export default {
}
},
computed: {
...mapGetters({
userIsTeacher: 'userIsTeacher'
}),
hasImage() {
return this.imageUrl !== "" && this.imageUrl !== undefined;
},
......@@ -121,7 +126,10 @@ export default {
}
},
progressTitle() {
return this.$gettextInterpolate(this.$gettext("Fortschritt: %{progress}%"), { progress: this.progress });
if (this.userIsTeacher) {
return this.$gettextInterpolate(this.$gettext("Fortschritt aller Teilnehmenden: %{progress}%"), { progress: this.progress });
}
return this.$gettextInterpolate(this.$gettext("Mein Fortschritt: %{progress}%"), { progress: this.progress });
},
hasDescriptionLink() {
return this.descriptionLink !== '';
......
......@@ -15,6 +15,7 @@
class="cw-unit-action-menu"
:items="menuItems"
:context="title"
:collapseAt="0"
@showDelete="openDeleteDialog"
@showExport="openExportDialog"
@showProgress="openProgressDialog"
......@@ -40,7 +41,7 @@
<studip-dialog
v-if="showProgressDialog"
:title="$gettext('Fortschritt')"
:title="userIsTeacher ? $gettext('Fortschritt aller Teilnehmenden') : $gettext('Mein Fortschritt')"
:closeText="$gettext('Schließen')"
closeClass="cancel"
width="800"
......@@ -48,7 +49,7 @@
@close="closeProgressDialog"
>
<template v-slot:dialogContent>
<courseware-unit-progress :progressData="progresses" :unitId="unit.id" :rootId="unitElement.id"/>
<courseware-unit-progress :progressData="progresses" :unitId="unit.id" :rootId="parseInt(unitElement.id)"/>
</template>
</studip-dialog>
......
<template>
<div class="cw-unit-progress">
<p v-if="userIsTeacher">
{{
$gettext('Die Fortschrittsanzeige bezieht sich auf den Anteil der Teilnehmenden, die eine Seite aufgerufen haben.')
}}
</p>
<nav aria-label="Breadcrumb" class="cw-unit-progress-breadcrumb">
<a
v-if="parent"
href="#"
:title="$gettext('Hauptseite')"
@click="visitRoot"
>
<a v-if="parent" href="#" :title="$gettext('Hauptseite')" @click="visitRoot">
<studip-icon shape="home" />
</a>
<a
v-if="parent"
href="#"
:title="parent.name"
@click="selectChapter(parent.id)"
>
/ {{ parent.name }}
<a v-if="parent && parent.id !== rootId" href="#" :title="parent.name" @click="selectChapter(parent.id)">
| {{ parent.name }}
</a>
</nav>
<div v-if="selected" class="cw-unit-progress-chapter">
<a :href="chapterUrl" :title="$gettextInterpolate('%{ pageTitle } öffnen', {pageTitle: selected.name})">
<h1>{{ selected.name }}</h1>
<h1>
<a
:href="chapterUrl"
:title="$gettextInterpolate('%{ pageTitle } öffnen', { pageTitle: selected.name })"
>
{{ selected.name }}
</a>
</h1>
<courseware-progress-circle
:title="$gettext('diese Seite inkl. darunter liegende Seiten')"
:title="selected.id === rootId ? $gettext('Gesamtes Lernmaterial') : $gettext('diese Seite inkl. darunter liegender Seiten')"
:value="parseInt(selected.progress.cumulative)"
/>
<courseware-progress-circle
......@@ -32,7 +32,7 @@
:value="parseInt(selected.progress.self)"
/>
</div>
<div class="cw-unit-progress-subchapter-list">
<div v-if="children.length > 0" class="cw-unit-progress-subchapter-list">
<courseware-unit-progress-item
v-for="chapter in children"
:key="chapter.id"
......@@ -41,14 +41,14 @@
:chapterId="chapter.id"
@selectChapter="selectChapter"
/>
<div v-if="!children.length" class="cw-unit-empty-info">
</div>
<div v-else class="cw-unit-empty-info">
<courseware-companion-box
mood="sad"
:msgCompanion="$gettext('Diese Seite enthält keine darunter liegenden Seiten.')"
/>
</div>
</div>
</div>
</template>
<script>
......@@ -57,6 +57,8 @@ import CoursewareUnitProgressItem from './CoursewareUnitProgressItem.vue';
import CoursewareProgressCircle from './CoursewareProgressCircle.vue';
import StudipIcon from '../StudipIcon.vue';
import { mapGetters } from 'vuex';
export default {
name: 'courseware-unit-progress',
components: {
......@@ -68,7 +70,7 @@ export default {
props: {
progressData: Object,
unitId: String,
rootId: String
rootId: Number,
},
data() {
return {
......@@ -76,13 +78,12 @@ export default {
};
},
computed: {
...mapGetters({
userIsTeacher: 'userIsTeacher',
}),
chapterUrl() {
return (
STUDIP.URLHelper.base_url +
'dispatch.php/course/courseware/courseware/'+
this.unitId +
'?cid=' +
STUDIP.URLHelper.parameters.cid +
STUDIP.URLHelper.getURL('dispatch.php/course/courseware/courseware/' + this.unitId) +
'#/structural_element/' +
this.selected.id
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment