details: https://code.tryton.org/tryton/commit/a233b038106b
branch: default
user: José Antonio Díaz Miralles <[email protected]>
date: Tue Mar 24 19:28:02 2026 +0100
description:
Move the logout entry and add a help entry to the notification menu
Closes #14151
diffstat:
sao/CHANGELOG | 1 +
sao/index.html | 12 ----------
sao/src/notification.js | 58 ++++++++++++++++++++++++++++++++----------------
sao/src/sao.js | 11 +-------
4 files changed, 42 insertions(+), 40 deletions(-)
diffs (135 lines):
diff -r be0b050dd37d -r a233b038106b sao/CHANGELOG
--- a/sao/CHANGELOG Tue Mar 24 18:25:19 2026 +0100
+++ b/sao/CHANGELOG Tue Mar 24 19:28:02 2026 +0100
@@ -1,3 +1,4 @@
+* Move the logout entry and add a help entry to the notification menu
* Add visual hint on widget of modified field
* Add support for Python 3.14
* Remove support for Python 3.9
diff -r be0b050dd37d -r a233b038106b sao/index.html
--- a/sao/index.html Tue Mar 24 18:25:19 2026 +0100
+++ b/sao/index.html Tue Mar 24 19:28:02 2026 +0100
@@ -58,18 +58,6 @@
</form>
<ul class="nav navbar-nav navbar-right flip">
<li id="user-preferences" class="dropdown"></li>
- <li id="user-logout">
- <a href="#">
- <span class="icon hidden-xs">
- <svg
xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
fill="currentColor">
- <path d="M0 0h24v24H0z"
fill="none"/>
- <path d="M10.09 15.59L11.5
17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2
2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/>
- </svg>
- </span>
- <span class="visible-xs">
- </span>
- </a>
- </li>
</ul>
<ul id="tablist" class="nav navbar-nav nav-pills"
role="tablist">
</ul>
diff -r be0b050dd37d -r a233b038106b sao/src/notification.js
--- a/sao/src/notification.js Tue Mar 24 18:25:19 2026 +0100
+++ b/sao/src/notification.js Tue Mar 24 19:28:02 2026 +0100
@@ -116,27 +116,47 @@
'role': 'separator',
'class': 'divider',
}));
- let preferences_img = jQuery('<img/>', {
- 'class': 'icon',
- });
- let preferences = jQuery('<li/>', {
- 'class': 'notification-item',
- 'role': 'presentation',
- }).append(
- jQuery('<a/>', {
- 'role': 'menuitem',
- 'href': '#',
+ let items = [
+ {
'text': Sao.i18n.gettext("Preferences..."),
- }).prepend(preferences_img
- ).click((evt) => {
- evt.preventDefault();
- Sao.preferences();
- }));
- Sao.common.ICONFACTORY.get_icon_url('tryton-launch')
- .then(url => {
- preferences_img.attr('src', url);
+ 'icon': 'tryton-launch',
+ 'action': () => Sao.preferences(),
+ },
+ {
+ 'text': Sao.i18n.gettext("Help..."),
+ 'icon': 'tryton-question',
+ 'action': () => Sao.help_dialog(),
+ },
+ {
+ 'text': Sao.i18n.gettext("Logout"),
+ 'icon': 'tryton-exit',
+ 'action': () => Sao.logout(),
+ },
+ ];
+
+ items.forEach((item) => {
+ let item_img = jQuery('<img/>', {
+ 'class': 'icon',
});
- this.el.append(preferences);
+ Sao.common.ICONFACTORY.get_icon_url(item.icon)
+ .then(url => {
+ item_img.attr('src', url);
+ });
+ let item_li = jQuery('<li/>', {
+ 'class': 'notification-item',
+ 'role': 'presentation',
+ }).append(
+ jQuery('<a/>', {
+ 'role': 'menuitem',
+ 'href': '#',
+ 'text': item.text,
+ }).prepend(item_img
+ ).click((evt) => {
+ evt.preventDefault();
+ item.action();
+ }));
+ this.el.append(item_li);
+ });
});
}
diff -r be0b050dd37d -r a233b038106b sao/src/sao.js
--- a/sao/src/sao.js Tue Mar 24 18:25:19 2026 +0100
+++ b/sao/src/sao.js Tue Mar 24 19:28:02 2026 +0100
@@ -785,13 +785,6 @@
}));
}
user.prepend(Sao.NotificationMenu.indicator);
- var title = Sao.i18n.gettext("Logout");
- jQuery('#user-logout > a')
- .attr('title', title)
- .attr('aria-label', title)
- .off()
- .click(Sao.logout)
- .find('span:not(.icon)').text(title);
};
Sao.main_menu_row_activate = function() {
@@ -1194,7 +1187,7 @@
shortcut: 'f1',
label: Sao.i18n.gettext('Show this help'),
callback: function() {
- help_dialog();
+ Sao.help_dialog();
},
}, {
shortcut: 'ctrl+f1',
@@ -1272,7 +1265,7 @@
var _help_dialog = null;
- function help_dialog() {
+ Sao.help_dialog = function() {
Mousetrap.pause();
var dialog;
if (!_help_dialog) {