diff --git a/InvenTree/company/serializers.py b/InvenTree/company/serializers.py
index f2f06c607f..bb99f18e75 100644
--- a/InvenTree/company/serializers.py
+++ b/InvenTree/company/serializers.py
@@ -5,6 +5,8 @@ from .models import Company
class CompanySerializer(serializers.HyperlinkedModelSerializer):
+ url = serializers.CharField(source='get_absolute_url', read_only=True)
+
class Meta:
model = Company
fields = '__all__'
diff --git a/InvenTree/company/templates/company/index.html b/InvenTree/company/templates/company/index.html
index 607c4f1cee..cec745cd20 100644
--- a/InvenTree/company/templates/company/index.html
+++ b/InvenTree/company/templates/company/index.html
@@ -6,26 +6,7 @@
-
-
- Name |
- Description |
-
-
-
- {% for company in companies %}
-
-
-
- {{ company.name }}
-
- |
- {{ company.description }} |
-
- {% endfor %}
-
+
@@ -48,4 +29,40 @@
follow: true
});
});
+
+ $("#company-table").bootstrapTable({
+ sortable: true,
+ search: true,
+ columns: [
+ {
+ field: 'pk',
+ title: 'ID',
+ visible: false,
+ },
+ {
+ field: 'name',
+ title: 'Company',
+ sortable: true,
+ formatter: function(value, row, index, field) {
+ return renderLink(value, row.url);
+ }
+ },
+ {
+ field: 'description',
+ title: 'Description',
+ },
+ {
+ field: 'website',
+ title: 'Website',
+ formatter: function(value, row, index, field) {
+ if (value) {
+ return renderLink(value, value);
+ }
+ return '';
+ }
+ }
+ ],
+ url: "{% url 'api-company-list' %}"
+ });
+
{% endblock %}
\ No newline at end of file
diff --git a/InvenTree/part/templates/part/category_parts.html b/InvenTree/part/templates/part/category_parts.html
index 3a8c272463..f389fee83a 100644
--- a/InvenTree/part/templates/part/category_parts.html
+++ b/InvenTree/part/templates/part/category_parts.html
@@ -59,5 +59,5 @@
sortable: true,
}
],
- url: 'http://127.0.0.1:8000/api/part/',
+ url: "{% url 'api-part-list' %}",
});
\ No newline at end of file