fix: show warning when viewing an archived asset

This commit is contained in:
Lance Edgar 2026-02-16 14:54:55 -06:00
parent bb21d6a364
commit b85259c013
2 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,14 @@
## -*- coding: utf-8; -*-
<%inherit file="/master/view.mako" />
<%def name="page_content()">
% if instance.archived:
<b-notification type="is-warning">
This asset is archived.
Archived assets should only be edited if they need corrections.
</b-notification>
% endif
${parent.page_content()}
</%def>

View file

@ -130,6 +130,14 @@ class AssetMasterView(WuttaFarmMasterView):
"archived": {"active": True, "verb": "is_false"}, "archived": {"active": True, "verb": "is_false"},
} }
def get_fallback_templates(self, template):
templates = super().get_fallback_templates(template)
if self.viewing:
templates.insert(0, "/assets/master/view.mako")
return templates
def get_query(self, session=None): def get_query(self, session=None):
""" """ """ """
model = self.app.model model = self.app.model