Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add cancel button to logout #59

Merged
merged 5 commits into from
Apr 7, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions templates/account/logout.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
{% element button type="submit" %}
{% trans 'Sign Out' %}
{% endelement %}
{% element button type="button" id="cancel-button" %}
{% trans 'Cancel' %}
{% endelement %}
{% endslot %}
{% endelement %}
<script>
document.getElementById('cancel-button').addEventListener('click', function() {
history.back();
Copy link
Contributor

@Mr-Sunglasses Mr-Sunglasses Mar 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using history.back() may be unpredictable sometimes, I think it is better to do it in a pythonic way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree with not using Javascript for this.

});
</script>
{% endblock content %}