Add "homepage" settings page

This commit is contained in:
Oliver 2021-07-27 14:34:23 +10:00
parent 7fdc0546b4
commit 3e0655a9d8
4 changed files with 52 additions and 29 deletions

View File

@ -18,17 +18,19 @@
</a> </a>
</li> </li>
<li class='list-group-item' title='{% trans "Appearance" %}'> <li class='list-group-item' title='{% trans "Home Page" %}'>
<a href='#' class='nav-toggle' id='select-appearance'> <a href='#' class='nav-toggle' id='select-user-home'>
<span class='fas fa-fill'></span> {% trans "Appearance" %} <span class='fas fa-home'></span> {% trans "Home Page" %}
</a> </a>
</li> </li>
<li class='list-group-item' title='{% trans "Settings" %}'> <!--
<a href='#' class='nav-toggle' id='select-user-settings'> <li class='list-group-item' title='{% trans "Settings" %}'>
<span class='fas fa-cog'></span> {% trans "Settings" %} <a href='#' class='nav-toggle' id='select-user-settings'>
</a> <span class='fas fa-cog'></span> {% trans "Settings" %}
</li> </a>
</li>
-->
{% if user.is_staff %} {% if user.is_staff %}

View File

@ -16,6 +16,7 @@
{% include "InvenTree/settings/user.html" %} {% include "InvenTree/settings/user.html" %}
{% include "InvenTree/settings/user_settings.html" %} {% include "InvenTree/settings/user_settings.html" %}
{% include "InvenTree/settings/user_homepage.html" %}
{% if user.is_staff %} {% if user.is_staff %}

View File

@ -0,0 +1,40 @@
{% extends "panel.html" %}
{% load i18n %}
{% load inventree_extras %}
{% block label %}user-home{% endblock %}
{% block heading %}
{% trans "Home Page Settings" %}
{% endblock %}
{% block content %}
<div class='row'>
<table class='table table-striped table-condensed'>
{% include "InvenTree/settings/header.html" %}
<tbody>
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_PART_STARRED" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_PART_LATEST" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_BOM_VALIDATION" user_setting=True %}
<tr><td colspan='5'></td></tr>
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_STOCK_RECENT" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_STOCK_LOW" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_STOCK_DEPLETED" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_STOCK_NEEDED" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_STOCK_EXPIRED" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_STOCK_STALE" user_setting=True %}
<tr><td colspan='5'></td></tr>
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_BUILD_PENDING" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_BUILD_OVERDUE" user_setting=True %}
<tr><td colspan='5'></td></tr>
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_PO_OUTSTANDING" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_PO_OVERDUE" user_setting=True %}
<tr><td colspan='5'></td></tr>
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_SO_OUTSTANDING" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_SO_OVERDUE" user_setting=True %}
</tbody>
</table>
</div>
{% endblock %}

View File

@ -14,27 +14,7 @@
<div class='row'> <div class='row'>
<table class='table table-striped table-condensed'> <table class='table table-striped table-condensed'>
{% include "InvenTree/settings/header.html" %} {% include "InvenTree/settings/header.html" %}
<tbody>
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_PART_STARRED" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_PART_LATEST" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_BOM_VALIDATION" user_setting=True %}
<tr><td colspan='5'></td></tr>
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_STOCK_RECENT" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_STOCK_LOW" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_STOCK_DEPLETED" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_STOCK_NEEDED" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_STOCK_EXPIRED" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_STOCK_STALE" user_setting=True %}
<tr><td colspan='5'></td></tr>
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_BUILD_PENDING" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_BUILD_OVERDUE" user_setting=True %}
<tr><td colspan='5'></td></tr>
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_PO_OUTSTANDING" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_PO_OVERDUE" user_setting=True %}
<tr><td colspan='5'></td></tr>
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_SO_OUTSTANDING" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="HOMEPAGE_SO_OVERDUE" user_setting=True %}
</tbody>
</table> </table>
</div> </div>