Simple students displaying

This commit is contained in:
Tomasz 2021-01-25 22:56:04 +01:00
parent ee28e423a7
commit 1571f58f90
4 changed files with 10 additions and 2 deletions

View file

@ -38,7 +38,7 @@ const login = () => {
sessionStorage.setItem('csrfcookie', csrfcookie());
sessionStorage.setItem('email', document.querySelector('#id_loginName').value);
sessionStorage.setItem('symbol', document.querySelector('#id_Symbol').value);
window.location.href = "/content/";
window.location.href = "/account-manager/";
}
else{
document.querySelector('#error').innerHTML = 'Nieprawidłowy login, hasło lub symbol';

View file

@ -9,3 +9,9 @@ def content_view(request, *args, **kwargs):
return render(request, 'frontend/content.html')
else:
return redirect('../')
def account_manager_view(request, *args, **kwargs):
if request.session.has_key('is_logged'):
return render(request, 'frontend/account-manager.html')
else:
return redirect('../')

View file

@ -12,6 +12,7 @@ module.exports = {
notes : "./static/frontend/js/notes.js",
start : "./static/frontend/js/start.js",
timetable : "./static/frontend/js/timetable.js",
account_manager : "./static/frontend/js/account-manager.js",
},
output: {
filename: "out-[name].js",

View file

@ -16,13 +16,14 @@ Including another URLconf
from django.urls import path
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from frontend.views import default_view, content_view
from frontend.views import default_view, content_view, account_manager_view
from app.views import login, grades, timetable, exams, homeworks, attendance, notes, registered_devices, register_device_, received_messages, sent_messages, deleted_messages, school_data, dashboard, recipients, send, message_content
urlpatterns = [
#views
path('', default_view, name='home'),
path('content/', content_view, name='content'),
path('account-manager/', account_manager_view, name='account_manager'),
#api
path('api/login', login, name='login'),
path('api/grades', grades, name='grades'),