- Add _() translation function to add_tablet.html, add_user.html, loan_tablet.html - Add _() translation function to add_non_loanable_device.html, edit_non_loanable_device.html - Add _() translation function to history.html, non_loanable_devices.html, project_management.html - Update app.py to use cookie-based language persistence with 1-year expiry - Add /set_language endpoint to handle language switching with cookie + session - Update language switcher in base.html to use new endpoint - Set Spanish (es) as default language for internal app - Import make_response and session from Flask
45 lines
2.1 KiB
HTML
45 lines
2.1 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<div class="section">
|
|
<h2>{{ _('Non-Loanable Devices Inventory') }}</h2>
|
|
<p>{{ _('These devices are tracked in inventory but cannot be loaned to users.') }}</p>
|
|
<a href="/add_non_loanable_device" class="btn">{{ _('Add Non-Loanable Device') }}</a>
|
|
|
|
{% if devices %}
|
|
<div class="table-container">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>{{ _('Type') }}</th>
|
|
<th>{{ _('Brand') }}</th>
|
|
<th>{{ _('Model') }}</th>
|
|
<th>{{ _('Serial Number') }}</th>
|
|
<th>{{ _('Location') }}</th>
|
|
<th>{{ _('Status') }}</th>
|
|
<th>{{ _('Actions') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for device in devices %}
|
|
<tr>
|
|
<td>{{ device.device_type }}</td>
|
|
<td>{{ device.brand }}</td>
|
|
<td>{{ device.model }}</td>
|
|
<td>{{ device.serial_number }}</td>
|
|
<td>{{ device.location or '-' }}</td>
|
|
<td>{{ device.status }}</td>
|
|
<td>
|
|
<a href="/edit_non_loanable_device/{{ device.id }}" class="btn">{{ _('Edit') }}</a>
|
|
<a href="/delete_non_loanable_device/{{ device.id }}" class="btn btn-danger" onclick="return confirm('{{ _("Are you sure you want to delete this device?") }}')">{{ _('Delete') }}</a>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<p>{{ _('No non-loanable devices registered.') }}</p>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|