fixing my dumb merge
This commit is contained in:
@ -31,10 +31,9 @@ const apps = {
|
||||
'/users-list' : Users,
|
||||
'/students-list' : Students,
|
||||
'/manage-researcher-profile' : ManageResearcherProfile,
|
||||
'/msg' : Msg,
|
||||
'/researches' : ListResearches,
|
||||
'/researcher-profile': ResearcherProfile,
|
||||
'/create-user': CreateUser
|
||||
'/create-user': CreateUser,
|
||||
'/manage-owned-lessons': ManageOwnedLessons,
|
||||
'/manage-schedule-requests' : LessonRequests,
|
||||
'/msg' : Msg,
|
||||
@ -53,7 +52,7 @@ const appsList = {
|
||||
'StudentsList':{ path: '#/students-list',icon: 'fa-users',text: i18n("app.studentList")},
|
||||
'UsersList':{ path: '#/users-list',icon: 'fa-users',text: i18n("app.users")},
|
||||
'ManageResearcherProfile':{path:'#/manage-researcher-profile',icon:'fa-book-bookmark',text:i18n("app.manage.researcherProfile")},
|
||||
'CreateUser':{path:'#/create-user',icon:'fa-plus', text:i18n("app.Create.User")}
|
||||
'CreateUser':{path:'#/create-user',icon:'fa-plus', text:i18n("app.Create.User")},
|
||||
'ManageOwnedLessons':{path: '#/manage-owned-lessons',icon:'fa-calendar-days',text: i18n("app.manageOwnLessons")},
|
||||
'LessonRequests':{path: '#/manage-schedule-requests', icon:'fa-book', text: i18n("app.lessonRequests")},
|
||||
'Requests': { path: '#/requests', icon: 'fa-users', text: "Requests" },
|
||||
|
@ -1,103 +0,0 @@
|
||||
import { restGet } from './restConsumer.js'
|
||||
import { ref, computed } from 'vue'
|
||||
import i18n from '@/i18n.js'
|
||||
|
||||
// Liste des apps
|
||||
import LoginPage from '@/Apps/Login.vue'
|
||||
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 Schedule from "@/Apps/Schedule.vue"
|
||||
import ManageSchedule from "@/Apps/ManageSchedule.vue"
|
||||
import ManageOwnedLessons from "@/Apps/ManageOwnLessons.vue";
|
||||
import LessonRequests from "@/Apps/LessonRequests.vue";
|
||||
import Msg from "@/Apps/Msg.vue"
|
||||
import Forums from '@/Apps/Forums.vue'
|
||||
import Payments from "@/Apps/Inscription/PaymentInfo.vue";
|
||||
import ManageRequests from "@/Apps/Inscription/ManageRequests.vue";
|
||||
import ManageResearcherProfile from "@/Apps/ScientificPublications/ManageResearcherProfile.vue";
|
||||
import ListResearches from "@/Apps/ScientificPublications/ListResearches.vue";
|
||||
import ResearcherProfile from "@/Apps/ScientificPublications/ResearcherProfile.vue";
|
||||
import CreateUser from "@/Apps/CreateUser.vue";
|
||||
|
||||
const apps = {
|
||||
'/schedule': Schedule,
|
||||
'/manage-schedule': ManageSchedule,
|
||||
'/login': LoginPage,
|
||||
'/requests': ManageRequests,
|
||||
'/profil': Profil,
|
||||
'/manage-courses' : Courses,
|
||||
'/users-list' : Users,
|
||||
'/students-list' : Students,
|
||||
<<<<<<< HEAD
|
||||
'/manage-researcher-profile' : ManageResearcherProfile,
|
||||
'/msg' : Msg,
|
||||
'/researches' : ListResearches,
|
||||
'/researcher-profile': ResearcherProfile,
|
||||
'/create-user': CreateUser
|
||||
=======
|
||||
'/manage-owned-lessons': ManageOwnedLessons,
|
||||
'/manage-schedule-requests' : LessonRequests,
|
||||
'/msg' : Msg,
|
||||
'/forums': Forums,
|
||||
'/payments': Payments
|
||||
>>>>>>> origin/master
|
||||
}
|
||||
|
||||
const appsList = {
|
||||
'ListResearches': {path:'#/researches', icon:'fa-book-bookmark',text:i18n("app.list.researches")},
|
||||
'Msg': { path: '#/msg', icon: 'fa-comment', text: i18n("app.messages") },
|
||||
'Notification': { path: '#/notifs', icon: 'fa-bell', text: i18n("app.notifications") },
|
||||
'Forum': { path: '#/forums', icon: 'fa-envelope', text: i18n("app.forum") },
|
||||
'Schedule': { path: '#/schedule', icon: 'fa-calendar-days', text: i18n("app.schedules") },
|
||||
'ManageSchedules': { path: '#/manage-schedule', icon: 'fa-calendar-days', text: i18n("app.manageSchedules")},
|
||||
'ManageCourses': { path: '#/manage-courses', icon: 'fa-book', text: i18n("app.manage.courses") },
|
||||
'StudentsList':{ path: '#/students-list',icon: 'fa-users',text: i18n("app.studentList")},
|
||||
'UsersList':{ path: '#/users-list',icon: 'fa-users',text: i18n("app.users")},
|
||||
<<<<<<< HEAD
|
||||
'ManageResearcherProfile':{path:'#/manage-researcher-profile',icon:'fa-book-bookmark',text:i18n("app.manage.researcherProfile")},
|
||||
'CreateUser':{path:'#/create-user',icon:'fa-plus', text:i18n("app.Create.User")}
|
||||
|
||||
=======
|
||||
'ManageOwnedLessons':{path: '#/manage-owned-lessons',icon:'fa-calendar-days',text: i18n("app.manageOwnLessons")},
|
||||
'LessonRequests':{path: '#/manage-schedule-requests', icon:'fa-book', text: i18n("app.lessonRequests")},
|
||||
'Requests': { path: '#/requests', icon: 'fa-users', text: "Requests" },
|
||||
'Payments':{path: '#/payments', icon:'fa-users', text:i18n("app.payments")}
|
||||
>>>>>>> origin/master
|
||||
}
|
||||
|
||||
const currentPath = ref(window.location.hash)
|
||||
|
||||
export const currentView = computed(() => {
|
||||
return apps[currentPath.value.split("?")[0].slice(1) || '/']
|
||||
})
|
||||
|
||||
/**
|
||||
* Return the list of app accesible by a logged (or not)
|
||||
* user.
|
||||
*/
|
||||
export async function appList(){
|
||||
let ret = [];
|
||||
let userAppList = await restGet("/apps");
|
||||
for (let userapp in userAppList) {
|
||||
if(appsList[userAppList[userapp]] != null){
|
||||
ret.push(appsList[userAppList[userapp]])
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the specified page is authorized for the
|
||||
* user
|
||||
*/
|
||||
export async function checkPage(page){
|
||||
return restGet("/apps/" + page)
|
||||
}
|
||||
|
||||
window.addEventListener('hashchange', () => {
|
||||
currentPath.value = window.location.hash
|
||||
})
|
||||
|
||||
// vim:set noet sts=0 sw=4 ts=2 tw=2:
|
@ -1,85 +0,0 @@
|
||||
/**
|
||||
* Courses API
|
||||
*/
|
||||
|
||||
import { restGet, restPost, restDelete, restPatch } from './restConsumer.js'
|
||||
|
||||
/**
|
||||
* Create a new course
|
||||
*/
|
||||
<<<<<<< HEAD
|
||||
export async function createCourse(name, credits, owner){
|
||||
|
||||
return restPost("/course", {title: name, credits: credits, owner} )
|
||||
=======
|
||||
export async function createCourse(id,name, credits, owner){
|
||||
return restPost("/course/curriculum/" + id, {title: name, credits: credits, owner} )
|
||||
>>>>>>> origin/master
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the specified course
|
||||
*/
|
||||
export async function deleteCourse(id){
|
||||
return restDelete("/course/" + id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get information on a particular course
|
||||
*
|
||||
* @param id identification of the course
|
||||
*
|
||||
* @return all atribute of the specified course
|
||||
* - name
|
||||
* - credits
|
||||
* - faculty
|
||||
* - teacher
|
||||
* - assistants : list
|
||||
*/
|
||||
export async function getCourse(id){
|
||||
return restGet("/course/" + id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of courses to display on secretary's option
|
||||
*
|
||||
* @return list of courses of the form
|
||||
* - id
|
||||
* - name
|
||||
* - credits
|
||||
* - facutly
|
||||
* - teacher
|
||||
* - Assistants
|
||||
*/
|
||||
export async function getCourses(role){
|
||||
if(role==="Teacher"){
|
||||
return restGet("/courses/owned")
|
||||
}
|
||||
return restGet("/courses")
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Change the options of a course
|
||||
*
|
||||
* @param id the id of the course
|
||||
* @param changes Object with value to changes
|
||||
*
|
||||
* The changes object can contain:
|
||||
* - name
|
||||
* - credits
|
||||
* - faculty
|
||||
* - teacher
|
||||
* - assistants: should be a list and will replace all assistants
|
||||
*/
|
||||
export async function alterCourse(id, changes){
|
||||
return restPatch("/course/" + id, changes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list containing all the actual courses of a user
|
||||
*/
|
||||
|
||||
export async function getUserActualCourses(){
|
||||
return restGet("/usercourses")
|
||||
}
|
Reference in New Issue
Block a user