mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-14 15:41:10 +00:00
QR code improvements
- Display QR codes as links to served images - The qr_code plugin caches these images in the background - Make a qr_code template to push out as a modal form - Create a QRCodeView to simplify display of QR codes - Add option to launchModalForm() to disable the 'submit' button Refactored QR code display for - StockLocation - StockItem - Part
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
{% extends "part/part_base.html" %}
|
||||
{% load static %}
|
||||
{% load qr_code %}
|
||||
{% block details %}
|
||||
|
||||
{% include 'part/tabs.html' with tab='detail' %}
|
||||
@@ -24,6 +23,7 @@
|
||||
{% else %}
|
||||
<li><a href="#" id='activate-part' title='Activate part'>Activate</a></li>
|
||||
{% endif %}
|
||||
<li><a href='#' id='show-qr-code' title='Generate QR Code'>Show QR Code</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</h3>
|
||||
@@ -116,8 +116,6 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% qr_from_text part.format_barcode size="s" image_format="png" error_correction="L" %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block js_load %}
|
||||
@@ -128,6 +126,15 @@
|
||||
|
||||
{% block js_ready %}
|
||||
{{ block.super }}
|
||||
|
||||
$("#show-qr-code").click(function() {
|
||||
launchModalForm(
|
||||
"{% url 'part-qr' part.id %}",
|
||||
{
|
||||
no_post: true,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("#duplicate-part").click(function() {
|
||||
launchModalForm(
|
||||
|
@@ -22,9 +22,7 @@
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<h4>{{ part.name }}{% if part.active == False %} <i>- INACTIVE</i>{% endif %}</h4>
|
||||
{% if part.description %}
|
||||
<p><i>{{ part.description }}</i></p>
|
||||
{% endif %}
|
||||
{% if part.IPN %}
|
||||
<tr>
|
||||
<td>IPN</td>
|
||||
|
Reference in New Issue
Block a user