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