Coverage for core/tables/template_code.py: 100%
6 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-10 18:35 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-10 18:35 +0000
1OBJECTCHANGE_FULL_NAME = """
2{% load helpers %}
3{{ value.get_full_name|placeholder }}
4"""
6OBJECTCHANGE_OBJECT = """
7{% if value and value.get_absolute_url %}
8 <a href="{{ value.get_absolute_url }}">{{ record.object_repr }}</a>
9{% else %}
10 {{ record.object_repr }}
11{% endif %}
12"""
14OBJECTCHANGE_REQUEST_ID = """
15<a href="{% url 'core:objectchange_list' %}?request_id={{ value }}">{{ value }}</a>
16"""
18PLUGIN_IS_INSTALLED = """
19{% if record.is_local %}
20 {% if record.is_loaded %}
21 <span class="text-success"><i class="mdi mdi-check-bold"></i></span>
22 {% else %}
23 <span class="text-danger"><i class="mdi mdi-alert" data-bs-toggle="tooltip" title="Could not load plugin. Version may be incompatible. Min version: {{ record.netbox_min_version }}, max version: {{ record.netbox_max_version }}"></i></span>
24 {% endif %}
25{% else %}
26 <span class="text-muted">—</span>
27{% endif %}
28"""
30PLUGIN_NAME_TEMPLATE = """
31{% load static %}
32{% if record.icon_url %}
33 <img class="plugin-icon" src="{{ record.icon_url }}">
34{% else %}
35 <img class="plugin-icon" src="{% static 'plugin-default.svg' %}">
36{% endif %}
37<a href="{% url 'core:plugin' record.config_name %}">{{ record.title_long }}</a>
38"""
40DATA_SOURCE_SYNC_BUTTON = """
41{% load helpers %}
42{% load i18n %}
43{% if perms.core.sync_datasource %}
44 {% if record.ready_for_sync %}
45 <button class="btn btn-primary btn-sm" type="submit" formaction="{% url 'core:datasource_sync' pk=record.pk %}?return_url={{ request.get_full_path|urlencode }}" formmethod="post">
46 <i class="mdi mdi-sync" aria-hidden="true"></i> {% trans "Sync" %}
47 </button>
48 {% else %}
49 <button class="btn btn-primary btn-sm" disabled>
50 <i class="mdi mdi-sync" aria-hidden="true"></i> {% trans "Sync" %}
51 </button>
52 {% endif %}
53{% endif %}
54"""