When all fields are read-only, don't show save/"change"/etc.
|Reported by:||joestump||Owned by:||nobody|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I recently created an admin form where I wanted to set ALL of the fields in said admin form (a ModelAdmin) to read-only. Basically, I just wanted a simple "viewer" for each of these records (credit card transaction results from Authorize.Net so I don't exactly want people changing auth codes, transaction ID's, etc.). When I go to a record I see the following UI elements that are somewhat out of place:
- Save and add another
- Save and continue editing
- The header "Change transaction" (should probably say "View transaction" or simply the result of unicode for the object)
Delete is also somewhat out of place here. Might make sense to default has_delete_permission() to return False when all fields are marked as read-only.