diff --git a/data.js b/data.js index 403db55..98bcb89 100644 --- a/data.js +++ b/data.js @@ -107,13 +107,23 @@ let steps = { result.include_pdf = result.format === "external"; } }, - finishing_touches: { - title: "Závěrečné detaily", - layout: finishing_touches_layout, + other_details: { + title: "Ostatní detaily", + layout: other_details_layout, result: { has_keywords: true, has_acknowledgement: true } + }, + toolchain: { + title: "Jak budete používat Typst?", + layout: toolchain_layout, + result: { + toolchain: "online" + }, + finalize: (result) => { + result.include_makefile = result.toolchain === "local"; + } } } @@ -210,6 +220,15 @@ const assignment_formats = { } } +const toolchains = { + "online": { + name: "Pomocí webového editoru Typstu" + }, + "local": { + name: "Pomocí příkazové řádky" + } +} + const typst_header = `#import "template/template.typ": * #show: tultemplate2.with( @@ -218,11 +237,11 @@ const typst_header = `#import "template/template.typ": * lang: "{language.lang}", title: (cs: "{thesis_title.cs}", en: "{thesis_title.en}"), branch: ({language.lang}: "SEM DOPLŇTE SPECIALIZACI"), - result.toolchain == key) + .modify((b, key) => b.class("wide").text(toolchains[key].name)) + .on_click((key) => { + result.toolchain = key; + document.querySelector("#next-button").disabled = false; + }) + .finish(); + + for(const button of buttons) { + content.appendChild(button); + } + + content.appendChild(new ElementBuilder("div.vertical-spacer").finish()); + content.appendChild(new ElementBuilder("div.hint") + .text("Toto rozhodnutí pouze ovlivní, zda výsledná šablona bude obsahovat soubor Makefile pro jednodušší použití s příkazovou řádkou. Webový editor Typstu tento soubor nepotřebuje.") + .finish()); +} + async function run() { startbutton.style.cursor = "auto"; startbutton.disabled = true;