add component description
This commit is contained in:
parent
7fd3570bc5
commit
0ba7bead13
|
@ -43,7 +43,7 @@
|
|||
</table>
|
||||
<div class="hscroll" id="attachments"></div>
|
||||
<table>
|
||||
<thead><tr><th>component</th><th>quantity</th></tr></thead>
|
||||
<thead><tr><th>component</th><th>quantity</th><th>description</th></tr></thead>
|
||||
<tbody id="components"></tbody>
|
||||
</table>
|
||||
<button type="button" onclick="delete_part()">delete part (including children)</button>
|
||||
|
|
|
@ -152,6 +152,11 @@ function select_part()
|
|||
td.appendChild(input);
|
||||
tr.appendChild(td);
|
||||
}
|
||||
if (row.description) {
|
||||
td = document.createElement('td');
|
||||
td.innerText = row.description;
|
||||
tr.appendChild(td);
|
||||
}
|
||||
if (row.url) {
|
||||
td = document.createElement('td');
|
||||
td.innerHTML = "<a href='" + row.url + "'>link</a>";
|
||||
|
|
|
@ -125,7 +125,7 @@ def get_part_by_id(id)
|
|||
part["attachments"] += parent["attachments"] if parent
|
||||
# add components for assembly
|
||||
part["components"] = []
|
||||
statement = @db.prepare("SELECT part.name AS name, assembly.quantity AS quantity FROM assembly JOIN part ON part.id = assembly.component WHERE assembly.assembled = ?")
|
||||
statement = @db.prepare("SELECT part.name AS name, part.description AS description, assembly.quantity AS quantity FROM assembly JOIN part ON part.id = assembly.component WHERE assembly.assembled = ?")
|
||||
statement.execute(id).each do |row|
|
||||
part["components"] << row
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue