diff --git a/InvenTree/InvenTree/urls.py b/InvenTree/InvenTree/urls.py index 2917ca1baf..33df33ed97 100644 --- a/InvenTree/InvenTree/urls.py +++ b/InvenTree/InvenTree/urls.py @@ -9,6 +9,9 @@ from bom.urls import bom_urls from stock.urls import stock_urls, stock_loc_urls from supplier.urls import cust_urls, manu_urls, supplier_part_urls, price_break_urls, supplier_urls +from django.conf import settings +from django.conf.urls.static import static + #from project.urls import prj_urls, prj_part_urls, prj_cat_urls, prj_run_urls #from track.urls import unique_urls, part_track_urls @@ -65,4 +68,4 @@ urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')), -] +] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) diff --git a/InvenTree/part/static/css/part.css b/InvenTree/part/static/css/part.css new file mode 100644 index 0000000000..4a84b3c210 --- /dev/null +++ b/InvenTree/part/static/css/part.css @@ -0,0 +1,23 @@ +body { + padding-left: 15px; +} + +table, th, td { + border: 1px solid black; + border-collapse: collapse; +} + +th, td { + padding: 10px; +} + +th { + text-align: left; +} + +table tr:nth-child(even) { + background-color: #eee; +} +table tr:nth-child(odd) { + background-color: #fff; +} \ No newline at end of file diff --git a/InvenTree/part/static/img/inventree.png b/InvenTree/part/static/img/inventree.png new file mode 100644 index 0000000000..200b6acd0b Binary files /dev/null and b/InvenTree/part/static/img/inventree.png differ diff --git a/InvenTree/part/templates/detail.html b/InvenTree/part/templates/detail.html deleted file mode 100644 index 145f0a6982..0000000000 --- a/InvenTree/part/templates/detail.html +++ /dev/null @@ -1,30 +0,0 @@ -

Part details for {{ part.name }}

- -{% include "cat_link.html" with category=part.category %} - -
-Part name: {{ part.name }} -
-Description: {{ part.description }} -
-IPN: {% if part.IPN %}{{ part.IPN }}{% else %}N/A{% endif %} -
-Stock: {{ part.stock }} - -

-BOM items: {{ part.bomItemCount }}
-Used in {{ part.usedInCount }} other parts.
- -

BOM

- - -

Used to make

- \ No newline at end of file diff --git a/InvenTree/part/templates/part/base.html b/InvenTree/part/templates/part/base.html new file mode 100644 index 0000000000..034144f171 --- /dev/null +++ b/InvenTree/part/templates/part/base.html @@ -0,0 +1,29 @@ +{% load static %} + + + + + + + + + + + + + + +{% block title %} +InvenTree +{% endblock %} + + + + + {% include "part/navbar.html" %} +{% block content %} + +{% endblock %} + + + \ No newline at end of file diff --git a/InvenTree/part/templates/part/bom.html b/InvenTree/part/templates/part/bom.html new file mode 100644 index 0000000000..01795ed71c --- /dev/null +++ b/InvenTree/part/templates/part/bom.html @@ -0,0 +1,22 @@ +{% extends "part/part_base.html" %} + +{% block details %} + + + + + + + +{% for bom_item in part.bom_items.all %} +{% with sub_part=bom_item.sub_part %} + + + + + +{% endwith %} +{% endfor %} +
PartDescriptionQuantity
{{ sub_part.name }}{{ sub_part.description }}{{ bom_item.quantity }}
+ +{% endblock %} \ No newline at end of file diff --git a/InvenTree/part/templates/cat_link.html b/InvenTree/part/templates/part/cat_link.html similarity index 82% rename from InvenTree/part/templates/cat_link.html rename to InvenTree/part/templates/part/cat_link.html index aff374a4d7..b227797339 100644 --- a/InvenTree/part/templates/cat_link.html +++ b/InvenTree/part/templates/part/cat_link.html @@ -1,4 +1,4 @@ -
+
All > {% for path_item in category.parentpath %} {{ path_item.name }} > diff --git a/InvenTree/part/templates/part/detail.html b/InvenTree/part/templates/part/detail.html new file mode 100644 index 0000000000..90c7cf2534 --- /dev/null +++ b/InvenTree/part/templates/part/detail.html @@ -0,0 +1,12 @@ +{% extends "part/part_base.html" %} + +{% block details %} + +
+There are {{ part.bomItemCount }} BOM items for this part. +
+Used in {{ part.usedInCount }} other parts.
+ +There are {{ part.stock }} units in stock. + +{% endblock %} \ No newline at end of file diff --git a/InvenTree/part/templates/index.html b/InvenTree/part/templates/part/index.html similarity index 78% rename from InvenTree/part/templates/index.html rename to InvenTree/part/templates/part/index.html index 96796f017c..7363000601 100644 --- a/InvenTree/part/templates/index.html +++ b/InvenTree/part/templates/part/index.html @@ -1,7 +1,11 @@ +{% extends "part/base.html" %} + +{% block content %} +

Parts page!

{% if category %} -{% include "cat_link.html" with category=category %} +{% include "part/cat_link.html" with category=category %}

Child categories