Getting grades

This commit is contained in:
Pengwius 2021-01-09 20:58:49 +01:00
parent 21254aa170
commit 8c5045d2a8
20 changed files with 205 additions and 482 deletions

View file

@ -2,52 +2,30 @@ import json
import requests
def get_grades(register_id, register_r, oun, s):
cookies = s
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r.json()['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
})
else:
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
cookies.update({
"biezacyRokSzkolny": f"{register_r['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r['data'][0]['IdUczen']}"
})
grades = s.post(oun+'/Oceny.mvc/Get', headers={"User-Agent": "Wulkanowy-web :)"}, cookies=cookies, json={'okres': register_id})
headers = {
'Accept-Encoding': 'gzip, deflate',
'Accept': '*/*',
'Connection': 'keep-alive',
"User-Agent": "Wulkanowy-web :)"
}
grades = requests.post(oun+'/Oceny.mvc/Get', headers=headers, cookies=cookies, json={'okres': register_id})
return grades.json()
def prepare_grades_for_display(register_id, register_r, oun, s):
grades = get_grades(register_id, register_r, oun, s)
i = 0
a = 0
json_grades = {}
lesson_name = []
while True:
lesson_name.append(grades['data']['Oceny'][i]['Przedmiot'])
json_grades.update({grades['data']['Oceny'][i]['Przedmiot']: []})
if grades['data']['Oceny'][i]['OcenyCzastkowe'] != []:
while True:
json_grades[lesson_name[i]].append({'Ocena': grades['data']['Oceny'][i]['OcenyCzastkowe'][a]['Wpis'],
'Nauczyciel': grades['data']['Oceny'][i]['OcenyCzastkowe'][a]['Nauczyciel'],
'Opis': grades['data']['Oceny'][i]['OcenyCzastkowe'][a]['NazwaKolumny'],
'Data': grades['data']['Oceny'][i]['OcenyCzastkowe'][a]['DataOceny'],
'Waga Oceny': grades['data']['Oceny'][i]['OcenyCzastkowe'][a]['Waga']})
if grades['data']['Oceny'][i]['OcenyCzastkowe'][a] == grades['data']['Oceny'][i]['OcenyCzastkowe'][-1]:
a = 0
break
a += 1
if grades['data']['Oceny'][i]['Pozycja'] == grades['data']['Oceny'][-1]['Pozycja']:
break
i += 1
return [json_grades, lesson_name]
return grades.json()

View file

@ -1,6 +1,7 @@
import os
import sys
import requests
from django.contrib.sessions.models import Session
from django.http import JsonResponse
from django import template
from django.utils.safestring import mark_safe
@ -11,18 +12,16 @@ from django.shortcuts import redirect
from bs4 import BeautifulSoup
import datetime
def sender(url, loginName, Password, params_names, fail_phrase, symbol, diary_url):
def sender(url, loginName, Password, params_names, fail_phrase, symbol, diary_url, s):
data = [params_names[0], loginName, params_names[1], Password]
sender_return = send(url, data, fail_phrase, diary_url, symbol)
print(sender_return)
sender_return = send(url, data, fail_phrase, diary_url, symbol, s)
if sender_return == {'success': False}:
return {'success': False}
else:
return sender_return
def send(url, data, fail, diary_url, symbol):
s = requests.Session()
def send(url, data, fail, diary_url, symbol, s):
ready_data = {data[0]: data[1], data[2]: data[3]}
page = s.post(url=url, data=ready_data)
if fail in page.text:
@ -36,7 +35,7 @@ def send(url, data, fail, diary_url, symbol):
wctx = bs.find('input', {'name': 'wctx'})['value']
crtr = s.post(url=wctx, headers={"User-Agent": "Wulkanowy-web :)"}, data={"wa": wa, "wresult": cert, "wctx": wctx})
bs = BeautifulSoup(crtr.content, 'html.parser')
for a in bs.find_all('a', title='Uczeń'):
oun = a['href']
@ -75,6 +74,7 @@ def get_cookies(symbol, oun, s):
'date': date,
'school_year': school_year,
'symbol': symbol,
's': s.cookies.get_dict()
}
return data

View file

