From 021267f17dcef8989648a3739e47bb2bdbc8cbc3 Mon Sep 17 00:00:00 2001 From: Sam Hadow Date: Wed, 12 Feb 2025 20:13:08 +0100 Subject: [PATCH] pug login logout button changes --- src/views/index.pug | 46 ++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/src/views/index.pug b/src/views/index.pug index 4f84c23..832f352 100644 --- a/src/views/index.pug +++ b/src/views/index.pug @@ -8,7 +8,10 @@ html(lang="en-US") script(src="/socket.io/socket.io.js", defer) script(src="/script.js", defer) script(type="module", src="/ecc.js", defer) - script(type="module", src="/popups.js", defer) + if isLoggedIn + script(src="/chat.js", defer) + else + script(type="module", src="/popups.js", defer) link(rel="stylesheet" href="/css/bootstrap.min.css") body #mainbody @@ -19,31 +22,32 @@ html(lang="en-US") .btn-group.mr-2(role="group", aria-label="register") button#register.btn.btn-secondary(type="button") register button#login.btn.btn-secondary(type="button") login + + #registerPopup.popup + .popup-content + .btn-group.mr-2.w-100(role="group", aria-label="Add group") + input#sharedsecret.form-control.input-sm.w-50(type="password", placeholder="shared secret", required) + input#publickey.form-control.input-sm.w-50(type="text", placeholder="public key") + button#registerconfirm.btn.btn-secondary(type="button") register + button#registercancel.btn.btn-secondary(type="button") cancel + #registerPopupText + + #loginPopup.popup + .popup-content + .btn-group.mr-2.w-100(role="group", aria-label="Add group") + input#privatekey.form-control.input-sm.w-50(type="password", placeholder="private key", required) + button#loginconfirm.btn.btn-secondary(type="button") login + button#logincancel.btn.btn-secondary(type="button") cancel + else .btn-toolbar.btn-group-sm(role="toolbar", aria-label="Toolbar") .btn-group.mr-2(role="group", aria-label="logout") button#logout.btn.btn-secondary(type="button") logout - #registerPopup.popup - .popup-content - .btn-group.mr-2.w-100(role="group", aria-label="Add group") - input#sharedsecret.form-control.input-sm.w-50(type="password", placeholder="shared secret", required) - input#publickey.form-control.input-sm.w-50(type="text", placeholder="public key") - button#registerconfirm.btn.btn-secondary(type="button") register - button#registercancel.btn.btn-secondary(type="button") cancel - #registerPopupText + ul#messages - #loginPopup.popup - .popup-content - .btn-group.mr-2.w-100(role="group", aria-label="Add group") - input#privatekey.form-control.input-sm.w-50(type="password", placeholder="private key", required) - button#loginconfirm.btn.btn-secondary(type="button") login - button#logincancel.btn.btn-secondary(type="button") cancel + form#form(action="") + input#input(autocomplete="off") + button Send - a.btn.btn-primary(href="./account/cookie") Get cookie - ul#messages - - form#form(action="") - input#input(autocomplete="off") - button Send