Skip to content

Commit

Permalink
admin: Add log out button
Browse files Browse the repository at this point in the history
  • Loading branch information
BBaoVanC committed Nov 5, 2023
1 parent 21ded32 commit 4b02fe6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^^^^^^^^^^
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
6 changes: 5 additions & 1 deletion isso/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
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 4b02fe6

Please sign in to comment.