diff --git a/netbox/dcim/tables/template_code.py b/netbox/dcim/tables/template_code.py
index 837ab2e3d..d390871c4 100644
--- a/netbox/dcim/tables/template_code.py
+++ b/netbox/dcim/tables/template_code.py
@@ -139,6 +139,7 @@ CONSOLEPORT_BUTTONS = """
{% endif %}
{% elif perms.dcim.add_cable %}
+
{% endif %}
{% elif perms.dcim.add_cable %}
+
{% endif %}
{% elif perms.dcim.add_cable %}
+
{% endif %}
{% elif perms.dcim.add_cable %}
+
{% if not record.mark_connected %}
@@ -356,6 +360,7 @@ INTERFACE_BUTTONS = """
{% endif %}
{% elif record.is_wired and perms.dcim.add_cable %}
+
{% if not record.mark_connected %}
@@ -412,6 +417,7 @@ FRONTPORT_BUTTONS = """
{% endif %}
{% elif perms.dcim.add_cable %}
+
{% if not record.mark_connected %}
@@ -466,6 +472,7 @@ REARPORT_BUTTONS = """
{% endif %}
{% elif perms.dcim.add_cable %}
+
{% if not record.mark_connected %}