Fix rendering of "used in" page

This commit is contained in:
Oliver Walters 2020-04-28 22:57:18 +10:00
parent 24ad4f5332
commit df218a5193

View File

@ -1,10 +1,10 @@
{% extends "part/part_base.html" %} {% extends "part/part_base.html" %}
{% load i18n %}
{% block details %} {% block details %}
{% include 'part/tabs.html' with tab='used' %} {% include 'part/tabs.html' with tab='used' %}
<h4>Assemblies</h4> <h4>{% trans "Assemblies" %}</h4>
<hr> <hr>
@ -35,10 +35,11 @@
title: 'Part', title: 'Part',
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
var html = imageHoverIcon(row.part_detail.thumbnail) + renderLink(value.full_name, value.url + 'bom/'); var link = `/part/${value.pk}/bom/`;
var html = imageHoverIcon(row.part_detail.thumbnail) + renderLink(value.full_name, link);
if (!row.part_detail.active) { if (!row.part_detail.active) {
html += "<span class='label label-warning' style='float: right;'>INACTIVE</span>"; html += "<span class='label label-warning' style='float: right;'>{% trans "INACTIVE" %}</span>";
} }
return html; return html;