@ -2,10 +2,12 @@ from requests import get
from django.http import HttpResponse, JsonResponse
from django.shortcuts import render
import json
import requests
from django.core import serializers
from django.shortcuts import redirect
from django.contrib.sessions.models import Session
from .login import sender
from .API.grades import prepare_grades_for_display
from .API.grades import get_grades
from .API.exams import prepare_exams_for_display
from .API.timetable import prepare_timetable_for_display
from .API.notes import prepare_notes_for_display
@ -17,11 +19,13 @@ def default_view(request, *args, **kwargs):
return render(request, 'index.html')
def content_view(request, *args, **kwargs):
return render(request, 'content.html')
if request.session.has_key('is_logged'):
return render(request, 'content.html')
else:
return render(request, 'index.html')
#API
def login(request, *args, **kwargs):
sender_return = None
data = json.loads(request.body)
loginName = data['loginName']
Password = data['Password']
@ -31,7 +35,8 @@ def login(request, *args, **kwargs):
link = f'{diary_url}{symbol}/Account/LogOn?ReturnUrl=%2F{symbol}%2FFS%2FLS%3Fwa%3Dwsignin1.0%26wtrealm%3Dhttps%253a%252f%252fuonetplus.vulcan.net.pl%252f{symbol}%252fLoginEndpoint.aspx%26wctx%3Dhttps%253a%252f%252fuonetplus.vulcan.net.pl%252f{symbol}%252fLoginEndpoint.aspx'
else:
link = 'http://cufs.fakelog.cf/powiatwulkanowy/FS/LS?wa=wsignin1.0&wtrealm=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx&wctx=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx'
sender_return = sender(link, loginName, Password, ('loginName', 'Password'), 'Zła nazwa użytkownika lub hasło', symbol, diary_url)
s = requests.Session()
sender_return = sender(link, loginName, Password, ('loginName', 'Password'), 'Zła nazwa użytkownika lub hasło', symbol, diary_url, s)
if sender_return == {'success': False}:
data_response = {
'success': False
@ -39,5 +44,14 @@ def login(request, *args, **kwargs):
else:
request.session['is_logged'] = True
data_response = {'success': True, 'data': sender_return}
print(data_response)
return JsonResponse(data_response)
return JsonResponse(data_response)
def grades(request, *args, **kwargs):
if request.session.has_key('is_logged'):
data = json.loads(request.body)
register_id = data['data']['register_id']
register_r = data['data']['register_r']
oun = data['data']['oun']
s = data['data']['s']
grades = get_grades(register_id, register_r, oun, s)
return JsonResponse(grades, safe=False)

63
files/css/start.css Normal file
View file

@ -0,0 +1,63 @@
body {
padding: 0 !important;
height: 100vh;
background: -webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.3)),to(rgba(0,0,0,.3))),url(../images/wallpaper.b24bba72.jpg);
background: linear-gradient(rgba(0,0,0,.3),rgba(0,0,0,.3)),url(../images/wallpaper.jpg);
background-size: cover;
background-position: 50%;
background-attachment: fixed;
overflow: auto;
display: -webkit-box;
display: -ms-flexbox;
font-family: 'Poppins', sans-serif;
font-size: 10px;
margin: 0 !important;
color: black;
}
.logo img[data-v-cd2b8d62] {
width: 768px;
max-width: 30vw;
display: inline;
-webkit-filter: drop-shadow(0 5px 5px rgba(0,0,0,.2)) drop-shadow(0 8px 10px rgba(0,0,0,.14)) drop-shadow(0 3px 14px rgba(0,0,0,.12));
filter: drop-shadow(0 5px 5px rgba(0,0,0,.2)) drop-shadow(0 8px 10px rgba(0,0,0,.14)) drop-shadow(0 3px 14px rgba(0,0,0,.12));
}
#container{
width: 100%;
}
#menu{
width: 95%;
height: 18%;
margin-left: 2.5%;
border-bottom: 4px solid white;
border-radius: 3px;
font-family: 'Open Sans Condensed', sans-serif;
font-family: 'Quicksand', sans-serif;
}
.option{
display: inline;
color: white;
margin-top: 3.650431902835478167382628592617195404756384%;
margin-right: 2.2%;
float: right;
cursor: pointer;
}
#content{
overflow: auto;
width: 85%;
height: 60%;
margin-top: 2%;
opacity: 85%;
padding: 40px;
position: absolute;
top: 56%;
left: 50%;
transform: translate(-50%,-50%);
text-align: center;
margin-bottom: 0px;
background-color: #ededed;
border-radius: 24px;
box-shadow: 10px 10px 15px;
font-family: 'Lora', serif;
font-size: 200%;
}

