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:
ske087
2026-07-09 00:34:59 +03:00
parent c4e718ac4b
commit 6ca5cd613d
@@ -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>&#123;&#123; user_name &#125;&#125;</code></td>
<td class="text-muted small">Replaced with <em>[MASKED]</em> after GDPR erasure</td>
</tr>
<tr>
<td>Email address</td>
<td><code>&#123;&#123; user_email &#125;&#125;</code></td>
<td class="text-muted small">Replaced with <em>[MASKED]</em> after GDPR erasure</td>
</tr>
<tr>
<td>Phone number</td>
<td><code>&#123;&#123; user_phone &#125;&#125;</code></td>
<td class="text-muted small">Replaced with <em>[MASKED]</em> after GDPR erasure</td>
</tr>
<tr>
<td>Department</td>
<td><code>&#123;&#123; user_department &#125;&#125;</code></td>
<td class="text-muted small">Retained after masking</td>
</tr>
<tr>
<td>Job title</td>
<td><code>&#123;&#123; user_job_title &#125;&#125;</code></td>
<td class="text-muted small">Retained after masking</td>
</tr>
<tr>
<td>Office / location</td>
<td><code>&#123;&#123; user_location &#125;&#125;</code></td>
<td class="text-muted small">Retained after masking</td>
</tr>
<tr>
<td>Windows / AD ID</td>
<td><code>&#123;&#123; user_windows_id &#125;&#125;</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>&#123;&#123; user_employee_id &#125;&#125;</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>&#123;&#123; asset_serial &#125;&#125;</code></td>
<td></td>
</tr>
<tr>
<td>Service tag</td>
<td><code>&#123;&#123; asset_service_tag &#125;&#125;</code></td>
<td></td>
</tr>
<tr>
<td>Internal asset tag</td>
<td><code>&#123;&#123; asset_tag &#125;&#125;</code></td>
<td></td>
</tr>
<tr>
<td>Brand</td>
<td><code>&#123;&#123; asset_brand &#125;&#125;</code></td>
<td class="text-muted small">e.g. Dell, Lenovo, HP</td>
</tr>
<tr>
<td>Model</td>
<td><code>&#123;&#123; asset_model &#125;&#125;</code></td>
<td class="text-muted small">e.g. Latitude 5540</td>
</tr>
<tr>
<td>Asset type</td>
<td><code>&#123;&#123; asset_type &#125;&#125;</code></td>
<td class="text-muted small">e.g. Laptop, Desktop, Monitor</td>
</tr>
<tr>
<td>Operating system</td>
<td><code>&#123;&#123; asset_os &#125;&#125;</code></td>
<td class="text-muted small">e.g. Windows 11 Pro</td>
</tr>
<tr>
<td>Warranty expiry</td>
<td><code>&#123;&#123; asset_warranty_expiry &#125;&#125;</code></td>
<td class="text-muted small">Format: dd/mm/yyyy</td>
</tr>
<tr>
<td>Asset location</td>
<td><code>&#123;&#123; asset_location &#125;&#125;</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>&#123;&#123; assignment_date &#125;&#125;</code></td>
<td class="text-muted small">Format: dd/mm/yyyy</td>
</tr>
<tr>
<td>Assignment record ID</td>
<td><code>&#123;&#123; assignment_id &#125;&#125;</code></td>
<td></td>
</tr>
<tr>
<td>Return date</td>
<td><code>&#123;&#123; return_date &#125;&#125;</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 &amp; Company
</td>
</tr>
<tr>
<td>Document date</td>
<td><code>&#123;&#123; document_date &#125;&#125;</code></td>
<td class="text-muted small">Date the document was generated (dd/mm/yyyy)</td>
</tr>
<tr>
<td>Document number</td>
<td><code>&#123;&#123; document_number &#125;&#125;</code></td>
<td class="text-muted small">Paperwork record ID</td>
</tr>
<tr>
<td>Company name</td>
<td><code>&#123;&#123; company_name &#125;&#125;</code></td>
<td class="text-muted small">Set via <code>COMPANY_NAME</code> env variable</td>
</tr>
<tr>
<td>Company address</td>
<td><code>&#123;&#123; company_address &#125;&#125;</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>&#123;&#123; admin_name &#125;&#125;</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 %}