Update settings pages

This commit is contained in:
Oliver Walters 2020-10-19 23:50:39 +11:00
parent c13cee2407
commit 92c1e3c1a5
12 changed files with 149 additions and 43 deletions

View File

@ -69,9 +69,14 @@ apipatterns = [
settings_urls = [
url(r'^user/?', SettingsView.as_view(template_name='InvenTree/settings/user.html'), name='settings-user'),
url(r'^theme/?', ColorThemeSelectView.as_view(), name='settings-theme'),
url(r'^currency/?', SettingsView.as_view(template_name='InvenTree/settings/currency.html'), name='settings-currency'),
url(r'^part/?', SettingsView.as_view(template_name='InvenTree/settings/part.html'), name='settings-part'),
url(r'^theme/?', ColorThemeSelectView.as_view(), name='settings-theme'),
url(r'^stock/?', SettingsView.as_view(template_name='InvenTree/settings/stock.html'), name='settings-stock'),
url(r'^build/?', SettingsView.as_view(template_name='InvenTree/settings/build.html'), name='settings-build'),
url(r'^purchase-order/?', SettingsView.as_view(template_name='InvenTree/settings/po.html'), name='settings-po'),
url(r'^sales-order/?', SettingsView.as_view(template_name='InvenTree/settings/so.html'), name='settings-so'),
url(r'^other/?', SettingsView.as_view(template_name='InvenTree/settings/other.html'), name='settings-other'),
# Catch any other urls

View File

@ -0,0 +1,14 @@
{% extends "InvenTree/settings/settings.html" %}
{% load i18n %}
{% block tabs %}
{% include "InvenTree/settings/tabs.html" with tab='build' %}
{% endblock %}
{% block subtitle %}
{% trans "Build Order Settings" %}
{% endblock %}
{% block settings %}
{% endblock %}

View File

@ -1,4 +1,9 @@
{% extends "InvenTree/settings/settings.html" %}
{% load i18n %}
{% block subtitle %}
{% trans "General Settings" %}
{% endblock %}
{% block tabs %}
{% include "InvenTree/settings/tabs.html" with tab='currency' %}
@ -6,10 +11,10 @@
{% block settings %}
<h4>Currencies</h4>
<h4>{% trans "Currencies" %}</h4>
<div id='currency-buttons'>
<button class='btn btn-success' id='new-currency'>New Currency</button>
<button class='btn btn-success' id='new-currency'>{% trans "New Currency" %}</button>
</div>
<table class='table table-striped table-condensed' id='currency-table' data-toolbar='#currency-buttons'>

View File

@ -1,9 +1,16 @@
{% extends "InvenTree/settings/settings.html" %}
{% load i18n %}
{% block tabs %}
{% include "InvenTree/settings/tabs.html" with tab='other' %}
{% endblock %}
{% block subtitle %}
{% trans "Other Settings" %}
{% endblock %}
{% block settings %}
<h4>InvenTree Settings</h4>

View File

@ -5,7 +5,12 @@
{% include "InvenTree/settings/tabs.html" with tab='part' %}
{% endblock %}
{% block subtitle %}
{% trans "Part Settings" %}
{% endblock %}
{% block settings %}
<h4>{% trans "Part Parameter Templates" %}</h4>
<div id='param-buttons'>

View File

@ -0,0 +1,13 @@
{% extends "InvenTree/settings/settings.html" %}
{% load i18n %}
{% block tabs %}
{% include "InvenTree/settings/tabs.html" with tab='po' %}
{% endblock %}
{% block subtitle %}
{% trans "Purchase Order Settings" %}
{% endblock %}
{% block settings %}
{% endblock %}

View File

@ -1,15 +1,16 @@
{% extends "base.html" %}
{% load i18n %}
{% load static %}
{% block page_title %}
InvenTree | Settings
InvenTree | {% trans "Settings" %}
{% endblock %}
{% block content %}
<div class='settings-container'>
<h3>InvenTree Settings</h3>
<h3>InvenTree {% trans "Settings" %}</h3>
<hr>
<div class='settings-nav'>
@ -19,6 +20,12 @@ InvenTree | Settings
</div>
<div class='settings-content'>
<h3>
{% block subtitle %}
SUBTITLE GOES HERE
{% endblock %}
</h3>
<hr>
{% block settings %}
{% endblock %}
</div>

View File

@ -0,0 +1,13 @@
{% extends "InvenTree/settings/settings.html" %}
{% load i18n %}
{% block tabs %}
{% include "InvenTree/settings/tabs.html" with tab='so' %}
{% endblock %}
{% block subtitle %}
{% trans "Sales Order Settings" %}
{% endblock %}
{% block settings %}
{% endblock %}

View File

@ -0,0 +1,13 @@
{% extends "InvenTree/settings/settings.html" %}
{% load i18n %}
{% block tabs %}
{% include "InvenTree/settings/tabs.html" with tab='stock' %}
{% endblock %}
{% block subtitle %}
{% trans "Stock Settings" %}
{% endblock %}
{% block settings %}
{% endblock %}

View File

@ -1,19 +1,37 @@
{% load i18n %}
<h4><span class='fas fa-user'></span> {% trans "User Settings" %}</h4>
<ul class='nav nav-pills nav-stacked'>
<li{% ifequal tab 'user' %} class='active'{% endifequal %}>
<a href="{% url 'settings-user' %}"><span class='fas fa-user'></span> User</a>
</li>
<li{% ifequal tab 'currency' %} class='active'{% endifequal %}>
<a href="{% url 'settings-currency' %}"><span class='fas fa-dollar-sign'></span> Currency</a>
</li>
<li{% ifequal tab 'part' %} class='active'{% endifequal %}>
<a href="{% url 'settings-part' %}"><span class='fas fa-shapes'></span> Part</a>
<a href="{% url 'settings-user' %}"><span class='fas fa-user'></span> {% trans "Account" %}</a>
</li>
<li{% ifequal tab 'theme' %} class='active'{% endifequal %}>
<a href="{% url 'settings-theme' %}"><span class='fas fa-fill'></span> Theme</a>
<a href="{% url 'settings-theme' %}"><span class='fas fa-fill'></span> {% trans "Theme" %}</a>
</li>
</ul>
<h4><span class='fas fa-cogs'></span> {% trans "InvenTree Settings" %}</h4>
<ul class='nav nav-pills nav-stacked'>
<li{% ifequal tab 'currency' %} class='active'{% endifequal %}>
<a href="{% url 'settings-currency' %}"><span class='fas fa-dollar-sign'></span> {% trans "Currency" %}</a>
</li>
<li{% ifequal tab 'part' %} class='active'{% endifequal %}>
<a href="{% url 'settings-part' %}"><span class='fas fa-shapes'></span> {% trans "Parts" %}</a>
</li>
<li {% if tab == 'stock' %} class='active'{% endif %}>
<a href='{% url 'settings-stock' %}'><span class='fas fa-boxes'></span> {% trans "Stock" %}</a>
</li>
<li {% if tab == 'build' %} class='active'{% endif %}>
<a href="{% url 'settings-build' %}"><span class='fas fa-tools'></span> {% trans "Build Orders" %}</a>
</li>
<li {% if tab == 'po' %} class='active'{% endif %}>
<a href="{% url 'settings-po' %}"><span class='fas fa-shopping-cart'></span> {% trans "Purchase Orders" %}</a>
</li>
<li {% if tab == 'so' %} class='active'{% endif %}>
<a href="{% url 'settings-so' %}"><span class='fas fa-truck'></span> {% trans "Sales Orders" %}</a>
</li>
{% if user.is_staff %}
<li{% ifequal tab 'other' %} class='active'{% endifequal %}>
<a href="{% url 'settings-other' %}"><span class='fas fa-cogs'></span> Other</a>
<a href="{% url 'settings-other' %}"><span class='fas fa-cogs'></span> {% trans "Other" %}</a>
</li>
{% endif %}
</ul>

View File

@ -6,11 +6,15 @@
{% include "InvenTree/settings/tabs.html" with tab='theme' %}
{% endblock %}
{% block subtitle %}
{% trans "Theme Settings" %}
{% endblock %}
{% block settings %}
<div class='row'>
<div class='col-sm-6'>
<h4>Color Themes</h4>
<h4>{% trans "Color Themes" %}</h4>
</div>
</div>

View File

@ -1,41 +1,43 @@
{% extends "InvenTree/settings/settings.html" %}
{% load i18n %}
{% block tabs %}
{% include "InvenTree/settings/tabs.html" with tab='user' %}
{% endblock %}
{% block subtitle %}
{% trans "User Settings" %}
{% endblock %}
{% block settings %}
<div class='row'>
<div class='col-sm-6'>
<h4>User Information</h4>
<div class='container'>
<h4>{% trans "User Information" %}</h4>
<div class='btn-group' style='float: right;'>
<div class='btn btn-primary' type='button' id='edit-user' title='Edit User Information'>Edit</div>
<div class='btn btn-primary' type='button' id='edit-password' title='Change Password'>Set Password</div>
</div>
<div class='col-sm-6'>
<div class='btn-group' style='float: right;'>
<div class='btn btn-primary' type='button' id='edit-user' title='Edit User Information'>Edit</div>
<div class='btn btn-primary' type='button' id='edit-password' title='Change Password'>Set Password</div>
</div>
</div>
</div>
<table class='table table-striped table-condensed'>
<tr>
<td>Username</td>
<td>{{ user.username }}</td>
</tr>
<tr>
<td>First Name</td>
<td>{{ user.first_name }}</td>
</tr>
<tr>
<td>Last Name</td>
<td>{{ user.last_name }}</td>
</tr>
<tr>
<td>Email Address</td>
<td>{{ user.email }}</td>
</tr>
</table>
<table class='table table-striped table-condensed'>
<tr>
<td>{% trans "Username" %}</td>
<td>{{ user.username }}</td>
</tr>
<tr>
<td>{% trans "First Name" %}</td>
<td>{{ user.first_name }}</td>
</tr>
<tr>
<td>{% trans "Last Name" %}</td>
<td>{{ user.last_name }}</td>
</tr>
<tr>
<td>{% trans "Email Address" %}</td>
<td>{{ user.email }}</td>
</tr>
</table>
</div>
{% endblock %}