View file

@ -17,7 +17,7 @@
body {
height: 100vh;
background: -webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.3)),to(rgba(0,0,0,.3))),url(../images/wallpaper.b24bba72.jpg);
background: linear-gradient(rgba(0,0,0,.3),rgba(0,0,0,.3)),url(images/wallpaper.jpg);
background: linear-gradient(rgba(0,0,0,.3),rgba(0,0,0,.3)),url(../images/wallpaper.jpg);
background-size: cover;
background-position: 50%;
background-attachment: fixed;

View file

@ -1,180 +0,0 @@
@media screen and (max-width: 768px){
.box {
width: 60% !important;
height: 45% !important;
}
.logo img[data-v-cd2b8d62] {
margin: 0 !important;
margin-top: -55% !important;
}
#icons
{
bottom: -36% !important;
size: 70% !important;
margin: 0 !important;
margin-top: 20% !important;
}
}
body {
height: 100vh;
background: -webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.3)),to(rgba(0,0,0,.3))),url(../img/wallpaper.b24bba72.jpg);
background: linear-gradient(rgba(0,0,0,.3),rgba(0,0,0,.3)),url(img/wallpaper.jpg);
background-size: cover;
background-position: 50%;
background-attachment: fixed;
overflow: auto;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
font-family: 'Poppins', sans-serif;
font-size: 10px;
margin: 0 !important;
color: black;
}
.logo img[data-v-cd2b8d62] {
width: 768px;
max-width: 90vw;
display: block;
-webkit-filter: drop-shadow(0 5px 5px rgba(0,0,0,.2)) drop-shadow(0 8px 10px rgba(0,0,0,.14)) drop-shadow(0 3px 14px rgba(0,0,0,.12));
filter: drop-shadow(0 5px 5px rgba(0,0,0,.2)) drop-shadow(0 8px 10px rgba(0,0,0,.14)) drop-shadow(0 3px 14px rgba(0,0,0,.12));
}
h1 {
font-size: 2em;
font-weight: bold;
}
h2 {
color: red;
}
#container[data-v-cd2b8d62] {
padding-bottom: 48px;
height: 100vh;
-webkit-box-sizing: border-box;
box-sizing: border-box;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
font-family: Roboto,sans-serif;
}
img{
margin-top: -25em;
margin-left: 0em;
font-size: 70%;
}
.box{
width: 25%;
height: 55%;
padding: 40px;
position: absolute;
top: 56%;
left: 50%;
transform: translate(-50%,-50%);
text-align: center;
margin-bottom: 0px;
background-color: #ededed;
border-radius: 24px;
box-shadow: 10px 10px 15px
}
.box h1{
color: black;
text-transform: uppercase;
font-weight: 500;
}
.box input[type = "text"],.box input[type = "password"]{
border:0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #565656;
padding: 14px 18px;
width: 75%;
outline: none;
color: black;
border-radius: 24px;
transition: 0.25s;
}
.box input[type = "text"]:focus,.box input[type = "password"]:focus{
width: 90%;
border-color: #2ecc71;
}
.box input[type = "submit"]{
border:0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #2ecc71;
padding: 14px 40px;
outline: none;
color: black;
border-radius: 24px;
transition: 0.25s;
cursor: pointer;
}
.box input[type = "submit"]:hover{
background: #2ecc71;
}
.icon {
width: 50px;
margin: 0px;
margin-left: 0.6%;
margin-right: 0.6%;
padding: 0px;
}
#icons
{
position: relative;
display: inline;
bottom: -50%;
margin-left: 0em;
width: 100%;
margin-left: auto;
margin-right: auto;
text-align: center;
font-size: 80%;
}
a {
font-size: 120%;
color: blue;
margin-bottom: 5%;
}
#help-box {
font-size: 200%;
}
p{
size: 0px;
padding: 0px;
margin: 0px;
height: 48px;
margin-bottom: 15px;
margin-top: 10px;
}
label{
size: 0px;
padding: 0px;
margin: 0px;
font-size: 0px;
}
#button{
margin-top: 4%;
margin-bottom: 0px;
}
#con{
margin-bottom: 12.5%;
}

