diff --git a/html/auth/login.html b/html/auth/login.html new file mode 100644 index 0000000..e69de29 diff --git a/html/template.html b/html/template.html new file mode 100644 index 0000000..df1afea --- /dev/null +++ b/html/template.html @@ -0,0 +1,16 @@ + + +
${error}
`); + }); + }); + + temp_engine.render(`templates/auth/login.html`); +} diff --git a/js/controllers/menu_mod.js b/js/controllers/menu_mod.js new file mode 100644 index 0000000..2b03e1e --- /dev/null +++ b/js/controllers/menu_mod.js @@ -0,0 +1,27 @@ +import { My } from "../skama_code/api/agent.js"; +import login from "./login.js"; + +function init_menu(temp_engine) { + temp_engine.add_event("#login-link", "click", () => { + login(temp_engine); + }); +} + +function loged_links() { + $("#links").html(` + + + + + + `); +} + +export default function menu_mod(temp_engine) { + init_menu(temp_engine); + if (My.agent) { + loged_links(); + } else { + unloged_links(); + } +} diff --git a/js/index.js b/js/index.js index e69de29..85f6808 100644 --- a/js/index.js +++ b/js/index.js @@ -0,0 +1,7 @@ +// Copyright © 2023 Entreprise SkamKraft +"use strict"; +import { TemplateEngine } from "./skama_code/ui/templeting_engine.js"; +import login from "./controllers/login.js"; + +let temp_engine = new TemplateEngine("html"); +login(temp_engine);