diff --git a/README.md b/README.md index c37d2e63b2ad4e65ba5524a3fed7116f011e6c39..40239656a2015944d230376c6c526b583484eb59 100644 --- a/README.md +++ b/README.md @@ -24,3 +24,4 @@ TODO ## Integration tests Run `pytest .` in the integration tests folder +## Serverside scripting must be enabled. (pylink.ini in home) diff --git a/loan-custom/caosdb-server/caosdb-webui/src/ext/js/box_loan.js b/loan-custom/caosdb-server/caosdb-webui/src/ext/js/box_loan.js index de85db38d1f34c17303cc111e2ac42a4cf45dac7..c7dfc6a2a81f03000af23af156913e2d1fbbabd0 100644 --- a/loan-custom/caosdb-server/caosdb-webui/src/ext/js/box_loan.js +++ b/loan-custom/caosdb-server/caosdb-webui/src/ext/js/box_loan.js @@ -29,7 +29,18 @@ function get_formatted_date(split) { return ((new Date(Date.now() - tzoffset)).toISOString()).split(split)[0]; } - +/** + * This function retrieves an html form from the html subdirectory. + * + */ +var getHTMLForm = async function(pageName, variables) { + var site = await connection.get("webinterface/html/forms/" + pageName + ".html", "html"); + var htmltext = site.getElementById("caosdb-form").innerHTML; + var req = /\{([0-9a-z-A-Z_]+)\}/g; + return htmltext.replace(req, (match, p1) => { + return variables[p1] || ""; + }); +} /** * AWI Box Loan, refactored code.