{% load tour_tags %} {% with can_view=perms.netbox_virtual_tour.view_virtualtour can_edit=perms.netbox_virtual_tour.change_virtualtour %} {% if tour and tour.is_published and can_view or can_edit %}
Virtual Tour
{% if tour and tour.is_published and can_view %} Open Virtual Tour {% if can_edit %}Edit{% endif %} {% elif can_edit %} {% if tour %} Draft — not yet published. Continue Editing {% else %} Add Virtual Tour {% endif %} {% endif %}
{% endif %} {% endwith %}