@@ -85,7 +83,7 @@
{% endblock %}
{% block js_ready %}
-
+{{ block.super }}
$("#part-thumb").click(function() {
launchModalForm("#modal-form",
"{% url 'part-image' part.id %}",
diff --git a/InvenTree/part/templates/part/subcategories.html b/InvenTree/part/templates/part/subcategories.html
new file mode 100644
index 0000000000..4f8704e736
--- /dev/null
+++ b/InvenTree/part/templates/part/subcategories.html
@@ -0,0 +1,27 @@
+{% if children|length > 0 %}
+
+
+
+
+
+
+
+ {% for child in children %}
+ -
+ {{ child.name }}
+ {% if child.description %}
+ - {{ child.description }}
+ {% endif %}
+ {{ child.partcount }}
+
+ {% endfor %}
+
+
+
+
+
+{% endif %}
\ No newline at end of file
diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py
index f11a328af2..9bb42722eb 100644
--- a/InvenTree/part/views.py
+++ b/InvenTree/part/views.py
@@ -23,7 +23,7 @@ from InvenTree.views import AjaxCreateView, AjaxUpdateView, AjaxDeleteView
class PartIndex(ListView):
model = Part
- template_name = 'part/index.html'
+ template_name = 'part/category.html'
context_object_name = 'parts'
def get_queryset(self):
@@ -128,7 +128,7 @@ class CategoryDetail(DetailView):
model = PartCategory
context_object_name = 'category'
queryset = PartCategory.objects.all()
- template_name = 'part/category_detail.html'
+ template_name = 'part/category.html'
class CategoryEdit(AjaxUpdateView):
diff --git a/InvenTree/static/css/inventree.css b/InvenTree/static/css/inventree.css
index e4f01e97bf..70cee55d51 100644
--- a/InvenTree/static/css/inventree.css
+++ b/InvenTree/static/css/inventree.css
@@ -47,7 +47,7 @@
margin-right: 50px;
margin-left: 50px;
width: 100%;
- transition: 0.5s;
+ transition: 0.1s;
}
.body {
@@ -88,7 +88,7 @@
position: fixed; /* Stay in place */
background-color: #fff; /* Black*/
overflow-x: hidden; /* Disable horizontal scroll */
- transition: 0.5s; /* 0.5 second transition effect to slide in the sidenav */
+ transition: 0.1s; /* 0.5 second transition effect to slide in the sidenav */
}
.wrapper {
diff --git a/InvenTree/static/script/sidenav.js b/InvenTree/static/script/sidenav.js
index 1520b91ea7..382a126148 100644
--- a/InvenTree/static/script/sidenav.js
+++ b/InvenTree/static/script/sidenav.js
@@ -1,9 +1,52 @@
+function loadTree(url, tree, data) {
+
+ $.ajax({
+ url: url,
+ type: 'get',
+ dataType: 'json',
+ data: data,
+ success: function (response) {
+ if (response.tree) {
+ $(tree).treeview({
+ data: response.tree,
+ enableLinks: true
+ });
+ }
+ },
+ error: function (xhr, ajaxOptions, thrownError) {
+ //TODO
+ }
+ });
+}
+
function openSideNav() {
document.getElementById("sidenav").style.width = "250px";
document.getElementById("inventree-content").style.marginLeft = "270px";
+
+ sessionStorage.setItem('inventree-sidenav-state', 'open');
}
function closeSideNav() {
document.getElementById("sidenav").style.width = "0";
document.getElementById("inventree-content").style.marginLeft = "50px";
+
+ sessionStorage.setItem('inventree-sidenav-state', 'closed');
+}
+
+function toggleSideNav(nav) {
+ if ($(nav).width() == 0) {
+ openSideNav();
+ }
+ else {
+ closeSideNav();
+ }
+}
+
+function initSideNav() {
+ if (sessionStorage.getItem("inventree-sidenav-state") && sessionStorage.getItem('inventree-sidenav-state') == 'open') {
+ openSideNav();
+ }
+ else {
+ closeSideNav();
+ }
}
\ No newline at end of file
diff --git a/InvenTree/static/script/trees.js b/InvenTree/static/script/trees.js
deleted file mode 100644
index 2938f3366e..0000000000
--- a/InvenTree/static/script/trees.js
+++ /dev/null
@@ -1,20 +0,0 @@
-function loadTree(url, tree, data) {
-
- $.ajax({
- url: url,
- type: 'get',
- dataType: 'json',
- data: data,
- success: function (response) {
- if (response.tree) {
- $(tree).treeview({
- data: response.tree,
- enableLinks: true
- });
- }
- },
- error: function (xhr, ajaxOptions, thrownError) {
- //TODO
- }
- });
-}
\ No newline at end of file
diff --git a/InvenTree/templates/base.html b/InvenTree/templates/base.html
index b06b0ad37d..32d928306b 100644
--- a/InvenTree/templates/base.html
+++ b/InvenTree/templates/base.html
@@ -38,11 +38,16 @@ InvenTree
+{% block pre_content %}
+{% endblock %}
{% block content %}
{% endblock %}
+{% block post_content %}
+{% endblock %}
+{% include 'modals.html' %}
{% include 'notification.html' %}
@@ -57,38 +62,18 @@ InvenTree
-
-
+
{% block js_load %}
{% endblock %}