blob: 2a41029b115c2674ee56595f28cc9c635591576a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
<script setup>
import {computed} from 'vue';
import StudipIcon from '@/vue/components/StudipIcon.vue';
import {$gettext} from '@/assets/javascripts/lib/gettext';
import {useForumConfig} from '@/vue/store/pinia/forum/ForumConfig';
const forumConfig = useForumConfig();
const props = defineProps({
topic_id: {
type: String,
}
});
const discussionCreateURL = computed(() => {
return STUDIP.URLHelper.getURL(`dispatch.php/course/forum/discussions/edit?topic_id=${props.topic_id}`);
});
const addDiscussion = () => {
STUDIP.Dialog.fromURL(
discussionCreateURL.value,
{
width: '900',
height: '750'
}
);
}
</script>
<template>
<button
type="button"
class="button button--icon-only"
v-if="!forumConfig.allowGuestAccess"
@click="addDiscussion"
:title="$gettext('Neue Diskussion starten')"
:aria-label="$gettext('Neue Diskussion starten')"
>
<StudipIcon shape="add" :size="20" aria-hidden="true" />
</button>
</template>
|