diff --git a/CHANGES.rst b/CHANGES.rst index e8e4ee2c..01a344d4 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -13,7 +13,9 @@ New Features - Add CSS variables for better organization and flexibility (`#1001`_, pkvach) - Add support for comment search by Thread URL in admin interface (`#1020`_, pkvach) - Add sorting option for comments (`#1005`_, pkvach) +- admin: Add log out button (`#870`_, bbaovanc) +.. _#870: https://github.com/posativ/isso/pull/870 .. _#966: https://github.com/posativ/isso/pull/966 .. _#998: https://github.com/isso-comments/isso/pull/998 .. _#1000: https://github.com/isso-comments/isso/pull/1000 diff --git a/isso/css/admin.css b/isso/css/admin.css index bf854852..697bc7d0 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 e6cc6462..c35202d1 100644 --- a/isso/js/admin.js +++ b/isso/js/admin.js @@ -124,8 +124,13 @@ 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(); +} function toggleTooltip(tooltipContainer) { const tooltipText = tooltipContainer.querySelector(".search-tooltip-text"); tooltipText.classList.toggle("show"); -} \ No newline at end of file +} diff --git a/isso/templates/admin.html b/isso/templates/admin.html index b799f3e2..1d7f948e 100644 --- a/isso/templates/admin.html +++ b/isso/templates/admin.html @@ -18,6 +18,7 @@

Administration

+ Log Out