fix: show warning when viewing an archived asset
This commit is contained in:
parent
bb21d6a364
commit
b85259c013
2 changed files with 22 additions and 0 deletions
14
src/wuttafarm/web/templates/assets/master/view.mako
Normal file
14
src/wuttafarm/web/templates/assets/master/view.mako
Normal 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>
|
||||
|
|
@ -130,6 +130,14 @@ class AssetMasterView(WuttaFarmMasterView):
|
|||
"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):
|
||||
""" """
|
||||
model = self.app.model
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue