2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 13:35:40 +00:00

Add a per-user setting to enable display of stock in search results

This commit is contained in:
Oliver
2021-10-18 16:23:42 +11:00
parent 4bb0b725da
commit 5802a27fe7
3 changed files with 17 additions and 7 deletions

View File

@ -16,6 +16,7 @@
{% include "InvenTree/settings/header.html" %}
<tbody>
{% include "InvenTree/settings/setting.html" with key="SEARCH_PREVIEW_RESULTS" user_setting=True icon='fa-search' %}
{% include "InvenTree/settings/setting.html" with key="SEARCH_SHOW_STOCK_LEVELS" user_setting=True icon='fa-boxes' %}
</tbody>
</table>
</div>

View File

@ -168,13 +168,15 @@ function inventreeDocReady() {
html += '</span>';
html += partStockLabel(
item.data,
{
label_class: 'label-right',
}
);
if (user_settings.SEARCH_SHOW_STOCK_LEVELS) {
html += partStockLabel(
item.data,
{
label_class: 'label-right',
}
);
}
html += '</a>';
return $('<li>').append(html).appendTo(ul);