{% set exists = fqname and storage.get_item(**fqname.query) %}
{%- for endpoint, label, title, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %}
{%- if not check_exists or check_exists and exists %}
{%- if endpoint in [
'frontend.show_item', 'frontend.index', 'frontend.highlight_item',
'frontend.show_item_meta', 'frontend.download_item',
'frontend.history', 'frontend.refs', 'frontend.sitemap',
'frontend.similar_names', 'frontend.copy_item',
] %}
{%- endif %}
{%- if endpoint == 'special.supplementation' and fqname %}
{%- for sub_item_name in cfg.supplementation_item_names %}
{%- set current_sub = item_name.rsplit('/', 1)[-1] %}
{%- if not current_sub in cfg.supplementation_item_names %}
{%- set supp_name = '%s/%s/%s' % (fqname.namespace, item_name, sub_item_name) %}
{%- if storage.has_item(supp_name) or user.may.write(supp_name) %}