diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index f348cdfe04..ccdca1389a 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -136,6 +136,10 @@ USE_TZ = True STATIC_URL = '/static/' +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, 'static'), +] + MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') diff --git a/InvenTree/part/static/css/part.css b/InvenTree/part/static/css/part.css deleted file mode 100644 index 4a84b3c210..0000000000 --- a/InvenTree/part/static/css/part.css +++ /dev/null @@ -1,23 +0,0 @@ -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/templates/base.html b/InvenTree/part/templates/base.html index 326a683758..5e60cc0659 100644 --- a/InvenTree/part/templates/base.html +++ b/InvenTree/part/templates/base.html @@ -10,7 +10,7 @@ - + {% block title %} @@ -20,11 +20,14 @@ InvenTree </head> <body> + {% include "navbar.html" %} +<div class="inventree-content"> {% block content %} <!-- Each view fills in here.. --> {% endblock %} +</div> </body> </html> \ No newline at end of file diff --git a/InvenTree/part/templates/part/cat_link.html b/InvenTree/part/templates/part/cat_link.html index 4ac0471217..96e560ca20 100644 --- a/InvenTree/part/templates/part/cat_link.html +++ b/InvenTree/part/templates/part/cat_link.html @@ -1,4 +1,4 @@ -<div class="container"> +<div class='navigation'> <a href="/part/list/">Parts</a> > {% if category %} {% for path_item in category.parentpath %} diff --git a/InvenTree/part/templates/part/part_base.html b/InvenTree/part/templates/part/part_base.html index 128c4e19f2..daccb26837 100644 --- a/InvenTree/part/templates/part/part_base.html +++ b/InvenTree/part/templates/part/part_base.html @@ -1,15 +1,17 @@ {% extends "base.html" %} +{% load static %} + {% block content %} {% include "part/cat_link.html" with category=part.category %} <div class="media"> - <img class="mr-3" + <img class="mr-3 part-thumb" {% if part.image %} src="{{ part.image.url }}" {% else %} - src="/media/part_images/missing.png" + src="{% static 'img/blank_image.png' %}" {% endif %}/> <div class="media-body"> <h5>{{ part.name }}</h5> diff --git a/InvenTree/static/css/inventree.css b/InvenTree/static/css/inventree.css new file mode 100644 index 0000000000..8976b0f10e --- /dev/null +++ b/InvenTree/static/css/inventree.css @@ -0,0 +1,43 @@ +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; +} + +.part-thumb { + width: 250px; + height: 250px; + border: 1px black solid; + margin: 5px; + padding: 5px; + object-fit: contain; +} + +.media-body { + padding-top: 10px; +} + +.navigation { + padding: 5px; + padding-left: 15px; + background-color: #EEE; +} + +.inventree-content { + padding-left: 15px; + padding-right: 15px; +} \ No newline at end of file diff --git a/InvenTree/static/img/blank_image.png b/InvenTree/static/img/blank_image.png new file mode 100644 index 0000000000..b2b4ba215d Binary files /dev/null and b/InvenTree/static/img/blank_image.png differ diff --git a/InvenTree/part/static/img/inventree.png b/InvenTree/static/img/inventree.png similarity index 100% rename from InvenTree/part/static/img/inventree.png rename to InvenTree/static/img/inventree.png