From 1bbeef7a472a1ed1b340056a905875144d11d318 Mon Sep 17 00:00:00 2001 From: RNL Date: Sat, 8 Aug 2026 23:33:09 +1000 Subject: [PATCH] fix(templates): grey out filament write controls for read-only viewers RAE is adding a 'friend' access tier that can view the filament inventory but not modify it. These buttons already conditionally render on {% if not is_basic_user %}; this adds a parallel can_write check so a read-only-but-not-basic viewer sees Add/Edit/Delete/Manage Colors as visibly disabled (with a tooltip) rather than fully hidden or, worse, clickable. --- bambu_run/templates/bambu_run/filament_color_list.html | 6 +++--- bambu_run/templates/bambu_run/filament_detail.html | 2 +- bambu_run/templates/bambu_run/filament_list.html | 4 ++-- bambu_run/templates/bambu_run/filament_type_list.html | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bambu_run/templates/bambu_run/filament_color_list.html b/bambu_run/templates/bambu_run/filament_color_list.html index a3189ce..5e9cfc9 100644 --- a/bambu_run/templates/bambu_run/filament_color_list.html +++ b/bambu_run/templates/bambu_run/filament_color_list.html @@ -10,7 +10,7 @@
{% if not is_basic_user %} - + Add New Color {% endif %} @@ -81,8 +81,8 @@ {{ color.brand }} {% if not is_basic_user %} - Edit - Delete + Edit + Delete {% endif %} diff --git a/bambu_run/templates/bambu_run/filament_detail.html b/bambu_run/templates/bambu_run/filament_detail.html index b0a0679..d1bfde6 100644 --- a/bambu_run/templates/bambu_run/filament_detail.html +++ b/bambu_run/templates/bambu_run/filament_detail.html @@ -14,7 +14,7 @@
{% if not is_basic_user %} - Edit + Edit {% endif %} Back to List
diff --git a/bambu_run/templates/bambu_run/filament_list.html b/bambu_run/templates/bambu_run/filament_list.html index e77cb7e..24af472 100644 --- a/bambu_run/templates/bambu_run/filament_list.html +++ b/bambu_run/templates/bambu_run/filament_list.html @@ -20,7 +20,7 @@ Manage Colors - + Add Filament @@ -177,7 +177,7 @@ View {% if not is_basic_user %} - Edit + Edit {% endif %} diff --git a/bambu_run/templates/bambu_run/filament_type_list.html b/bambu_run/templates/bambu_run/filament_type_list.html index b112cbc..1ec0244 100644 --- a/bambu_run/templates/bambu_run/filament_type_list.html +++ b/bambu_run/templates/bambu_run/filament_type_list.html @@ -10,7 +10,7 @@
{% if not is_basic_user %} - + Add New Type {% endif %} @@ -63,8 +63,8 @@ {{ ft.brand }} {% if not is_basic_user %} - Edit - Delete + Edit + Delete {% endif %}