Open QR Label in modal instead of a new browser tab

Adds an embed mode to the Label view (hides standalone nav controls) and
an iframe-based modal on Inventory Details. The modal footer Print button
calls contentWindow.print() so the print dialog opens without spawning a
new window.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-23 09:32:57 -04:00
parent 64a9c1531b
commit 05935b110a
3 changed files with 40 additions and 4 deletions
@@ -1623,11 +1623,12 @@ public class InventoryController : Controller
/// Renders a print-optimised label for the inventory item containing the QR code,
/// item name, SKU, and colour. Designed to be printed directly from the browser.
/// </summary>
public async Task<IActionResult> Label(int? id)
public async Task<IActionResult> Label(int? id, bool embed = false)
{
if (id == null) return NotFound();
var item = await _unitOfWork.InventoryItems.GetByIdAsync(id.Value);
if (item == null) return NotFound();
ViewBag.IsEmbed = embed;
return View(_mapper.Map<InventoryItemDto>(item));
}