Study programme step is automatically skipped for faculties without programmes

This commit is contained in:
2025-10-07 12:09:00 +02:00
parent 670dd9596e
commit cc7a3908f6
2 changed files with 9 additions and 2 deletions

View File

@@ -55,6 +55,7 @@ let steps = {
}
},
programme: {
condition: () => programmes[steps.faculty.result.name] !== undefined,
title: "Který program studujete?",
layout: programme_layout,
result: {

10
ui.js
View File

@@ -232,14 +232,20 @@ async function run() {
let steps_len = Object.keys(steps).length;
while(id < steps_len) {
let step = get_step(id);
if(step.condition && !step.condition()) {
if(animation > 0) id++;
if(animation < 0) id--;
continue;
}
back_button.style.display = (id != 0) ? "" : "none";
next_button.innerText = (id < steps_len - 1) ? "Další →" : "Dokončit";
next_button.disabled = false;
container.innerHTML = "";
let step = get_step(id);
let title = new ElementBuilder("h1")
.html(step.title)
.finish();