update code of dash and report of cont_client and devlp abstract of qty
This commit is contained in:
84
app/templates/edit_record.html
Normal file
84
app/templates/edit_record.html
Normal file
@@ -0,0 +1,84 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
<div class="container-fluid py-4">
|
||||
|
||||
<!-- Page Header -->
|
||||
<div class="card shadow-sm border-0 mb-4">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<h2 class="fw-bold text-primary mb-1">
|
||||
<i class="bi bi-pencil-square"></i>
|
||||
Edit Record
|
||||
</h2>
|
||||
<small class="text-muted">
|
||||
Model: <strong>{{ model|upper }}</strong> | Record ID: {{ record.id }}
|
||||
</small>
|
||||
</div>
|
||||
<a href="{{ url_for('file_report.report_file') }}" class="btn btn-secondary">
|
||||
<i class="bi bi-arrow-left"></i> Back to Report
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Edit Form -->
|
||||
<div class="card shadow-sm border-0">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h5 class="mb-0">
|
||||
<i class="bi bi-card-checklist"></i>
|
||||
Update Record Details
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form method="POST">
|
||||
<div class="row g-3">
|
||||
|
||||
{% for column in record.__table__.columns %}
|
||||
{% if column.name != "id" %}
|
||||
<div class="col-lg-4">
|
||||
<label class="form-label fw-semibold">
|
||||
{{ column.name.replace('_', ' ')|title }}
|
||||
</label>
|
||||
|
||||
{% set value = record|attr(column.name) %}
|
||||
|
||||
{% if column.type.python_type.__name__ == 'bool' %}
|
||||
<select name="{{ column.name }}" class="form-select">
|
||||
<option value="true" {% if value %}selected{% endif %}>Yes</option>
|
||||
<option value="false" {% if not value %}selected{% endif %}>No</option>
|
||||
</select>
|
||||
|
||||
{% elif column.type.python_type.__name__ in ['int', 'float', 'Decimal'] %}
|
||||
<input type="number" step="any" name="{{ column.name }}"
|
||||
class="form-control" value="{{ value if value is not none else '' }}">
|
||||
|
||||
{% elif column.type.python_type.__name__ == 'date' %}
|
||||
<input type="date" name="{{ column.name }}"
|
||||
class="form-control" value="{{ value if value is not none else '' }}">
|
||||
|
||||
{% else %}
|
||||
<input type="text" name="{{ column.name }}"
|
||||
class="form-control" value="{{ value if value is not none else '' }}">
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mt-4 d-flex justify-content-end gap-2">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-check-circle"></i> Save Changes
|
||||
</button>
|
||||
<a href="{{ url_for('file_report.report_file') }}" class="btn btn-secondary">
|
||||
<i class="bi bi-x-circle"></i> Cancel
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user