Skip to content

Commit 0b3b605

Browse files
authored
admin: Add log out button (#870)
1 parent 4672872 commit 0b3b605

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ New Features
1313
- Add CSS variables for better organization and flexibility (`#1001`_, pkvach)
1414
- Add support for comment search by Thread URL in admin interface (`#1020`_, pkvach)
1515
- Add sorting option for comments (`#1005`_, pkvach)
16+
- admin: Add log out button (`#870`_, bbaovanc)
1617

18+
.. _#870: https://github.com/posativ/isso/pull/870
1719
.. _#966: https://github.com/posativ/isso/pull/966
1820
.. _#998: https://github.com/isso-comments/isso/pull/998
1921
.. _#1000: https://github.com/isso-comments/isso/pull/1000

isso/css/admin.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ input {
5151
color: #4d4c4c;
5252
text-decoration: none;
5353
}
54+
.header .logout {
55+
float: right;
56+
}
5457
.outer {
5558
background-color: #eeeeee;
5659
box-shadow: 0 0 0.5em #c0c0c0 inset;

isso/js/admin.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,13 @@ function send_edit(com_id, hash, isso_host_script) {
124124
edit(com_id, hash, author, email, website, comment, isso_host_script);
125125
stop_edit(com_id, true);
126126
}
127+
function log_out() {
128+
// Delete cookie
129+
document.cookie = "admin-session=; Max-Age=0; domain=" + window.location.hostname + "; path=/";
130+
window.location.reload();
131+
}
127132

128133
function toggleTooltip(tooltipContainer) {
129134
const tooltipText = tooltipContainer.querySelector(".search-tooltip-text");
130135
tooltipText.classList.toggle("show");
131-
}
136+
}

isso/templates/admin.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ <h2>Administration</h2>
1818
</a>
1919
</div>
2020
</header>
21+
<a id="logout" class="logout label" onClick="javascript:log_out()">Log Out</a>
2122
</div>
2223
<div class="outer">
2324
<div class="filters">

0 commit comments

Comments
 (0)