diff --git a/src/wuttafarm/web/templates/assets/master/view.mako b/src/wuttafarm/web/templates/assets/master/view.mako new file mode 100644 index 0000000..dac5a1c --- /dev/null +++ b/src/wuttafarm/web/templates/assets/master/view.mako @@ -0,0 +1,14 @@ +## -*- coding: utf-8; -*- +<%inherit file="/master/view.mako" /> + +<%def name="page_content()"> + + % if instance.archived: + + This asset is archived. + Archived assets should only be edited if they need corrections. + + % endif + + ${parent.page_content()} + diff --git a/src/wuttafarm/web/views/assets.py b/src/wuttafarm/web/views/assets.py index 702687d..682e258 100644 --- a/src/wuttafarm/web/views/assets.py +++ b/src/wuttafarm/web/views/assets.py @@ -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