mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	Added static files directory
- Improved display of part image
This commit is contained in:
		@@ -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')
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
}
 | 
			
		||||
@@ -10,7 +10,7 @@
 | 
			
		||||
 | 
			
		||||
<!-- Bootstrap CSS -->
 | 
			
		||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
 | 
			
		||||
<link rel="stylesheet" href="{% static 'css/part.css' %}">
 | 
			
		||||
<link rel="stylesheet" href="{% static 'css/inventree.css' %}">
 | 
			
		||||
 | 
			
		||||
<title>
 | 
			
		||||
{% 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>
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
<div class="container">
 | 
			
		||||
<div class='navigation'>
 | 
			
		||||
<a href="/part/list/">Parts</a> >
 | 
			
		||||
{% if category %}
 | 
			
		||||
{% for path_item in category.parentpath %}
 | 
			
		||||
 
 | 
			
		||||
@@ -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>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										43
									
								
								InvenTree/static/css/inventree.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								InvenTree/static/css/inventree.css
									
									
									
									
									
										Normal file
									
								
							@@ -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;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								InvenTree/static/img/blank_image.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								InvenTree/static/img/blank_image.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 3.5 KiB  | 
| 
		 Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB  | 
		Reference in New Issue
	
	Block a user