concept OpenerTextConfig { S text; bool enabled; S actualText() { ret stringIf(enabled, text); } } sclass OpenerText { sO html(S uri, SS params, AuthedDialogID auth) null { S uri2 = appendSlash(uri); bool requestAuthed = auth != null; if (startsWith(uri2, "/opener-text-admin/")) { if (!requestAuthed) ret serveAuthForm(params.get('uri)); ret serveAdmin(uri, params); } } sS serveAdmin(S uri, SS params) { uniq(OpenerTextConfig); S _nav = p(ahref(rawBotLink(dbBotID), "Main admin") + " | " + ahref(baseLink + "/opener-text-admin", "Opener text")); HCRUD_Concepts data = new HCRUD_Concepts<>(OpenerTextConfig); data.fieldHelp = litmap( text := [[Text to show beside chat bot opener icon (e.g. "Contact us")]], enabled := "Actually show the text" ); HCRUD crud = new(rawLink("opener-text-admin"), data) { S frame(S title, S contents) { ret hhtml(hhead_title_htmldecode(title) + hbody( hsansserif() + hcss_responstable() + _nav + h1(title) + contents)); } }; crud.singleton = true; crud.cmdsLeft = true; crud.tableClass = "responstable"; ret crud.renderPage(params); } }