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:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user