1
0
forked from PGL/Clyde

translations of forum

This commit is contained in:
Debucquoy Anthony 2024-04-13 16:05:01 +02:00
parent 2e02cd8870
commit c6ce6d3e5b
Signed by untrusted user: tonitch
GPG Key ID: A78D6421F083D42E
3 changed files with 10 additions and 3 deletions

View File

@ -52,3 +52,6 @@ Curriculum=curriculum
Credits=Credits Credits=Credits
InscriptionService=I.S. InscriptionService=I.S.
faculty=Faculty faculty=Faculty
forum.create=Create forum
forum.create.name=New forum's name
forum.post.create.name=New post's title

View File

@ -52,3 +52,6 @@ Curriculum=Cursus
Credits=Credits Credits=Credits
InscriptionService=S.I. InscriptionService=S.I.
faculty=Faculté faculty=Faculté
forum.create=Créer un forum
forum.create.name=Nom du forum
forum.post.create.name=Titre du post

View File

@ -7,6 +7,7 @@
<script setup> <script setup>
import { ref, reactive } from 'vue' import { ref, reactive } from 'vue'
import i18n from '@/i18n.js'
import { getCourses } from '@/rest/courses.js' import { getCourses } from '@/rest/courses.js'
import { ForumsOfCurrentCourse, getForumsOfCourse, createForum } from '@/rest/forum.js' import { ForumsOfCurrentCourse, getForumsOfCourse, createForum } from '@/rest/forum.js'
import { PostsOfCurrentForum, getPostsOfForum, createPost } from '@/rest/forum.js' import { PostsOfCurrentForum, getPostsOfForum, createPost } from '@/rest/forum.js'
@ -34,7 +35,7 @@ const addPostContent = ref("");
<select id="forum" value="" v-model="selectedForum" @change="getPostsOfForum(selectedForum !== 'create' ? selectedForum : null)" v-if="ForumsOfCurrentCourse != null"> <select id="forum" value="" v-model="selectedForum" @change="getPostsOfForum(selectedForum !== 'create' ? selectedForum : null)" v-if="ForumsOfCurrentCourse != null">
<option v-for="forum in ForumsOfCurrentCourse" :value=forum.id>{{forum.name}}</option> <option v-for="forum in ForumsOfCurrentCourse" :value=forum.id>{{forum.name}}</option>
<option v-if="(Role === 'Admin' || Role === 'Teacher') && ForumsOfCurrentCourse != null" value="create">Create Forum</option> <option v-if="(Role === 'Admin' || Role === 'Teacher') && ForumsOfCurrentCourse != null" value="create">{{ i18n("forum.create") }}</option>
</select> </select>
</div> </div>
<div id="PostSelector" v-if="PostsOfCurrentForum != null"> <div id="PostSelector" v-if="PostsOfCurrentForum != null">
@ -56,13 +57,13 @@ const addPostContent = ref("");
<!-- Popup to add forum --> <!-- Popup to add forum -->
<div id="addForumForm" v-if="selectedForum === 'create'" @keyup.enter="createForum(selectedCourse, addForumName); selectedForum = '';"> <div id="addForumForm" v-if="selectedForum === 'create'" @keyup.enter="createForum(selectedCourse, addForumName); selectedForum = '';">
<label>New Forum:</label> <label>{{ i18n("forum.create.name") }}</label>
<input type="text" placeholder="Name" v-model=addForumName /> <input type="text" placeholder="Name" v-model=addForumName />
</div> </div>
<!-- Popup to add Post --> <!-- Popup to add Post -->
<div id="addPostForm" v-if=addPost> <div id="addPostForm" v-if=addPost>
<label>New Post:</label> <label>i18n("forum.post.create.name")</label>
<input type="text" placeholder="subject" v-model=addPostSubject @keyup.enter="createPost(selectedForum, addPostSubject, addPostContent); addPost = false;"/> <input type="text" placeholder="subject" v-model=addPostSubject @keyup.enter="createPost(selectedForum, addPostSubject, addPostContent); addPost = false;"/>
<textarea v-model="addPostContent" placeholder=content></textarea> <textarea v-model="addPostContent" placeholder=content></textarea>
<input type="submit" value="send" @click="createPost(selectedForum, addPostSubject, addPostContent); addPost = false;"> <input type="submit" value="send" @click="createPost(selectedForum, addPostSubject, addPostContent); addPost = false;">