7
files/js/attendance.js Normal file
View file

@ -0,0 +1,7 @@
const attendance_ = document.querySelector('#attendance_');
const getAttendance = () => {
document.querySelector('#content').innerHTML = 'Here is attendance (in my imagination)';
}
attendance_.addEventListener('click', getAttendance);

7
files/js/exams.js Normal file
View file

@ -0,0 +1,7 @@
const exams_ = document.querySelector('#exams_');
const getExams = () => {
document.querySelector('#content').innerHTML = 'Here is exams (in my imagination)';
}
exams_.addEventListener('click', getExams);

22
files/js/grades.js Normal file
View file

@ -0,0 +1,22 @@
const grades_ = document.querySelector('#grades_');
myStorage = window.sessionStorage;
const getGrades = () => {
document.querySelector('#content').innerHTML = 'Here is grades (in my imagination)';
cookies_data = sessionStorage.getItem('cookies_data');
csrfcookie_ = sessionStorage.getItem('csrfcookie');
fetch(url = '../api/grades', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json',
'X-CSRFToken': csrfcookie_
},
body: cookies_data
}).then(response => response.json()).then(data => {
console.log(data);
})
}
grades_.addEventListener('click', getGrades);

7
files/js/homeworks.js Normal file
View file

@ -0,0 +1,7 @@
const homeworks_ = document.querySelector('#homeworks_');
const getHomeworks = () => {
document.querySelector('#content').innerHTML = 'Here is homeworks (in my imagination)';
}
homeworks_.addEventListener('click', getHomeworks);

View file

@ -31,10 +31,13 @@ const login = () => {
body: JSON.stringify(data)
}).then(response => response.json()).then(data => {
if(data['success']){
window.location.href = "/content/"
myStorage = window.sessionStorage;
sessionStorage.setItem('cookies_data', JSON.stringify(data));
sessionStorage.setItem('csrfcookie', csrfcookie())
window.location.href = "/content/";
}
else{
document.querySelector('#error').innerHTML = 'Nieprawidłowy login, hasło lub symbol'
document.querySelector('#error').innerHTML = 'Nieprawidłowy login, hasło lub symbol';
}
});
}

7
files/js/messages.js Normal file
View file

@ -0,0 +1,7 @@
const messages_ = document.querySelector('#messages_');
const getMessages = () => {
document.querySelector('#content').innerHTML = 'Here is messages (in my imagination)';
}
messages_.addEventListener('click', getMessages);

7
files/js/notes.js Normal file
View file

@ -0,0 +1,7 @@
const notes_ = document.querySelector('#notes_');
const getNotes = () => {
document.querySelector('#content').innerHTML = 'Here is notes (in my imagination)';
}
notes_.addEventListener('click', getNotes);

7
files/js/timetable.js Normal file
View file

@ -0,0 +1,7 @@
const timetable_ = document.querySelector('#timetable_');
const getTimetable = () => {
document.querySelector('#content').innerHTML = 'Here is timetable (in my imagination)';
}
timetable_.addEventListener('click', getTimetable);

View file

