From 4b02fe6392e45a29fcb93ea1714ee50fdea7835b Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Sat, 7 May 2022 19:28:50 -0500 Subject: [PATCH] admin: Add log out button --- CHANGES.rst | 2 ++ isso/css/admin.css | 3 +++ isso/js/admin.js | 6 +++++- isso/templates/admin.html | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 2d3670745..faa16b451 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -9,9 +9,11 @@ New Features - notifications: Implement 'List-Unsubscribe' header (`#906`_, ix5) - css: Grey styling for comment code, code blocks (`#907`_, ix5) +- admin: Add log out button (`#870`_, bbaovanc) .. _#906: https://github.com/posativ/isso/pull/906 .. _#907: https://github.com/posativ/isso/pull/907 +.. _#870: https://github.com/posativ/isso/pull/870 Breaking Changes ^^^^^^^^^^^^^^^^ diff --git a/isso/css/admin.css b/isso/css/admin.css index 3f694c34f..7df6f8b99 100644 --- a/isso/css/admin.css +++ b/isso/css/admin.css @@ -51,6 +51,9 @@ input { color: #4d4c4c; text-decoration: none; } +.header .logout { + float: right; +} .outer { background-color: #eeeeee; box-shadow: 0 0 0.5em #c0c0c0 inset; diff --git a/isso/js/admin.js b/isso/js/admin.js index 5b1e5086c..96217e0fb 100644 --- a/isso/js/admin.js +++ b/isso/js/admin.js @@ -124,4 +124,8 @@ function send_edit(com_id, hash, isso_host_script) { edit(com_id, hash, author, email, website, comment, isso_host_script); stop_edit(com_id, true); } - +function log_out() { + // Delete cookie + document.cookie = "admin-session=; Max-Age=0; domain=" + window.location.hostname + "; path=/"; + window.location.reload(); +} diff --git a/isso/templates/admin.html b/isso/templates/admin.html index a8d6e3ca8..625057a91 100644 --- a/isso/templates/admin.html +++ b/isso/templates/admin.html @@ -18,6 +18,7 @@

Administration

+ Log Out