- Added responsive table styles with mobile card layouts to base.html - Converted all templates from Bootstrap/plain CSS to Tailwind CSS - Implemented responsive tables with horizontal scroll on desktop - Added mobile card layouts for better readability on small screens - Standardized form layouts with Tailwind responsive grid - Updated all 15 templates for consistent styling: * base.html (responsive table CSS) * index.html (responsive tables + mobile cards) * students.html (Bootstrap -> Tailwind) * student_detail.html (Bootstrap -> Tailwind) * add_student.html (Bootstrap -> Tailwind) * edit_student.html (Bootstrap -> Tailwind) * import_students.html (Bootstrap -> Tailwind) * loan_tablet.html (Bootstrap -> Tailwind) * history.html (plain CSS -> Tailwind) * non_loanable_devices.html (plain CSS -> Tailwind) * add_non_loanable_device.html (plain CSS -> Tailwind) * edit_non_loanable_device.html (plain CSS -> Tailwind) * add_tablet.html (plain CSS -> Tailwind) * add_user.html (plain CSS -> Tailwind) * project_management.html (plain CSS -> Tailwind)
116 lines
8.2 KiB
HTML
116 lines
8.2 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<div class="max-w-2xl mx-auto space-y-6">
|
|
{# Page Header #}
|
|
<div>
|
|
<h1 class="text-2xl font-bold text-gray-900">{{ _('Edit Non-Loanable Device') }}</h1>
|
|
<p class="text-gray-600 mt-1">{{ _('Update device information') }}</p>
|
|
</div>
|
|
|
|
{# Device Form #}
|
|
<div class="bg-white rounded-lg shadow overflow-hidden">
|
|
<div class="bg-cobalt-600 px-6 py-4">
|
|
<h2 class="text-lg font-semibold text-white">{{ _('Device Information') }}</h2>
|
|
</div>
|
|
<div class="p-6">
|
|
<form method="POST" action="/edit_non_loanable_device/{{ device.id }}" class="space-y-6">
|
|
<div>
|
|
<label for="device_type" class="block text-sm font-medium text-gray-700 mb-1">{{ _('Device Type') }} *</label>
|
|
<select id="device_type" name="device_type" required
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-cobalt-500 focus:border-cobalt-500">
|
|
<option value="projector" {% if device.device_type == 'projector' %}selected{% endif %}>{{ _('Projector') }}</option>
|
|
<option value="monitor" {% if device.device_type == 'monitor' %}selected{% endif %}>{{ _('Monitor') }}</option>
|
|
<option value="laptop" {% if device.device_type == 'laptop' %}selected{% endif %}>{{ _('Laptop (non-loanable)') }}</option>
|
|
<option value="printer" {% if device.device_type == 'printer' %}selected{% endif %}>{{ _('Printer') }}</option>
|
|
<option value="camera" {% if device.device_type == 'camera' %}selected{% endif %}>{{ _('Camera') }}</option>
|
|
<option value="audio" {% if device.device_type == 'audio' %}selected{% endif %}>{{ _('Audio Equipment') }}</option>
|
|
<option value="network" {% if device.device_type == 'network' %}selected{% endif %}>{{ _('Network Equipment') }}</option>
|
|
<option value="other" {% if device.device_type == 'other' %}selected{% endif %}>{{ _('Other') }}</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="brand" class="block text-sm font-medium text-gray-700 mb-1">{{ _('Brand') }} *</label>
|
|
<input type="text" id="brand" name="brand" value="{{ device.brand }}" required
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-cobalt-500 focus:border-cobalt-500"
|
|
placeholder="{{ _('e.g., Epson, Samsung, Dell') }}">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="model" class="block text-sm font-medium text-gray-700 mb-1">{{ _('Model') }} *</label>
|
|
<input type="text" id="model" name="model" value="{{ device.model }}" required
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-cobalt-500 focus:border-cobalt-500"
|
|
placeholder="{{ _('e.g., PowerLite 2250U, UltraSharp U2723QE') }}">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="serial_number" class="block text-sm font-medium text-gray-700 mb-1">{{ _('Serial Number') }} *</label>
|
|
<input type="text" id="serial_number" name="serial_number" value="{{ device.serial_number }}" required
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-cobalt-500 focus:border-cobalt-500"
|
|
placeholder="{{ _('Unique serial number') }}">
|
|
<p class="mt-1 text-sm text-gray-500">{{ _('Each device must have a unique serial number') }}</p>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="location" class="block text-sm font-medium text-gray-700 mb-1">{{ _('Location') }}</label>
|
|
<input type="text" id="location" name="location" value="{{ device.location or '' }}"
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-cobalt-500 focus:border-cobalt-500"
|
|
placeholder="{{ _('e.g., Room 101, Lab A, Storage') }}">
|
|
<p class="mt-1 text-sm text-gray-500">{{ _('Optional location where the device is stored') }}</p>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="status" class="block text-sm font-medium text-gray-700 mb-1">{{ _('Status') }} *</label>
|
|
<select id="status" name="status" required
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-cobalt-500 focus:border-cobalt-500">
|
|
<option value="available" {% if device.status == 'available' %}selected{% endif %}>{{ _('Available') }}</option>
|
|
<option value="in_use" {% if device.status == 'in_use' %}selected{% endif %}>{{ _('In Use') }}</option>
|
|
<option value="maintenance" {% if device.status == 'maintenance' %}selected{% endif %}>{{ _('Maintenance') }}</option>
|
|
<option value="retired" {% if device.status == 'retired' %}selected{% endif %}>{{ _('Retired') }}</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
|
<div>
|
|
<label for="purchase_date" class="block text-sm font-medium text-gray-700 mb-1">{{ _('Purchase Date') }}</label>
|
|
<input type="date" id="purchase_date" name="purchase_date" value="{{ device.purchase_date or '' }}"
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-cobalt-500 focus:border-cobalt-500">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="purchase_cost" class="block text-sm font-medium text-gray-700 mb-1">{{ _('Purchase Cost') }}</label>
|
|
<input type="number" id="purchase_cost" name="purchase_cost" step="0.01" value="{{ device.purchase_cost or '' }}"
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-cobalt-500 focus:border-cobalt-500"
|
|
placeholder="{{ _('0.00') }}">
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="notes" class="block text-sm font-medium text-gray-700 mb-1">{{ _('Notes') }}</label>
|
|
<textarea id="notes" name="notes" rows="3"
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-cobalt-500 focus:border-cobalt-500"
|
|
placeholder="{{ _('Optional notes about the device (condition, accessories, etc.)') }}">{{ device.notes or '' }}</textarea>
|
|
</div>
|
|
|
|
<div class="flex justify-end gap-3 pt-4 border-t border-gray-200">
|
|
<a href="/non_loanable_devices"
|
|
class="inline-flex items-center gap-2 px-4 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300 transition-colors">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
|
|
</svg>
|
|
{{ _('Cancel') }}
|
|
</a>
|
|
<button type="submit"
|
|
class="inline-flex items-center gap-2 px-4 py-2 bg-cobalt-600 text-white rounded-lg hover:bg-cobalt-700 transition-colors">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
|
|
</svg>
|
|
{{ _('Update Device') }}
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|