Skip to content

Commit

Permalink
admin: Add log out button (#870)
Browse files Browse the repository at this point in the history
  • Loading branch information
BBaoVanC authored Oct 1, 2024
1 parent 4672872 commit 0b3b605
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions isso/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion isso/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
1 change: 1 addition & 0 deletions isso/templates/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ <h2>Administration</h2>
</a>
</div>
</header>
<a id="logout" class="logout label" onClick="javascript:log_out()">Log Out</a>
</div>
<div class="outer">
<div class="filters">
Expand Down

0 comments on commit 0b3b605

Please sign in to comment.