Skip to content

Commit 240154a

Browse files
Merge pull request #5116 from christianbeeznest/GH-5074-3
Gradebook: Fixes and enhancements for certificate handling in documents and gradebook - #5074
2 parents 3985e3f + c457ad2 commit 240154a

File tree

16 files changed

+349
-142
lines changed

16 files changed

+349
-142
lines changed

assets/vue/components/Toolbar.vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<template>
22
<PrimeToolbar>
33
<template #start>
4+
<PrimeButton
5+
v-if="handleBack"
6+
:label="$t('Back')"
7+
icon="mdi mdi-arrow-left"
8+
class="p-button-outlined"
9+
@click="backAction"
10+
/>
11+
412
<PrimeButton
513
v-if="handleList"
614
:label="$t('List')"
@@ -98,6 +106,10 @@ export default {
98106
type: Function,
99107
required: false
100108
},
109+
handleBack: {
110+
type: Function,
111+
required: false
112+
},
101113
handleSubmit: {
102114
type: Function,
103115
required: false
@@ -145,6 +157,11 @@ export default {
145157
}
146158
},
147159
methods: {
160+
backAction() {
161+
if (this.handleBack) {
162+
this.handleBack();
163+
}
164+
},
148165
listItem() {
149166
if (this.handleList) {
150167
this.handleList();

assets/vue/components/basecomponents/ChamiloIcons.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,6 @@ export const chamiloIconToClass = {
109109
"anonymous": "mdi mdi-incognito",
110110
"settings": "mdi mdi-tools",
111111
"ticket": "mdi mdi-ticket-account",
112+
"certificate-selected": "mdi mdi-star",
113+
"certificate-not-selected": "mdi mdi-star-outline",
112114
};

assets/vue/components/resource_links/ShowLinks.vue

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,39 @@
44
:key="index"
55
class="field space-y-2"
66
>
7-
<div
8-
v-if="link.course"
9-
:class="{ 'text-right text-body-2': editStatus }"
10-
>
11-
<span class="mdi mdi-book" />
12-
{{ t("Course: {0}", [link.course.resourceNode.title]) }}
7+
<div v-if="link.course" :class="{ 'text-right text-body-2': editStatus }">
8+
<span class="mdi mdi-book"></span>
9+
{{ $t("Course") }}: {{ link.course.resourceNode.title }}
1310
</div>
1411

1512
<div
1613
v-if="link.session"
1714
:class="{ 'text-right text-body-2': editStatus }"
1815
>
1916
<span class="mdi mdi-book-open" />
20-
{{ t("Session: {0}", [link.session.title]) }}
17+
{{ $t("Session") }}: {{ link.session.title }}
2118
</div>
2219

2320
<div
2421
v-if="link.group"
2522
:class="{ 'text-right text-body-2': editStatus }"
2623
>
2724
<span class="mdi mdi-people" />
28-
{{ t("Group: {0}", [link.group.resourceNode.title]) }}
25+
{{ $t("Group") }}: {{ link.group.resourceNode.title }}
2926
</div>
3027

31-
<div
32-
v-if="link.userGroup"
33-
v-t="{ path: 'Class: {0}', args: [link.userGroup.resourceNode.title] }"
34-
/>
28+
<div v-if="link.userGroup">
29+
{{ $t("Class") }}: {{ link.userGroup.resourceNode.title }}
30+
</div>
3531

3632
<div v-if="link.user">
37-
<span class="mdi mdi-account" />
38-
<!-- @todo add avatar -->
39-
<!-- <q-avatar size="32px">-->
40-
<!-- <img :src="link.user.illustrationUrl + '?w=80&h=80&fit=crop'" />-->
41-
<!-- </q-avatar>-->
33+
<span class="mdi mdi-account"></span>
4234
{{ link.user.username }}
4335
</div>
4436

45-
<div
46-
v-if="showStatus"
47-
v-t="{ path: 'Status: {0}', args: [link.visibilityName] }"
48-
/>
37+
<div v-if="showStatus">
38+
{{ $t("Status") }}: {{ link.visibilityName }}
39+
</div>
4940

5041
<div v-if="editStatus">
5142
<div class="p-float-label">
@@ -56,10 +47,7 @@
5647
option-label="label"
5748
option-value="value"
5849
/>
59-
<label
60-
v-t="'Status'"
61-
:for="`link-${link.id}-status`"
62-
/>
50+
<label for="`link-${link.id}-status`">{{ $t("Status") }}</label>
6351
</div>
6452
</div>
6553
</div>

assets/vue/composables/datatableList.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ export function useDatatableList (servicePrefix) {
3333
function onUpdateOptions ({ page, itemsPerPage, sortBy, sortDesc }) {
3434
page = page || options.value.page
3535

36-
if (!isEmpty(route.query.cert) && route.query.cert === '1') {
37-
filters.value.filetype = 'certificate'
36+
if (!isEmpty(route.query.filetype) && route.query.filetype === 'certificate') {
37+
filters.value.filetype = 'certificate';
3838
} else {
39-
filters.value.filetype = ['file', 'folder']
39+
filters.value.filetype = ['file', 'folder'];
4040
}
4141

4242
let params = { ...filters.value }

assets/vue/views/documents/CreateFile.vue

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<Toolbar
33
:handle-reset="resetForm"
44
:handle-submit="onSendFormData"
5+
:handle-back="handleBack"
56
/>
67

78
<div class="documents-layout">
@@ -17,15 +18,14 @@
1718
:errors="violations"
1819
:values="item"
1920
/>
21+
<Panel
22+
v-if="$route.query.filetype === 'certificate' "
23+
:header="$t('Create your certificate copy-pasting the following tags. They will be replaced in the document by their student-specific value:')"
24+
>
25+
<div v-html="finalTags" />
26+
</Panel>
2027
</div>
2128
</div>
22-
23-
<Panel
24-
v-if="$route.query.cert === '1'"
25-
:header="$t('Create your certificate copy-pasting the following tags. They will be replaced in the document by their student-specific value:')"
26-
>
27-
<div v-html="finalTags" />
28-
</Panel>
2929
<Loading :visible="isLoading" />
3030
</template>
3131

@@ -60,7 +60,7 @@ export default {
6060
},
6161
mixins: [CreateMixin],
6262
data() {
63-
const filetype = this.$route.query.cert === '1' ? 'certificate' : 'file';
63+
const filetype = this.$route.query.filetype === 'certificate' ? 'certificate' : 'file';
6464
const finalTags = this.getCertificateTags();
6565
return {
6666
item: {
@@ -90,6 +90,9 @@ export default {
9090
},
9191
9292
methods: {
93+
handleBack() {
94+
this.$router.back();
95+
},
9396
addTemplateToEditor(templateContent) {
9497
this.item.contentFile = templateContent;
9598
},

0 commit comments

Comments
 (0)