Improvements to "grid view" for parts list

- Display 5 tiles per line
- Reduce padding
- Add border
This commit is contained in:
Oliver 2021-10-18 12:19:16 +11:00
parent addb265984
commit 68cfd8615e
2 changed files with 10 additions and 3 deletions

View File

@ -1074,6 +1074,13 @@ input[type='number']{
margin-top: 0.5rem;
}
.product-card {
width: 20%;
padding: 5px;
min-height: 25px;
}
.product-card-panel{
height: 100%;
border: 1px solid #ccc;
}

View File

@ -778,7 +778,7 @@ function partGridTile(part) {
var html = `
<div class='col-sm-3 card'>
<div class='product-card card'>
<div class='panel panel-default panel-inventree product-card-panel'>
<div class='panel-heading'>
<a href='/part/${part.pk}/'>
@ -1000,8 +1000,8 @@ function loadPartTable(table, url, options={}) {
data.forEach(function(row, index) {
// Force a new row every 4 columns, to prevent visual issues
if ((index > 0) && (index % 4 == 0) && (index < data.length)) {
// Force a new row every 5 columns
if ((index > 0) && (index % 5 == 0) && (index < data.length)) {
html += `</div><div class='row full-height'>`;
}