2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-07 04:12:11 +00:00

Improved list and detail views for supplier

Huzzah for bootstrap
This commit is contained in:
Oliver
2018-04-15 13:49:47 +10:00
parent 9e6c7350f9
commit 8232baeed7
17 changed files with 201 additions and 84 deletions

View File

@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-04-15 03:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('part', '0014_auto_20180415_0107'),
]
operations = [
migrations.AlterField(
model_name='partcategory',
name='description',
field=models.CharField(max_length=250),
),
]

View File

@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-04-15 03:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('part', '0015_auto_20180415_0302'),
]
operations = [
migrations.AlterField(
model_name='part',
name='description',
field=models.CharField(max_length=250),
),
]

View File

@@ -88,7 +88,7 @@ class Part(models.Model):
name = models.CharField(max_length=100, unique=True)
# Longer description of the part (optional)
description = models.CharField(max_length=250, blank=True)
description = models.CharField(max_length=250)
# Internal Part Number (optional)
# Potentially multiple parts map to the same internal IPN (variants?)

View File

@@ -6,7 +6,7 @@
<a class="navbar-brand" href="/"><img src="{% static 'img/inventree.png' %}" width="40" height="40"/></a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="/part/">Parts</a></li>
<li><a href="/part/">Parts</a></li>
<li><a href="/stock/">Stock</a></li>
<li><a href="/supplier/">Suppliers</a></li>
<li><a href="/track/">Tracking</a></li>

View File

@@ -6,6 +6,11 @@
{% include "part/cat_link.html" with category=category %}
<p>
<b>{{ category.name }}</b><br>
<i>{{ category.description }}</i>
</p>
{% include "part/category_subcategories.html" with children=category.children.all %}
{% include "part/category_parts.html" with parts=category.parts.all %}

View File

@@ -1,10 +1,15 @@
{% if parts|length > 0 %}
Parts:
<ul class="list-group">
<table class="table table-striped">
<tr>
<th>Part</th>
<th>Description</th>
</tr>
{% for part in parts %}
<li class="list-group-item">
<a href="{% url 'part-detail' part.id %}">{{ part.name }}</a> - {{ part.description }}
</li>
<tr>
<td><a href="{% url 'part-detail' part.id %}">{{ part.name }}</a></td>
<td>{{ part.description }}</td>
</tr>
{% endfor %}
</ul>
</table>
{% endif %}

View File

@@ -3,7 +3,10 @@ Subcategories:
<ul class="list-group">
{% for child in children %}
<li class="list-group-item">
<a href="{% url 'category-detail' child.id %}">{{ child.name }}</a> - {{ child.description }}
<b><a href="{% url 'category-detail' child.id %}">{{ child.name }}</a></b>
{% if child.description %}
<i> - {{ child.description }}</i>
{% endif %}
<span class='badge'>{{ child.partcount }}</span>
</li>
{% endfor %}

View File

@@ -16,7 +16,7 @@
{% endif %}/>
</div>
<div class="media-body">
<h5>{{ part.name }}</h5>
<h4>{{ part.name }}</h4>
{% if part.description %}
<p><i>{{ part.description }}</i></p>
{% endif %}