Merge pull request #2175 from SchrodingersGat/grid-view

Improvements to "grid view" for parts list
This commit is contained in:
Oliver 2021-10-18 13:00:28 +11:00 committed by GitHub
commit 03726911e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View File

@ -933,7 +933,8 @@ input[type="submit"] {
.panel-inventree { .panel-inventree {
padding: 10px; padding: 10px;
box-shadow: 1px 1px #DDD; box-shadow: 2px 2px #DDD;
border-color: #ccc;
} }
.panel-hidden { .panel-hidden {
@ -1074,6 +1075,14 @@ input[type='number']{
margin-top: 0.5rem; margin-top: 0.5rem;
} }
.product-card {
width: 20%;
padding: 5px;
min-height: 25px;
}
.product-card-panel{ .product-card-panel{
height: 100%; height: 100%;
border: 1px solid #ccc;
box-shadow: 2px 2px #DDD;
} }

View File

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