Skip to content
Merged
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
28 changes: 24 additions & 4 deletions components/course/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,27 @@
<SectionTitle full size="xl" :subheading="category" :heading="title" />
<p>
{{ t('Body.CreatedBy') }}
<span class="text-accent">{{ author }}</span>
<span v-if="authors.length === 1">
<a class="text-accent" :href="authors[0].url">{{ authors[0].name }}</a>
</span>
<span v-else-if="authors.length === 2">
<a class="text-accent" :href="authors[0].url">{{ authors[0].name }}</a>
{{ t('Body.And') }}
<a class="text-accent" :href="authors[1].url">{{ authors[1].name }}</a>
</span>
<span v-else>
<template v-for="(author, index) in authors">
<template v-if="index !== authors.length - 1">
<span>
<a class="text-accent" :href="author.url">{{ author.name }}</a>,
</span>
</template>
<template v-else>
{{ t('Body.And') }}
<a class="text-accent" :href="author.url">{{ author.name }}</a>
</template>
</template>
</span>
</p>
</div>

Expand Down Expand Up @@ -47,8 +67,8 @@ export default defineComponent({
return props.data?.title ?? '';
});

const author = computed(() => {
return props.data?.author ?? '';
const authors = computed(() => {
return props.data?.authors ?? '';
});

const lastUpdated = computed(() => {
Expand All @@ -59,7 +79,7 @@ export default defineComponent({
return `${t(month.string).substring(0, 3)}, ${year}`;
});

return { image, title, category, author, lastUpdated, t };
return { image, title, category, authors, lastUpdated, t };
},
});
</script>
Expand Down
1 change: 1 addition & 0 deletions locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
"GetMorphcoins": "Du willst kein Geld bezahlen? Die Coins kannst du auch auf andere Weise erhalten",
"MoreComingSoon": "Mehr folgt bald...",
"CreatedBy": "Erstellt von",
"And": "und",
"LastUpdated": "Zuletzt aktualisiert",
"VerifyCertificate": "Bitte gib das Zertifikatspasswort ein, um das Zertifikat anzuzeigen.",
"EnterNewTag": "Gib ein neues Tag ein",
Expand Down
1 change: 1 addition & 0 deletions locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@
"GetMorphcoins": "Don't want to pay? You can get coins by other ways",
"MoreComingSoon": "More coming soon...",
"CreatedBy": "Created by",
"And": "and",
"LastUpdated": "Last Updated",
"VerifyCertificate": "Please enter certificate password in order to view certificate.",
"EnterNewTag": "Enter a new tag",
Expand Down
7 changes: 5 additions & 2 deletions types/courseTypes.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@

type Author = {
name: string;
url: string;
};

export class Course{
author: string = "";
authors: Author[] = [];
category: string = "";
description: string = "";
id: string = "";
Expand Down