@ -1,225 +0,0 @@
body {
padding: 0 !important;
height: 100vh;
background: -webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.3)),to(rgba(0,0,0,.3))),url(../images/wallpaper.b24bba72.jpg);
background: linear-gradient(rgba(0,0,0,.3),rgba(0,0,0,.3)),url(images/wallpaper.jpg);
background-size: cover;
background-position: 50%;
background-attachment: fixed;
overflow: auto;
display: -webkit-box;
display: -ms-flexbox;
font-family: 'Poppins', sans-serif;
font-size: 10px;
margin: 0 !important;
color: black;
}
.logo img[data-v-cd2b8d62] {
width: 768px;
max-width: 30vw;
display: inline;
-webkit-filter: drop-shadow(0 5px 5px rgba(0,0,0,.2)) drop-shadow(0 8px 10px rgba(0,0,0,.14)) drop-shadow(0 3px 14px rgba(0,0,0,.12));
filter: drop-shadow(0 5px 5px rgba(0,0,0,.2)) drop-shadow(0 8px 10px rgba(0,0,0,.14)) drop-shadow(0 3px 14px rgba(0,0,0,.12));
}
#container{
width: 100%;
}
#menu{
width: 95%;
height: 18%;
margin-left: 2.5%;
border-bottom: 4px solid white;
border-radius: 3px;
font-family: 'Open Sans Condensed', sans-serif;
font-family: 'Quicksand', sans-serif;
}
.option{
display: inline;
color: white;
margin-top: 3.650431902835478167382628592617195404756384%;
margin-right: 2.2%;
float: right;
}
.content{
overflow: auto;
width: 85%;
height: 60%;
margin-top: 2%;
opacity: 85%;
padding: 40px;
position: absolute;
top: 56%;
left: 50%;
transform: translate(-50%,-50%);
text-align: center;
margin-bottom: 0px;
background-color: #ededed;
border-radius: 24px;
box-shadow: 10px 10px 15px;
font-family: 'Lora', serif;
font-size: 200%;
}
.lesson{
background-color: #fefefe;
border-radius: 24px;
font-family: 'Open Sans Condensed', sans-serif;
font-family: 'Quicksand', sans-serif;
z-index: 2;
text-align: center;
font-size: 150%;
width: 100%;
cursor: pointer;
padding-top: 3vh;
padding-bottom: 0.5vh;
}
ul{
list-style-type: none;
}
li{
list-style-type: none;
}
#grades{
float: left;
}
.description{
text-align: center;
margin-right: 7vw;
}
.description::before{
position: absolute;
}
.grade{
display: absolute;
height: 39.75px;
width: 39.75px;
margin-left: 3vw;
font-size: 99%;
border-radius: 10px;
}
.grade::before{
position: absolute;
border-bottom: 2px solid #cdcdcd;
height: 8%;
content: '';
width: 80%;
}
.grade-else{
display: absolute;
height: 39.75px;
width: block;
margin-left: 3vw;
font-size: 99%;
border-radius: 10px;
}
.grade-else::before{
position: absolute;
border-bottom: 2px solid #cdcdcd;
height: 8%;
content: '';
width: 80%;
}
.item{
border-top: 2px solid black;
width: 90%;
padding: 5%;
border-radius: 10px;
height: 17%;
overflow: auto;
color: black;
-ms-overflow-style: none;
scrollbar-width: none;
}
.item::-webkit-scrollbar {
display: none;
}
.header{
border-top: 2px solid black;
border-radius: 10px;
width: 90%;
padding: 5%;
color: black;
font-family: 'Open Sans Condensed', sans-serif;
font-family: 'Quicksand', sans-serif;
}
.column{
display: absolute;
height: 100%;
width: 16.66666666666667%;
float: left;
font-family: 'Open Sans Condensed', sans-serif;
font-family: 'Quicksand', sans-serif;
font-size: 90%;
color: black;
}
.line{
border-top: 1px solid black;
margin-top: 1vh;
margin-bottom: 1vh;
}
.day-name{
background-color: #bcbcbc;
}
.button{
text-align: center;
display: inline-block;
border-radius: 10px;
padding-top: 1%;
padding-bottom: 1%;
width: 33%;
background: -webkit-gradient(linear,left top,left bottom,from(rgb(81, 142, 240)),to(rgb(168, 201, 255)));
cursor: pointer;
font-family: 'Open Sans Condensed', sans-serif;
font-family: 'Quicksand', sans-serif;
}
.message-item {
border-top: 2px solid black;
width: 100%;
margin-bottom: 1vh;
border-radius: 10px;
overflow: auto;
color: black;
-ms-overflow-style: none;
scrollbar-width: none;
font-family: 'Open Sans Condensed', sans-serif;
font-family: 'Quicksand', sans-serif;
}
.message-block-left{
display: inline;
text-align: center;
float: left;
width: 60%;
}
.message-block-right{
margin-top: 1%;
float: right;
margin-right: 10%;
}
#buttons{
position: -webkit-sticky;
position: sticky;
margin-bottom: 1vh;
top: 0;
background-color: #ededed;
padding: 2%;
margin-top: 0;
}

