mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
FEAT(Asset): Add ability to generate whole page of labels
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{% extends 'base_assets.html' %}
|
||||
{% load paginator from filters %}
|
||||
{% load button from filters %}
|
||||
{% load ids_from_objects from asset_tags %}
|
||||
{% load widget_tweaks %}
|
||||
{% load static %}
|
||||
|
||||
@@ -85,6 +86,9 @@
|
||||
<div class="row my-2">
|
||||
<div class="col text-right px-0">
|
||||
{% button 'new' 'asset_create' style="width: 6em" %}
|
||||
{% if object_list %}
|
||||
<a class="btn btn-primary" href="{% url 'generate_labels' object_list|ids_from_objects %}"><span class="fas fa-barcode"></span> Generate Labels</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row my-2">
|
||||
|
||||
35
assets/templates/labels_print.xml
Normal file
35
assets/templates/labels_print.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE document SYSTEM "rml.dtd">
|
||||
{% load multiply from filters %}
|
||||
{% load index from asset_tags %}
|
||||
<document filename="{{filename}}">
|
||||
<template>
|
||||
<pageTemplate id="main">
|
||||
<pageGraphics>
|
||||
</pageGraphics>
|
||||
<frame id="first" x1="5" y1="-10" width="581" height="842"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="table">
|
||||
<!-- show a grid: this also comes in handy for debugging your tables.-->
|
||||
<lineStyle kind="GRID" colorName="black" thickness="1" start="0,0" stop="-1,-1" />
|
||||
</blockTableStyle>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<blockTable style="table">
|
||||
{% for i in images0 %}
|
||||
<tr>
|
||||
<td>{% with images0|index:forloop.counter0 as image %}{% if image %}<illustration width="120" height="35"><image file="data:image/png;base64,{{image}}" x="0" y="0"
|
||||
width="120" height="35"/></illustration>{% endif %}{% endwith %}</td>
|
||||
<td>{% with images1|index:forloop.counter0 as image %}{% if image %}<illustration width="120" height="35"><image file="data:image/png;base64,{{image}}" x="0" y="0"
|
||||
width="120" height="35"/></illustration>{% endif %}{% endwith %}</td>
|
||||
<td>{% with images2|index:forloop.counter0 as image %}{% if image %}<illustration width="120" height="35"><image file="data:image/png;base64,{{image}}" x="0" y="0"
|
||||
width="120" height="35"/></illustration>{% endif %}{% endwith %}</td>
|
||||
<td>{% with images3|index:forloop.counter0 as image %}{% if image %}<illustration width="120" height="35"><image file="data:image/png;base64,{{image}}" x="0" y="0"
|
||||
width="120" height="35"/></illustration>{% endif %}{% endwith %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</blockTable>
|
||||
</story>
|
||||
</document>
|
||||
@@ -12,9 +12,7 @@
|
||||
{% button 'edit' url='asset_update' pk=object.asset_id %}
|
||||
{% button 'duplicate' url='asset_duplicate' pk=object.asset_id %}
|
||||
<a type="button" class="btn btn-info" href="{% url 'asset_audit' object.asset_id %}"><span class="fas fa-certificate"></span> Audit</a>
|
||||
{% if object.is_cable %}
|
||||
<a type="button" class="btn btn-primary" href="{% url 'generate_label' object.asset_id %}"><span class="fas fa-barcode"></span> Generate Label</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if create or edit or duplicate %}
|
||||
|
||||
Reference in New Issue
Block a user