author_genders
-> author_pronouns
This commit is contained in:
6
data.js
6
data.js
@@ -18,7 +18,7 @@ let steps = {
|
|||||||
layout: author_info_layout,
|
layout: author_info_layout,
|
||||||
result: {
|
result: {
|
||||||
name: "",
|
name: "",
|
||||||
gender: ""
|
pronouns: ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
collaborators: {
|
collaborators: {
|
||||||
@@ -87,7 +87,7 @@ const theses = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const genders = {
|
const pronounss = {
|
||||||
"masculine": {
|
"masculine": {
|
||||||
name: "Mužský rod"
|
name: "Mužský rod"
|
||||||
},
|
},
|
||||||
@@ -106,7 +106,7 @@ const typst_header = `#import "template/template.typ": *
|
|||||||
document: "{thesis_type.type}",
|
document: "{thesis_type.type}",
|
||||||
title: (cs: "Návod na použití Typst TUL šablony"),
|
title: (cs: "Návod na použití Typst TUL šablony"),
|
||||||
author: "{author_info.name}",
|
author: "{author_info.name}",
|
||||||
author_gender: "{author_info.gender}",
|
author_pronouns: "{author_info.pronouns}",
|
||||||
<collaborators.has_supervisor: supervisor: "{collaborators.supervisor_name}",
|
<collaborators.has_supervisor: supervisor: "{collaborators.supervisor_name}",
|
||||||
><collaborators.has_consultant: consultant: "{collaborators.consultant_name}",
|
><collaborators.has_consultant: consultant: "{collaborators.consultant_name}",
|
||||||
> citations: "citations.bib",
|
> citations: "citations.bib",
|
||||||
|
12
ui.js
12
ui.js
@@ -50,15 +50,15 @@ async function author_info_layout(content, result) {
|
|||||||
.on_input((e) => result.name = e.target.value)
|
.on_input((e) => result.name = e.target.value)
|
||||||
.finish();
|
.finish();
|
||||||
|
|
||||||
if(!Object.keys(genders).includes(result.gender)) {
|
if(!Object.keys(pronounss).includes(result.pronouns)) {
|
||||||
document.querySelector("#next-button").disabled = true;
|
document.querySelector("#next-button").disabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let gender_buttons = new ButtonListBuilder(Object.keys(genders))
|
let pronouns_buttons = new ButtonListBuilder(Object.keys(pronounss))
|
||||||
.should_be_pressed((key) => result.gender == key)
|
.should_be_pressed((key) => result.pronouns == key)
|
||||||
.modify((b, key) => b.class("expand").text(genders[key].name))
|
.modify((b, key) => b.class("expand").text(pronounss[key].name))
|
||||||
.on_click((key) => {
|
.on_click((key) => {
|
||||||
result.gender = key;
|
result.pronouns = key;
|
||||||
document.querySelector("#next-button").disabled = false;
|
document.querySelector("#next-button").disabled = false;
|
||||||
})
|
})
|
||||||
.finish();
|
.finish();
|
||||||
@@ -69,7 +69,7 @@ async function author_info_layout(content, result) {
|
|||||||
.text("Způsob sebeoslovení")
|
.text("Způsob sebeoslovení")
|
||||||
.finish());
|
.finish());
|
||||||
content.appendChild(new ElementBuilder("div.horizontal-list")
|
content.appendChild(new ElementBuilder("div.horizontal-list")
|
||||||
.append_all(gender_buttons)
|
.append_all(pronouns_buttons)
|
||||||
.finish());
|
.finish());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user