diff --git a/InvenTree/InvenTree/static/css/inventree.css b/InvenTree/InvenTree/static/css/inventree.css index 321d9e1cf4..1412b99bac 100644 --- a/InvenTree/InvenTree/static/css/inventree.css +++ b/InvenTree/InvenTree/static/css/inventree.css @@ -198,6 +198,28 @@ margin-bottom: 20px; } +.settings-container { + width: 80%; + padding: 15px; +} + +.settings-nav { + height: 100%; + width: 160px; + position: fixed; + z-index: 1; + //top: 0; + //left: 0; + overflow-x: hidden; + padding-top: 20px; + padding-right: 25px; +} + +.settings-content { + margin-left: 175px; + padding: 0px 10px; +} + .breadcrump { margin-bottom: 5px; } diff --git a/InvenTree/InvenTree/urls.py b/InvenTree/InvenTree/urls.py index 11f4a4eda5..3c473a5189 100644 --- a/InvenTree/InvenTree/urls.py +++ b/InvenTree/InvenTree/urls.py @@ -53,6 +53,16 @@ apipatterns = [ url(r'^$', InfoView.as_view(), name='inventree-info'), ] +settings_urls = [ + + url(r'^user/?', SettingsView.as_view(template_name='InvenTree/settings/user.html'), name='settings-user'), + 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'), + + # Catch any other urls + url(r'^.*$', SettingsView.as_view(template_name='InvenTree/settings/settings.html'), name='settings'), +] + urlpatterns = [ url(r'^part/', include(part_urls)), url(r'^supplier-part/', include(supplier_part_urls)), @@ -70,7 +80,7 @@ urlpatterns = [ url(r'^login/', auth_views.LoginView.as_view(), name='login'), url(r'^logout/', auth_views.LogoutView.as_view(template_name='registration/logout.html'), name='logout'), - url(r'^settings/', SettingsView.as_view(), name='settings'), + url(r'^settings/', include(settings_urls)), url(r'^edit-user/', EditUserView.as_view(), name='edit-user'), url(r'^set-password/', SetPasswordView.as_view(), name='set-password'), diff --git a/InvenTree/templates/InvenTree/settings.html b/InvenTree/templates/InvenTree/settings.html deleted file mode 100644 index dd4e2212bf..0000000000 --- a/InvenTree/templates/InvenTree/settings.html +++ /dev/null @@ -1,97 +0,0 @@ -{% extends "base.html" %} - -{% block page_title %} -InvenTree | Settings -{% endblock %} - -{% block content %} -

InvenTree Settings

-
- -
- - - -
- -
-
-

User Information

-
-
-
-
Edit
-
Set Password
-
-
-
- - -
- - - - - - - - - - - - - -
First Name{{ user.first_name }}
Last Name{{ user.last_name }}
Email Address{{ user.email }}
-
- -
- - - - - - - - -
CurrencyValueDefault
-
- -
- - - - - - - -
NameUnits
-
- -{% endblock %} - -{% block js_load %} -{{ block.super }} -{% endblock %} - -{% block js_ready %} -{{ block.super }} - - $("#edit-user").on('click', function() { - launchModalForm( - "{% url 'edit-user' %}", - { - reload: true, - } - ); - }); - - $("#edit-password").on('click', function() { - launchModalForm( - "{% url 'set-password' %}", - { - reload: true, - } - ); - }); - -{% endblock %} \ No newline at end of file diff --git a/InvenTree/templates/InvenTree/settings/currency.html b/InvenTree/templates/InvenTree/settings/currency.html new file mode 100644 index 0000000000..e895fd6dcd --- /dev/null +++ b/InvenTree/templates/InvenTree/settings/currency.html @@ -0,0 +1,9 @@ +{% extends "InvenTree/settings/settings.html" %} + +{% block tabs %} +{% include "InvenTree/settings/tabs.html" with tab='currency' %} +{% endblock %} + +{% block settings %} + +{% endblock %} \ No newline at end of file diff --git a/InvenTree/templates/InvenTree/settings/part.html b/InvenTree/templates/InvenTree/settings/part.html new file mode 100644 index 0000000000..c64ebb6194 --- /dev/null +++ b/InvenTree/templates/InvenTree/settings/part.html @@ -0,0 +1,9 @@ +{% extends "InvenTree/settings/settings.html" %} + +{% block tabs %} +{% include "InvenTree/settings/tabs.html" with tab='part' %} +{% endblock %} + +{% block settings %} + +{% endblock %} \ No newline at end of file diff --git a/InvenTree/templates/InvenTree/settings/settings.html b/InvenTree/templates/InvenTree/settings/settings.html new file mode 100644 index 0000000000..c97e65573e --- /dev/null +++ b/InvenTree/templates/InvenTree/settings/settings.html @@ -0,0 +1,32 @@ +{% extends "base.html" %} + +{% load static %} + +{% block page_title %} +InvenTree | Settings +{% endblock %} + +{% block content %} +

InvenTree Settings

+
+ +
+ +
+ {% block tabs %} + {% include "InvenTree/settings/tabs.html" %} + {% endblock %} +
+ +
+ {% block settings %} + {% endblock %} +
+ +
+ +{% endblock %} + +{% block js_load %} +{{ block.super }} +{% endblock %} diff --git a/InvenTree/templates/InvenTree/settings/tabs.html b/InvenTree/templates/InvenTree/settings/tabs.html new file mode 100644 index 0000000000..5e9b1503a2 --- /dev/null +++ b/InvenTree/templates/InvenTree/settings/tabs.html @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/InvenTree/templates/InvenTree/settings/user.html b/InvenTree/templates/InvenTree/settings/user.html new file mode 100644 index 0000000000..cd50aad1d3 --- /dev/null +++ b/InvenTree/templates/InvenTree/settings/user.html @@ -0,0 +1,59 @@ +{% extends "InvenTree/settings/settings.html" %} + +{% block tabs %} +{% include "InvenTree/settings/tabs.html" with tab='user' %} +{% endblock %} + +{% block settings %} + +
+
+

User Information

+
+
+
+
Edit
+
Set Password
+
+
+
+ + + + + + + + + + + + + + +
First Name{{ user.first_name }}
Last Name{{ user.last_name }}
Email Address{{ user.email }}
+ +{% endblock %} + +{% block js_ready %} +{{ block.super }} + + $("#edit-user").on('click', function() { + launchModalForm( + "{% url 'edit-user' %}", + { + reload: true, + } + ); + }); + + $("#edit-password").on('click', function() { + launchModalForm( + "{% url 'set-password' %}", + { + reload: true, + } + ); + }); + +{% endblock %} \ No newline at end of file