IT Assets: add template tags reference table to doc-templates page
Collapsible table showing all 21 available {{ variable }} tags grouped by
section (User, Asset, Assignment, Document/Company) with descriptions,
format notes, and GDPR masking indicators.
This commit is contained in:
@@ -74,4 +74,198 @@
|
||||
No templates yet. <a href="{{ url_for('doc_templates.upload') }}">Upload your first template</a>.
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- ── Available Template Tags Reference ─────────────────────────────────── -->
|
||||
<div class="mt-5">
|
||||
<div class="d-flex align-items-center justify-content-between mb-2">
|
||||
<h5 class="mb-0"><i class="bi bi-braces me-2 text-primary"></i>Available Template Tags</h5>
|
||||
<button class="btn btn-sm btn-outline-secondary" type="button"
|
||||
data-bs-toggle="collapse" data-bs-target="#tagReference">
|
||||
Show / Hide
|
||||
</button>
|
||||
</div>
|
||||
<p class="text-muted small mb-3">
|
||||
Place these tags inside your <code>.docx</code> file exactly as shown.
|
||||
The system replaces them with live data when a document is generated.
|
||||
</p>
|
||||
|
||||
<div class="collapse show" id="tagReference">
|
||||
<div class="card border-0 shadow-sm">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-hover mb-0 align-middle">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th style="width:30%">Value / Description</th>
|
||||
<th style="width:32%">Tag to place in document</th>
|
||||
<th>Notes</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr class="table-active">
|
||||
<td colspan="3" class="fw-semibold text-uppercase small py-2 ps-3"
|
||||
style="letter-spacing:.06em; opacity:.7;">
|
||||
<i class="bi bi-person me-1"></i>User
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Full name</td>
|
||||
<td><code>{{ user_name }}</code></td>
|
||||
<td class="text-muted small">Replaced with <em>[MASKED]</em> after GDPR erasure</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email address</td>
|
||||
<td><code>{{ user_email }}</code></td>
|
||||
<td class="text-muted small">Replaced with <em>[MASKED]</em> after GDPR erasure</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Phone number</td>
|
||||
<td><code>{{ user_phone }}</code></td>
|
||||
<td class="text-muted small">Replaced with <em>[MASKED]</em> after GDPR erasure</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Department</td>
|
||||
<td><code>{{ user_department }}</code></td>
|
||||
<td class="text-muted small">Retained after masking</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Job title</td>
|
||||
<td><code>{{ user_job_title }}</code></td>
|
||||
<td class="text-muted small">Retained after masking</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Office / location</td>
|
||||
<td><code>{{ user_location }}</code></td>
|
||||
<td class="text-muted small">Retained after masking</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Windows / AD ID</td>
|
||||
<td><code>{{ user_windows_id }}</code></td>
|
||||
<td class="text-muted small">Permanent anchor — always retained</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Employee ID <span class="badge bg-secondary ms-1" style="font-size:.65rem;">alias</span></td>
|
||||
<td><code>{{ user_employee_id }}</code></td>
|
||||
<td class="text-muted small">Same as <code>user_windows_id</code></td>
|
||||
</tr>
|
||||
|
||||
<tr class="table-active">
|
||||
<td colspan="3" class="fw-semibold text-uppercase small py-2 ps-3"
|
||||
style="letter-spacing:.06em; opacity:.7;">
|
||||
<i class="bi bi-laptop me-1"></i>Asset
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Serial number</td>
|
||||
<td><code>{{ asset_serial }}</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Service tag</td>
|
||||
<td><code>{{ asset_service_tag }}</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Internal asset tag</td>
|
||||
<td><code>{{ asset_tag }}</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brand</td>
|
||||
<td><code>{{ asset_brand }}</code></td>
|
||||
<td class="text-muted small">e.g. Dell, Lenovo, HP</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Model</td>
|
||||
<td><code>{{ asset_model }}</code></td>
|
||||
<td class="text-muted small">e.g. Latitude 5540</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Asset type</td>
|
||||
<td><code>{{ asset_type }}</code></td>
|
||||
<td class="text-muted small">e.g. Laptop, Desktop, Monitor</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Operating system</td>
|
||||
<td><code>{{ asset_os }}</code></td>
|
||||
<td class="text-muted small">e.g. Windows 11 Pro</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Warranty expiry</td>
|
||||
<td><code>{{ asset_warranty_expiry }}</code></td>
|
||||
<td class="text-muted small">Format: dd/mm/yyyy</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Asset location</td>
|
||||
<td><code>{{ asset_location }}</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr class="table-active">
|
||||
<td colspan="3" class="fw-semibold text-uppercase small py-2 ps-3"
|
||||
style="letter-spacing:.06em; opacity:.7;">
|
||||
<i class="bi bi-arrow-left-right me-1"></i>Assignment
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Assignment date</td>
|
||||
<td><code>{{ assignment_date }}</code></td>
|
||||
<td class="text-muted small">Format: dd/mm/yyyy</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Assignment record ID</td>
|
||||
<td><code>{{ assignment_id }}</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Return date</td>
|
||||
<td><code>{{ return_date }}</code></td>
|
||||
<td class="text-muted small">Format: dd/mm/yyyy — blank if not yet returned</td>
|
||||
</tr>
|
||||
|
||||
<tr class="table-active">
|
||||
<td colspan="3" class="fw-semibold text-uppercase small py-2 ps-3"
|
||||
style="letter-spacing:.06em; opacity:.7;">
|
||||
<i class="bi bi-file-earmark-text me-1"></i>Document & Company
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Document date</td>
|
||||
<td><code>{{ document_date }}</code></td>
|
||||
<td class="text-muted small">Date the document was generated (dd/mm/yyyy)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Document number</td>
|
||||
<td><code>{{ document_number }}</code></td>
|
||||
<td class="text-muted small">Paperwork record ID</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Company name</td>
|
||||
<td><code>{{ company_name }}</code></td>
|
||||
<td class="text-muted small">Set via <code>COMPANY_NAME</code> env variable</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Company address</td>
|
||||
<td><code>{{ company_address }}</code></td>
|
||||
<td class="text-muted small">Set via <code>COMPANY_ADDRESS</code> env variable</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Generated by (admin)</td>
|
||||
<td><code>{{ admin_name }}</code></td>
|
||||
<td class="text-muted small">Username of the staff member who created the document</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer small text-muted">
|
||||
<i class="bi bi-info-circle me-1"></i>
|
||||
Tags use <strong>double curly braces</strong> — type them directly inside your Word document.
|
||||
Tags that are empty at generation time are replaced with a blank string.
|
||||
<strong>PII tags</strong> (<code>user_name</code>, <code>user_email</code>, <code>user_phone</code>)
|
||||
are automatically blanked when a user record is masked for GDPR compliance.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user