1
0
forked from PGL/Clyde

2 Commits

Author SHA1 Message Date
436ba59af1 Adding appointment table 2024-04-02 19:50:45 +02:00
82b4e24d03 Meetings page creation 2024-04-02 11:42:15 +02:00
15 changed files with 63 additions and 319 deletions

View File

@ -16,8 +16,6 @@ repositories {
}
dependencies {
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.projectlombok:lombok")
implementation("org.springframework.boot:spring-boot-starter-jdbc")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-mail")

View File

@ -1,10 +1,6 @@
package ovh.herisson.Clyde.Tables;
import jakarta.persistence.*;
import ovh.herisson.Clyde.Tables.Msg.Forum;
import java.util.List;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
@ -21,11 +17,6 @@ public class Course {
@JoinColumn(name = "Users")
private User owner;
//// Extension Messagerie /////
@OneToMany
private List<Forum> forums;
///////////////////////////////
public Course(int credits, String title, User owner){
this.credits = credits;
this.title = title;

View File

@ -1,32 +0,0 @@
package ovh.herisson.Clyde.Tables.Msg;
import java.util.Date;
import org.hibernate.annotations.CreationTimestamp;
import jakarta.persistence.*;
import lombok.Data;
import ovh.herisson.Clyde.Tables.User;
@Entity
@Data
public class Answers {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
@CreationTimestamp
private Date creation;
@ManyToOne
private Topic topic;
private String content;
@OneToOne
private User author;
private boolean anonymous;
}

View File

@ -0,0 +1,9 @@
package ovh.herisson.Clyde.Tables.Msg;
public enum AppointmentStatus {
WAITING_TEACHER,
WAITING_STUDENT,
CONFIRMED,
REFUSED
}

View File

@ -0,0 +1,30 @@
package ovh.herisson.Clyde.Tables.Msg;
import java.util.Date;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.ManyToOne;
import ovh.herisson.Clyde.Tables.User;
@Entity
public class Appointments {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
@ManyToOne
private User teacher, student;
private Date planned;
@Enumerated(EnumType.STRING)
private AppointmentStatus status;
}

View File

@ -1,28 +0,0 @@
package ovh.herisson.Clyde.Tables.Msg;
import java.util.List;
import jakarta.persistence.*;
import lombok.Data;
import ovh.herisson.Clyde.Tables.Course;
import ovh.herisson.Clyde.Tables.User;
@Entity
@Data
public class Forum {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
@ManyToOne(cascade = CascadeType.ALL)
private Course course;
private String name;
@OneToMany
private List<User> writers; // User who are authorized to create a post
@OneToMany
private List<User> register;
}

View File

@ -1,26 +0,0 @@
package ovh.herisson.Clyde.Tables.Msg;
import java.util.List;
import jakarta.persistence.*;
import lombok.Data;
import ovh.herisson.Clyde.Tables.User;
@Entity
@Data
public class Topic {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
private String subject, content;
@OneToOne
private User author;
@OneToMany(mappedBy = "topic", cascade = CascadeType.ALL)
private List<Answers> answers;
private boolean locked; // true if new messages can be posted
}

View File

@ -20,6 +20,7 @@ app.login=Login
app.notifications=Notifications
app.settings=Settings
app.messages=Messages
app.meetings=Meetings
app.forum=Forum
app.schedules=Schedules
app.inscription.requests=Inscription Requests

View File

@ -20,6 +20,7 @@ app.login=Se connecter
app.notifications=Notifications
app.settings=Options
app.messages=Messages
app.meetings=Rendez-vous
app.forum=Forum
app.schedules=Horaires
app.inscription.requests=Demandes d'Inscription

View File

@ -99,19 +99,20 @@ window.addEventListener('hashchange', () => {
height: 100%;
width: 100%;
display:grid;
grid-template-columns:[firstCol-start]70px[firstCol-end secondCol-start]auto[endCol];
grid-template-rows:[firstRow-start] var(--header-size) [firstRow-end secondRow-start] calc(100% - var(--header-size)) [endRow];
grid-template-rows:[firstRow-start]61px[firstRow-end secondRow-start] auto [endRow];
grid-template-areas:
"topBar topBar"
"leftBar page";
row-gap:0px;
column-gap:0px;
}
.page {
grid-area:page;
height: 100%;
width: 100%;
place-self:center;
}
.topBar{
@ -154,7 +155,7 @@ window.addEventListener('hashchange', () => {
ul.vertical{
list-style-type: none;
margin-top: var(--header-size);
margin-top: 61px;
top:0;
left:0;
padding: 25px 0 0;
@ -202,7 +203,7 @@ window.addEventListener('hashchange', () => {
left:0;
position: fixed;
height:var(--header-size);
height:61px;
width: 100%;
background-color: rgb(24, 24, 24);
}

View File

@ -1,138 +0,0 @@
<!----------------------------------------------------
File: Forums.vue
Author: Anthony Debucquoy
Scope: Extension messagerie
Description: Forum des étudiants
----------------------------------------------------->
<script setup>
import { ref, reactive } from 'vue'
import { getCourses } from '@/rest/courses.js'
import { ForumsOfCurrentCourse, getForumsOfCourse } from '@/rest/forum.js'
import { PostsOfCurrentForum, getPostsOfForum } from '@/rest/forum.js'
import { fetchedPost, fetchPost } from '@/rest/forum.js'
const courses = await reactive(getCourses());
const selectedCourse = ref();
const selectedForum = ref();
</script>
<template>
<div id="app">
<div id="ForumSelector">
<select id="cours" value="" v-model="selectedCourse" @change="getForumsOfCourse(selectedCourse)">
<option v-for="course in courses" :value="course.courseId">{{course.title}}</option>
</select>
<select id="forum" value="" v-model="selectedForum" @change="getPostsOfForum(selectedForum)" v-if="ForumsOfCurrentCourse != null">
<option v-for="forum in ForumsOfCurrentCourse" :value=forum.id>{{forum.name}}</option>
</select>
</div>
<div id="PostSelector" v-if="PostsOfCurrentForum != null">
<div @click="fetchPost(post.id)" class="postItem" v-for="post in PostsOfCurrentForum" :key="post.id">{{ post.name }}</div>
<!--button id="createPost" @click="createPost()">+</button-->
</div>
<div id="PostViewer" v-if="fetchedPost != null">
<div id="Post">
<h1>{{ fetchedPost.subject }}</h1>
{{fetchedPost.content}}
</div>
<div id="Messages">
<p v-for="msg in fetchedPost.messages">{{msg.author}} - {{msg.content}}</p>
</div>
</div>
</div>
</template>
<style scoped>
#app{
display: grid;
width: 100%;
height: 100%;
grid-template: 5em auto / 25% 75%;
}
#ForumSelector{
background-color: #FFFFFF0E;
grid-column: 1 / 3;
border-radius: 100px;
margin: 10px;
display: flex;
justify-content: space-around;
}
#ForumSelector select{
background-color: #ffa000;
border: none;
margin: 10px;
border-radius: 10px;
width: 200px;
text-align: center;
}
#ForumSelector button{
background-color: green;
border: none;
border-radius: 25%;
margin: 10px;
}
#PostSelector{
background-color: #FFFFFF0E;
border-radius: 0 25px 25px 0;
margin: 10px 0 10px 10px;
overflow: hidden;
padding: 10px;
display: flex;
flex-direction: column;
}
.postItem{
color: darkorange;
display: flex;
font-family: sans-serif;
font-weight: bold;
height: 4vh;
margin: 5px;
border-radius: 0 30px 30px 0;
align-items: center;
justify-content: center;
border: 1px solid darkorange;
}
.postItem:hover{
background-color: gray;
}
#PostViewer{
background-color: #FFFFFF0E;
border-radius: 25px;
margin: 10px;
max-height: 100%;
overflow: scroll;
}
#Post{
padding: 25px;
}
#Messages{
padding: 25px;
border-top: 3px dotted white;
}
#Messages > p {
background-color: orange;
}
</style>

