Replace browser confirm() dialogs with custom modal; add live label preview on battery add form
- base.html: add CSS/HTML/JS for styled in-app confirmation modal (dark-mode compatible via CSS vars) - device_list, battery_detail: convert onsubmit confirm() to declarative data-confirm attributes - dashboard: convert bulk Delete/Install buttons to use modal helpers (submitWithAction pattern) - app.py: pass brand_counts dict to battery_add template - battery_add.html: show live "Will create: Brand 001 → Brand 003" preview as brand/quantity change - tests: add two tests covering brand_counts server-side rendering
This commit is contained in:
@@ -114,7 +114,7 @@
|
||||
<td data-label="">
|
||||
<form class="inline" method="post"
|
||||
action="{{ url_for('battery_capacity_test_delete', battery_id=battery.id, test_id=t.id) }}"
|
||||
onsubmit="return confirm('Delete this test record?')">
|
||||
data-confirm="Delete this test record?" data-confirm-ok="Delete">
|
||||
<button class="btn btn-sm btn-danger" type="submit">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@@ -172,7 +172,7 @@
|
||||
<td data-label="">
|
||||
<form class="inline" method="post"
|
||||
action="{{ url_for('battery_charge_log_delete', battery_id=battery.id, log_id=log.id) }}"
|
||||
onsubmit="return confirm('Delete this charge log entry?')">
|
||||
data-confirm="Delete this charge log entry?" data-confirm-ok="Delete">
|
||||
<button class="btn btn-sm btn-danger" type="submit">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user