diff --git a/frontend/src/AppInbusImport.vue b/frontend/src/AppInbusImport.vue new file mode 100644 index 00000000..d16348c3 --- /dev/null +++ b/frontend/src/AppInbusImport.vue @@ -0,0 +1,266 @@ + + + + + + + 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/main.js b/frontend/src/main.js index a05d0f12..d0fd5547 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -145,6 +145,7 @@ window.addEventListener('DOMContentLoaded', focusTab); import { defineCustomElement } from 'vue'; import Example from './ExampleComponent.vue'; +import AppInbusImport from "./AppInbusImport.vue"; customElements.define( 'kelvin-example', @@ -152,3 +153,10 @@ customElements.define( shadowRoot: false // https://github.com/vuejs/core/issues/4314#issuecomment-2266382877 }) ); + +customElements.define( + 'kelvin-import-inbus', + defineCustomElement(AppInbusImport, { + shadowRoot: false // https://github.com/vuejs/core/issues/4314#issuecomment-2266382877 + }) +); 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 6affa115..a6914e2d 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..d46047a0 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 = {