From 1a17651cebf2d721733974ad2137a30792e63864 Mon Sep 17 00:00:00 2001 From: Wawilski Date: Tue, 12 Mar 2024 11:10:14 +0100 Subject: [PATCH 1/3] course management --- frontend/src/App.vue | 17 ++++--- frontend/src/Apps/ManageCourses.vue | 78 +++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 6 deletions(-) create mode 100644 frontend/src/Apps/ManageCourses.vue diff --git a/frontend/src/App.vue b/frontend/src/App.vue index ef68173..114cacc 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -8,11 +8,13 @@ import LoginPage from './Apps/Login.vue' import Inscription from "./Apps/Inscription.vue" import Profil from "./Apps/Profil.vue" + import Courses from "./Apps/ManageCourses.vue" const apps = { '/login': LoginPage, '/inscription': Inscription, - '/profil': Profil + '/profil': Profil, + '/manage-courses' : Courses, } const currentPath = ref(window.location.hash) @@ -97,8 +99,12 @@
{{i18n("app.forum")}}
  • -
    -
    {{i18n("app.inscription.requests")}}
  • +
    +
    {{i18n("app.inscription.requests")}}
    + +
  • +
    +
    Manage courses
  • @@ -246,7 +252,6 @@ } .text { - position: absolute; right: 0%; width: 0%; opacity: 0; @@ -258,9 +263,9 @@ ul.vertical:hover .text { opacity: 1; - width: 70%; + width: 60%; transition-duration: .3s; - padding-left: 5px; + padding-left: 15px; } diff --git a/frontend/src/Apps/ManageCourses.vue b/frontend/src/Apps/ManageCourses.vue new file mode 100644 index 0000000..d006f32 --- /dev/null +++ b/frontend/src/Apps/ManageCourses.vue @@ -0,0 +1,78 @@ + + + + -- 2.48.1 From 438867f4eb3f290bb07154e7d592993b65fc0bd8 Mon Sep 17 00:00:00 2001 From: Wawilski Date: Wed, 13 Mar 2024 15:07:17 +0100 Subject: [PATCH 2/3] Create Course --- frontend/src/Apps/Login.vue | 1 - frontend/src/Apps/ManageCourses.vue | 159 +++++++++++++++++++++++++++- 2 files changed, 156 insertions(+), 4 deletions(-) diff --git a/frontend/src/Apps/Login.vue b/frontend/src/Apps/Login.vue index 786c786..1927230 100644 --- a/frontend/src/Apps/Login.vue +++ b/frontend/src/Apps/Login.vue @@ -165,7 +165,6 @@ .inputBox input,button,select { width:100%; - background:rgb(255, 0 255); border: none; margin-right: 50px; padding-left: 10px; diff --git a/frontend/src/Apps/ManageCourses.vue b/frontend/src/Apps/ManageCourses.vue index d006f32..6925685 100644 --- a/frontend/src/Apps/ManageCourses.vue +++ b/frontend/src/Apps/ManageCourses.vue @@ -1,4 +1,6 @@ @@ -75,4 +164,68 @@ const cursus=[ border-radius:20px; margin-bottom:10px; } + +.modify{ + font-size:25px; + padding:10px 10px 10px 10px; + background-color: rgb(239,60,168); + cursor: pointer; + border:none; + border-radius:15px; +} + + input, select{ + + font-size:25px; + cursor: pointer; + border:none; + border-radius:15px; + } + button{ + font-size:15px; + height:50px; + width:100px; + border:none; + border-radius:20px; + + } + + .buttonGrid{ + display:grid; + grid-template-columns: auto auto; + column-gap:50px; + grid-template-areas: + "create delete"; + } + + .create{ + grid-area:create; + + background-color:rgb(0,200,0); + + } + + .delete{ + grid-area:delete; + background-color:rgb(200,0,0); + } + + .listTitle{ + display: flex; + justify-content: center; + align-items: center; + width:400px; + margin-left:auto; + margin-right:auto; + border:2px solid black; + font-size:25px; + color:white; + padding:20px; + background-color:rgb(50,50,50); + border-radius:20px;margin-bottom:10px; + + button:hover{ + opacity:0.8; + } +} -- 2.48.1 From 0be7eab6967a043f503aa9fce3b68dac3e76e12d Mon Sep 17 00:00:00 2001 From: Wawilski Date: Wed, 13 Mar 2024 17:48:48 +0100 Subject: [PATCH 3/3] Remove course --- frontend/src/Apps/ManageCourses.vue | 100 ++++++++++++++++++++-------- 1 file changed, 73 insertions(+), 27 deletions(-) diff --git a/frontend/src/Apps/ManageCourses.vue b/frontend/src/Apps/ManageCourses.vue index 6925685..d92fcf9 100644 --- a/frontend/src/Apps/ManageCourses.vue +++ b/frontend/src/Apps/ManageCourses.vue @@ -14,18 +14,30 @@ const cursus=[ "name": "Operating Systems", "credits": 8, "faculty": "science", - "teacher": 14, + "teacher": 62, "Assistants": []}, { "id": 52, "name": "Fonctionnement des ordinateurs", "credits": 11, "faculty": "science", - "teacher": 42, + "teacher": 59, "Assistants": []}, ] + const profList=[42,45,62,84,59] + + const createMod = ref(false) + const deleteMod = ref(false) + + const editElementID = ref(""); + + function editItem(id){ + editElementID = id; + } + + //Juste pour montrer le Create Mode const pattern = { "id": 0, @@ -35,73 +47,107 @@ const cursus=[ "teacher": null, "Assistants": []} -const profList=[42,45,62,84,59] - - const createMod = ref(false) - const deleteMod = ref(false) - - const editElementID = ref(""); - let toAdd = Object.assign({}, pattern); function addToCourse (){ - toAdd.id=(cursus[cursus.length-1].id)-1; + if (cursus.length>0){ + toAdd.id=(cursus[cursus.length-1].id)-1;} + else{ + toAdd.id=0; + } let isnull= false; for(const [key, value] of Object.entries(toAdd)){ - console.log(value) if(value === null){ isnull=true; } - console.log(isnull) } - console.log(toAdd) if (!isnull){ cursus.push(toAdd); } - toAdd= Object.assign({},pattern); } + - function editItem(id){ - editElementID = id; + //Juste pour montrer le Delete Mode + let toRemove; + + function removeCourse() { + console.log("ok"); + console.log(toRemove); + let rem=-1; + for(const [key, value] of Object.entries(cursus)){ + console.log(key); + console.log(value) + if(value.name === toRemove){ + rem = key; + break; + } + } + console.log(rem) + if (rem > -1){ + cursus.splice(rem, 1);} + console.log(cursus); }