mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 04:26:44 +00:00
Display templated parts as italic in the part list
This commit is contained in:
parent
6603d6e9ed
commit
21dd893c01
@ -93,6 +93,7 @@ class EditPartForm(HelperForm):
|
|||||||
'name',
|
'name',
|
||||||
'IPN',
|
'IPN',
|
||||||
'variant',
|
'variant',
|
||||||
|
'is_template',
|
||||||
'description',
|
'description',
|
||||||
'keywords',
|
'keywords',
|
||||||
'URL',
|
'URL',
|
||||||
|
@ -85,6 +85,8 @@ class PartSerializer(serializers.ModelSerializer):
|
|||||||
'full_name',
|
'full_name',
|
||||||
'name',
|
'name',
|
||||||
'IPN',
|
'IPN',
|
||||||
|
'is_template',
|
||||||
|
'variant_of',
|
||||||
'variant',
|
'variant',
|
||||||
'description',
|
'description',
|
||||||
'keywords',
|
'keywords',
|
||||||
|
@ -47,10 +47,12 @@
|
|||||||
<button type='button' class='btn btn-default btn-glyph' id='toggle-starred' title='Star this part'>
|
<button type='button' class='btn btn-default btn-glyph' id='toggle-starred' title='Star this part'>
|
||||||
<span id='part-star-icon' class='starred-part glyphicon {% if starred %}glyphicon-star{% else %}glyphicon-star-empty{% endif %}'/>
|
<span id='part-star-icon' class='starred-part glyphicon {% if starred %}glyphicon-star{% else %}glyphicon-star-empty{% endif %}'/>
|
||||||
</button>
|
</button>
|
||||||
|
{% if part.is_template == False %}
|
||||||
{% include "qr_button.html" %}
|
{% include "qr_button.html" %}
|
||||||
<button type='button' class='btn btn-default btn-glyph' id='price-button' title='Show pricing information'>
|
<button type='button' class='btn btn-default btn-glyph' id='price-button' title='Show pricing information'>
|
||||||
<span id='part-price-icon' class='part-price glyphicon glyphicon-usd'/>
|
<span id='part-price-icon' class='part-price glyphicon glyphicon-usd'/>
|
||||||
</button>
|
</button>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</p>
|
</p>
|
||||||
<table class='table table-condensed'>
|
<table class='table table-condensed'>
|
||||||
|
@ -124,7 +124,12 @@ function loadPartTable(table, url, options={}) {
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
|
|
||||||
|
if (row.is_template) {
|
||||||
|
value = '<i>' + value + '</i>';
|
||||||
|
}
|
||||||
|
|
||||||
var display = imageHoverIcon(row.image_url) + renderLink(value, row.url);
|
var display = imageHoverIcon(row.image_url) + renderLink(value, row.url);
|
||||||
|
|
||||||
if (!row.active) {
|
if (!row.active) {
|
||||||
display = display + "<span class='label label-warning' style='float: right;'>INACTIVE</span>";
|
display = display + "<span class='label label-warning' style='float: right;'>INACTIVE</span>";
|
||||||
}
|
}
|
||||||
@ -135,6 +140,14 @@ function loadPartTable(table, url, options={}) {
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
field: 'description',
|
field: 'description',
|
||||||
title: 'Description',
|
title: 'Description',
|
||||||
|
formatter: function(value, row, index, field) {
|
||||||
|
|
||||||
|
if (row.is_template) {
|
||||||
|
value = '<i>' + value + '</i>';
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user