select-roles added

This commit is contained in:
konradm 2024-10-18 10:30:42 +02:00
parent 3ba6c026f2
commit e2eac05ab5
4 changed files with 35 additions and 2 deletions

View File

@ -53,7 +53,10 @@ tr:nth-child(even) {
/* Stylizacja kontenera klasy */
.select-class {
margin-top: 20px;
text-align: center;
}
.select-role {
text-align: center;
}
@ -64,6 +67,13 @@ tr:nth-child(even) {
border-radius: 4px;
}
.select-role select {
padding: 5px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 4px;
}
/* Stylizacja nagłówków */
h1, h2, h3 {
text-align: center;

View File

@ -100,6 +100,7 @@
],
"roles": {
"teacher": {
"name": "Teacher",
"criteria_ids": [
1,
2,
@ -111,6 +112,7 @@
]
},
"homeroom_teacher": {
"name": "Homeroom Teacher",
"criteria_ids": [
1,
2,
@ -123,6 +125,7 @@
]
},
"principal": {
"name": "Principal",
"criteria_ids": [
8,
9,
@ -131,6 +134,7 @@
]
},
"student": {
"name": "Student",
"criteria_ids": [
12,
13

View File

@ -112,6 +112,13 @@
<button onclick="changeDay(1)">Następny Dzień</button>
</div>
<div class="select-role">
<p>Wybierz role:</p>
<select id="select-role" class="select-role">
</select>
</div>
<div class="select-class" id="select-class-container">
<p>Wybierz klasę:</p>
<select class="select-class" id="select-class-select">

View File

@ -126,9 +126,21 @@ async function loadCriteria() {
const criteria = await fetchJSONFile(criteriaFilePath);
console.log("Załadowane kryteria:", criteria);
// Implementacja dalszego przetwarzania kryteriów, jeśli jest potrzebna
const roles = criteria.roles;
const selectroleByid = document.getElementById("select-role");
let selectroleHTML = ""; // Zainicjalizuj pusty string na HTML
// Iteracja przez klucze obiektu roles
for (const [key, value] of Object.entries(roles)) {
selectroleHTML += `<option value="${key}">${value.name}</option>`;
}
// Wstawienie HTML do elementu select
selectroleByid.innerHTML = selectroleHTML;
}
// Funkcja do przełączania głównych zakładek
function showTab(tabName) {
// Ukryj wszystkie główne taby