View File

@ -0,0 +1,11 @@
<template>
</template>
<script setup>
alert("Meetings page WIP")
</script>
<style scoped>
</style>

View File

@ -1,7 +1,3 @@
:root {
--header-size: 61px;
}
body {
background-color: rgb(53, 25, 60);
margin:0;

View File

@ -9,7 +9,7 @@ import Profil from "@/Apps/Profil.vue"
import Courses from "@/Apps/ManageCourses.vue"
import Users from "@/Apps/UsersList.vue"
import Students from "@/Apps/StudentsList.vue"
import Forums from '@/Apps/Forums.vue'
import Meetings from "@/Apps/Meetings.vue"
const apps = {
'/login': LoginPage,
@ -18,13 +18,14 @@ const apps = {
'/manage-courses' : Courses,
'/users-list' : Users,
'/students-list' : Students,
'/forums': Forums,
'/meetings' : Meetings,
}
const appsList = {
'Msg': { path: '#/msg', icon: 'fa-comment', text: i18n("app.messages") },
'Meetings': { path: '#/meetings', icon: 'fa-handshake', text: i18n("app.meetings") },
'Notification': { path: '#/notifs', icon: 'fa-bell', text: i18n("app.notifications") },
'Forum': { path: '#/forums', icon: 'fa-envelope', text: i18n("app.forum") },
'Forum': { path: '#/forum', icon: 'fa-envelope', text: i18n("app.forum") },
'Schedule': { path: '#/schedule', icon: 'fa-calendar-days', text: i18n("app.schedules") },
'Inscription': { path: '#/inscription', icon: 'fa-users', text: i18n("app.inscription.requests") },
'ManageCourses': { path: '#/manage-courses', icon: 'fa-book', text: i18n("app.manage.courses") },

View File

@ -1,71 +0,0 @@
import { ref } from 'vue'
import { restGet, restPost, restDelete, restPatch } from './restConsumer.js'
/**
* List forums of a course
*/
export async function getForumsOfCourse(id){
ForumsOfCurrentCourse.value = [
{
id: 1,
name: "forum~1"
},
{
id: 2,
name: "forum~2"
},
]
// ForumsOfCurrentCourse = await restGet("/forums/" + id)
}
export const ForumsOfCurrentCourse = ref();
/**
* List post of a specified forum
*/
export async function getPostsOfForum(id){
PostsOfCurrentForum.value = [
{
id: 1,
name: "Post~1"
},
{
id: 2,
name: "Post~2"
},
]
// PostsCurrentForum.value = await restGet("/forum/" + id);
}
export const PostsOfCurrentForum = ref();
/**
* Get a post and its responses
*/
export async function fetchPost(id){
fetchedPost.value = {
id: 1,
subject: "This is the subject of the post",
content: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",
messages: [
{
id: 1,
author: "author~1",
content: "J'ai pas copris le message !"
},
{
id: 2,
author: "author~2",
content: "tu as fait une faute dans ton message..."
},
{
id: 3,
author: null,
content: "I'm anonymous noww..."
}
]
}
// fetchedPost.value = await restGet("/forum/post/" + id);
}
export const fetchedPost = ref();