fix: move logout from user avatar to sidebar dropdown

This commit is contained in:
sokumon 2026-03-05 10:58:57 +05:30
parent 050305cf2d
commit 7933a201dd
3 changed files with 11 additions and 36 deletions

View file

@ -471,21 +471,6 @@ get_changelog_feed = "frappe.desk.doctype.changelog_feed.changelog_feed.get_feed
export_python_type_annotations = True
standard_navbar_items = [
{
"item_label": "User Settings",
"item_type": "Action",
"action": "frappe.ui.toolbar.route_to_user()",
"is_standard": 1,
},
{
"item_label": "Log out",
"item_type": "Action",
"action": "frappe.app.logout()",
"is_standard": 1,
},
]
standard_help_items = [
{
"item_label": "About",

View file

@ -52,10 +52,10 @@
<span> {%= __("Collapse") %} </span>
</a>
<div class="nav-item dropdown dropdown-navbar-user dropdown-mobile mt-3">
<button
<a
class="align-center btn-reset flex nav-link"
style="width: 100%; height: 40px;"
data-toggle="dropdown"
onclick="return frappe.ui.toolbar.route_to_user()"
aria-label="{{ __("User Menu") }}"
>
<div> {{ avatar }} </div>
@ -68,25 +68,7 @@
</span>
</div>
</button>
<div class="dropdown-menu dropdown-menu-left" id="toolbar-user" role="menu">
{% for item in navbar_settings.settings_dropdown %}
{% var condition = item.condition ? eval(item.condition) : true %}
{% if (condition && !item.hidden) { %}
{% if (item.route) { %}
<a class="dropdown-item" href="{{ item.route }}">
{%= __(item.item_label) %}
</a>
{% } else if (item.action) { %}
<button class="btn-reset dropdown-item" onclick="return {{ item.action }}">
{%= __(item.item_label) %}
</button>
{% } else { %}
<div class="dropdown-divider"></div>
{% } %}
{% } %}
{% endfor %}
</div>
</a>
</div>
</div>
</div>

View file

@ -76,6 +76,14 @@ frappe.ui.SidebarHeader = class SidebarHeader {
label: "Help",
icon: "info",
items: this.get_help_siblings(),
},
{
name: "logout",
label: "Logout",
icon: "logout",
onClick: function () {
return frappe.app.logout();
},
}
);
}