View file

@ -5,9 +5,15 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="{% static 'start.css' %}" type="text/css" />
<link rel="stylesheet" media="min-width: 768px" href="{% static 'start.css' %}" />
<script src="{% static 'js/start.js' %}"></script>
<link rel="stylesheet" href="{% static 'css/start.css' %}" type="text/css" />
<script src="{% static 'js/start.js' %}" type="text/javascript" ></script>
<script src="{% static 'js/grades.js' %}" type="text/javascript" defer></script>
<script src="{% static 'js/timetable.js' %}" type="text/javascript" defer></script>
<script src="{% static 'js/exams.js' %}" type="text/javascript" defer></script>
<script src="{% static 'js/notes.js' %}" type="text/javascript" defer></script>
<script src="{% static 'js/attendance.js' %}" type="text/javascript" defer></script>
<script src="{% static 'js/homeworks.js' %}" type="text/javascript" defer></script>
<script src="{% static 'js/messages.js' %}" type="text/javascript" defer></script>
<link rel="shortcut icon" href="{% static 'images/27146352.png' %}">
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Lora:wght@500&display=swap" rel="stylesheet">
@ -20,17 +26,17 @@
<div id="menu">
<h1 data-v-cd2b8d62="" class="logo">
<img data-v-cd2b8d62 src="{% static 'images/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
<a href="#"><div id="uwagi" class="option">Uwagi</div></a>
<a href="#"><div id="wiadomosci" class="option">Wiadomości</div></a>
<a href="#"><div id="frekwencja" class="option">Frekwencja</div></a>
<a href="#"><div id="zadania" class="option">Zadania Domowe</div></a>
<a href="#"><div id="sprawdziany" class="option">Sprawdziany</div></a>
<a href="#"><div id="plan" class="option">Plan Lekcji</div></a>
<a href="#"><div id="oceny" class="option">Oceny</div></a>
<div id="notes_" class="option">Uwagi</div>
<div id="messages_" class="option">Wiadomości</div>
<div id="attendance_" class="option">Frekwencja</div>
<div id="homeworks_" class="option">Zadania Domowe</div>
<div id="exams_" class="option">Sprawdziany</div>
<div id="timetable_" class="option">Plan Lekcji</div>
<div id="grades_" class="option">Oceny</div>
</h1>
</div>
<div class="content">
<div id="content">
Tutaj będzie jakiś dashboard bla bla bla ;)
</div>
</body>
</html>

View file

@ -5,9 +5,8 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script src="{% static 'js/login.js' %}" defer></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" media="min-width: 768px" href="{% static 'style.css' %}" />
<link rel="stylesheet" href="{% static 'css/style.css' %}">
<link rel="shortcut icon" href="{% static 'images/27146352.png' %}">
<link href="https://fonts.googleapis.com/css2?family=Lora:wght@500&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.gstatic.com">
@ -18,7 +17,6 @@
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="{% static 'css/materialize.min.css' %}" media="screen,projection"/>
<link rel="stylesheet" href="{% static 'style.css' %}" type="text/css" />
<title>Wulkanowy | Aplikacja ucznia i rodzica</title>
</head>
<body>
@ -82,5 +80,6 @@
src="https://code.jquery.com/jquery-3.5.1.min.js"
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="
crossorigin="anonymous"></script>
<script type="text/javascript" src="{% static 'js/login.js' %}" defer></script>
</body>
</html>

View file

@ -17,14 +17,15 @@ from django.urls import path
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from app.views import default_view, content_view
from app.views import login
from app.views import login, grades
urlpatterns = [
#views
path('', default_view, name='home'),
path('content/', content_view, name='content'),
#api
path('api/login', login, name='login')
path('api/login', login, name='login'),
path('api/grades', grades, name='grades'),
]
urlpatterns += staticfiles_urlpatterns()