Adding files
This commit is contained in:
parent
38c2c5316c
commit
a9f94d7586
2 changed files with 82 additions and 0 deletions
40
frontend/static/frontend/js/account-manager.js
Normal file
40
frontend/static/frontend/js/account-manager.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
var cookies_data = JSON.parse(sessionStorage.getItem('cookies_data'));
|
||||
students = cookies_data.data.register_r.data;
|
||||
|
||||
const displayData = () => {
|
||||
var primary = '';
|
||||
|
||||
students.forEach((student) =>{
|
||||
if(student.UczenNazwisko+' '+student.UczenImie2+' '+student.UczenImie+' '+student.UczenSymbol != primary){
|
||||
primary = student.UczenNazwisko+' '+student.UczenImie2+' '+student.UczenImie+' '+student.UczenSymbol;
|
||||
document.querySelector("#content").innerHTML += `<p>
|
||||
<label>
|
||||
<input class="with-gap" name="group1" value='`+student.UczenPelnaNazwa+`' type="radio" checked />
|
||||
<span>`+student.UczenPelnaNazwa+`</span>
|
||||
</label>
|
||||
</p>`
|
||||
}
|
||||
})
|
||||
document.querySelector("#content").innerHTML += `<button id="button" class="waves-light waves-effect btn red darken-1">LOGIN</button>`
|
||||
const button_ = document.querySelector("#button")
|
||||
button_.addEventListener('click', logIn)
|
||||
}
|
||||
|
||||
const logIn = () => {
|
||||
var ele = document.getElementsByName('group1');
|
||||
|
||||
for(i = 0; i < ele.length; i++) {
|
||||
if(ele[i].checked){
|
||||
studentName = ele[i].value;
|
||||
students.forEach((student) => {
|
||||
if(student.UczenPelnaNazwa == studentName){
|
||||
cookies_data.data.register_r.data = [student]
|
||||
sessionStorage.setItem('cookies_data', JSON.stringify(cookies_data));
|
||||
window.location.href = '/content/'
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('load', displayData)
|
42
frontend/templates/frontend/account-manager.html
Normal file
42
frontend/templates/frontend/account-manager.html
Normal file
|
@ -0,0 +1,42 @@
|
|||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="pl">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="{% static 'frontend/css/style.css' %}">
|
||||
<link rel="shortcut icon" href="{% static 'frontend/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">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
|
||||
|
||||
<!--Import Google Icon Font-->
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<!--Import materialize.css-->
|
||||
<link type="text/css" rel="stylesheet" href="{% static 'frontend/css/materialize.min.css' %}" media="screen,projection"/>
|
||||
<script src="{% static 'frontend/js/materializecss/materialize.min.js' %}"></script>
|
||||
<title>Wulkanowy | Aplikacja ucznia i rodzica</title>
|
||||
</head>
|
||||
<body>
|
||||
<div data-v-cd2b8d62 data-v-09be56d6 id="container">
|
||||
<div id="row">
|
||||
<h1 data-v-cd2b8d62="" class="logo">
|
||||
<img data-v-cd2b8d62 src="{% static 'frontend/images/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
|
||||
</h1>
|
||||
<div class="card white darken-1">
|
||||
<div id="content" class="card-content">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="{% static 'frontend/js/dist/out-account_manager.js' %}" defer></script>
|
||||
<script>
|
||||
var elem = document.querySelector('.tabs');
|
||||
var options = {}
|
||||
var instance = M.Tabs.init(elem, options);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue