diff --git a/frontend/src/AppInbusImport.vue b/frontend/src/AppInbusImport.vue new file mode 100644 index 00000000..be8dd1b2 --- /dev/null +++ b/frontend/src/AppInbusImport.vue @@ -0,0 +1,251 @@ + + + + + diff --git a/frontend/src/ClassList.svelte b/frontend/src/ClassList.svelte index f11ed12a..94d30edb 100644 --- a/frontend/src/ClassList.svelte +++ b/frontend/src/ClassList.svelte @@ -63,7 +63,7 @@ $: { teacher={filter.teacher} clazz={filter.class} /> - + diff --git a/frontend/src/inbus.ts b/frontend/src/inbus.ts new file mode 100644 index 00000000..ac23d97b --- /dev/null +++ b/frontend/src/inbus.ts @@ -0,0 +1,27 @@ +export interface ConcreteActivity { + /** + Concrete activity in schedule. + */ + concreteActivityId: number; + order: number; + subjectVersionId: number; + subjectVersionCompleteCode: string; + educationTypeAbbrev: string; + beginTime: string; + endTime: string; + weekDayAbbrev: string; + teacherFullNames?: string; +} + +interface InbusSubject { + subjectId: number; + code: string; + abbrev: string; + title: string; +} + +export interface InbusSubjectVersion { + subjectVersionId: number; + subject: InbusSubject; + subjectVersionCompleteCode: string; +} diff --git a/frontend/src/main.js b/frontend/src/main.js index 3b233df2..2ab4ad02 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -146,6 +146,7 @@ window.addEventListener('DOMContentLoaded', focusTab); import { defineCustomElement, h } from 'vue'; import SuspensionWrapper from './components/SuspensionWrapper.vue'; import AllTasks from './Teacher/AllTasks.vue'; +import AppInbusImport from './AppInbusImport.vue'; /** * Register new Vue component as a custom element. @@ -182,3 +183,4 @@ const registerSuspendedVueComponent = (name, component, configureApp = undefined }; registerSuspendedVueComponent('tasks-all', AllTasks); +registerSuspendedVueComponent('import-inbus', AppInbusImport) diff --git a/templates/web/inbusimport.html b/templates/web/inbusimport.html new file mode 100644 index 00000000..ceff5df9 --- /dev/null +++ b/templates/web/inbusimport.html @@ -0,0 +1,5 @@ +{% extends 'web/layout.html' %} + +{% block fullcontent %} + +{% endblock %} diff --git a/web/urls.py b/web/urls.py index c44a9f40..9fadbe8b 100644 --- a/web/urls.py +++ b/web/urls.py @@ -9,6 +9,7 @@ urlpatterns = [ path("", common_view.index, name="index"), + path("import/inbus", common_view.import_inbus, name="import_inbus"), path("student-view", student_view.student_index, name="student_index"), path( "find-task///", diff --git a/web/views/common.py b/web/views/common.py index b55c6237..4569c3a7 100644 --- a/web/views/common.py +++ b/web/views/common.py @@ -1,4 +1,4 @@ -from django.contrib.auth.decorators import login_required +from django.contrib.auth.decorators import login_required, user_passes_test from django.shortcuts import render from django.utils.crypto import get_random_string from django.conf import settings @@ -17,6 +17,11 @@ def index(request): return student_index(request) +@user_passes_test(is_teacher) +def import_inbus(request): + return render(request, "web/inbusimport.html", {}) + + @login_required() def api_token(request): data = {