113 lines
2.9 KiB
TypeScript
113 lines
2.9 KiB
TypeScript
|
lib_plankton.zoo_page.register(
|
||
|
"view",
|
||
|
async (parameters, target_element) => {
|
||
|
const id : int = parseInt(parameters["id"]);
|
||
|
|
||
|
const form = new lib_plankton.zoo_form.class_form<any, any>(
|
||
|
value => value,
|
||
|
representation => representation,
|
||
|
new lib_plankton.zoo_input.class_input_group(
|
||
|
[
|
||
|
{
|
||
|
"name": "membership_number",
|
||
|
"input": new lib_plankton.zoo_input.class_input_text({"read_only": true}),
|
||
|
"label": "Mitgliedsnummer",
|
||
|
},
|
||
|
{
|
||
|
"name": "name_real_value",
|
||
|
"input": new lib_plankton.zoo_input.class_input_text({"read_only": true}),
|
||
|
"label": "Echter Name",
|
||
|
},
|
||
|
{
|
||
|
"name": "email_address_private_value",
|
||
|
"input": new lib_plankton.zoo_input.class_input_text({"read_only": true}),
|
||
|
"label": "Private E-Mail-Adresse",
|
||
|
},
|
||
|
{
|
||
|
"name": "email_address_numberbased_use",
|
||
|
"input": new lib_plankton.zoo_input.class_input_checkbox(/*{"read_only": true}*/),
|
||
|
"label": "Nummernbasierte E-Mail-Adresse verwenden",
|
||
|
},
|
||
|
{
|
||
|
"name": "email_address_namebased_use",
|
||
|
"input": new lib_plankton.zoo_input.class_input_checkbox(/*{"read_only": true}*/),
|
||
|
"label": "Namensbasierte E-Mail-Adresse verwenden",
|
||
|
},
|
||
|
{
|
||
|
"name": "email_redirect",
|
||
|
"input": new lib_plankton.zoo_input.class_input_checkbox(/*{"read_only": true}*/),
|
||
|
"label": "eingehende E-Mails zu privater Adresse umleiten",
|
||
|
},
|
||
|
{
|
||
|
"name": "name_display",
|
||
|
"input": new lib_plankton.zoo_input.class_input_text({"read_only": true}),
|
||
|
"label": "Anzeigename",
|
||
|
},
|
||
|
{
|
||
|
"name": "salutation",
|
||
|
"input": new lib_plankton.zoo_input.class_input_text({"read_only": true}),
|
||
|
"label": "Anrede/Pronomen",
|
||
|
},
|
||
|
{
|
||
|
"name": "name_login",
|
||
|
"input": new lib_plankton.zoo_input.class_input_text(
|
||
|
{
|
||
|
"pattern": "^[0-9a-zA-Z_]+$",
|
||
|
"read_only": true,
|
||
|
}
|
||
|
),
|
||
|
"label": "Anmeldename",
|
||
|
},
|
||
|
]
|
||
|
),
|
||
|
[
|
||
|
{
|
||
|
"label": "Zur Registrierung auffordern",
|
||
|
"procedure": async (get_value, get_representation) => {
|
||
|
const url : string = (
|
||
|
window.location.href.split("#")[0]
|
||
|
+
|
||
|
lib_plankton.zoo_page.encode(
|
||
|
{
|
||
|
"name": "register",
|
||
|
"parameters": {
|
||
|
"id": id,
|
||
|
"verification": "{{verification}}",
|
||
|
}
|
||
|
}
|
||
|
)
|
||
|
);
|
||
|
|
||
|
await _espe.backend.member_urge_for_registration(id, url);
|
||
|
|
||
|
/*
|
||
|
lib_plankton.zoo_page.set(
|
||
|
{
|
||
|
"name": "index",
|
||
|
"parameters": {},
|
||
|
}
|
||
|
);
|
||
|
*/
|
||
|
alert("Benachrichtigung verschickt");
|
||
|
},
|
||
|
},
|
||
|
]
|
||
|
);
|
||
|
|
||
|
let dom_fragment : DocumentFragment = template_request("view");
|
||
|
Promise.all(
|
||
|
[
|
||
|
form.setup(dom_fragment.querySelector(".view-form") as HTMLElement),
|
||
|
_espe.backend.member_get(id),
|
||
|
]
|
||
|
)
|
||
|
.then(
|
||
|
([_, member]) => {
|
||
|
form.input_write(member);
|
||
|
}
|
||
|
)
|
||
|
|
||
|
target_element.appendChild(dom_fragment);
|
||
|
},
|
||
|
);
|