|
1 | 1 | {% extends 'generic/object.html' %}
|
2 | 2 | {% load render_table from django_tables2 %}
|
3 | 3 |
|
4 |
| -{% block breadcrumbs %} |
5 |
| -<li class="breadcrumb-item"><a href="{% url 'plugins:netbox_acls:accesslist_list' %}">Access Lists</a></li> |
6 |
| -{% endblock %} |
7 |
| -{% block controls %} |
8 |
| -<div class="pull-right noprint"> |
| 4 | +{% block extra_controls %} |
9 | 5 | {% if perms.netbox_acls.change_policy %}
|
10 |
| - {% if object.type == 'extended' %} |
11 |
| - <a href="{% url 'plugins:netbox_acls:aclextendedrule_add' %}?access_list={{ object.pk }}" class="btn btn-success"> |
12 |
| - {% elif object.type == 'standard' %} |
13 |
| - <a href="{% url 'plugins:netbox_acls:aclstandardrule_add' %}?access_list={{ object.pk }}" class="btn btn-success"> |
14 |
| - {% endif %} |
15 |
| - <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Rule |
16 |
| - </a> |
17 |
| - <a href="{% url 'plugins:netbox_acls:accesslist_edit' pk=object.pk %}" class="btn btn-warning"> |
18 |
| - <span class="mdi mdi-pencil" aria-hidden="true"></span> Edit |
19 |
| - </a> |
20 |
| - {% endif %} |
21 |
| - {% if perms.netbox_acls.delete_policy %} |
22 |
| - <a href="{% url 'plugins:netbox_acls:accesslist_delete' pk=object.pk %}" class="btn btn-danger"> |
23 |
| - <span class="mdi mdi-trash-can-outline" aria-hidden="true"></span> Delete |
| 6 | + {% if object.type == 'extended' %} |
| 7 | + <a href="{% url 'plugins:netbox_acls:aclextendedrule_add' %}?access_list={{ object.pk }}" class="btn btn-sm btn-primary"> |
| 8 | + {% elif object.type == 'standard' %} |
| 9 | + <a href="{% url 'plugins:netbox_acls:aclstandardrule_add' %}?access_list={{ object.pk }}" class="btn btn-sm btn-primary"> |
| 10 | + {% endif %} |
| 11 | + <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Rule |
24 | 12 | </a>
|
25 | 13 | {% endif %}
|
26 |
| -</div> |
27 |
| -{% endblock controls %} |
28 |
| -{% block tabs %} |
29 |
| -<ul class="nav nav-tabs px-3"> |
30 |
| - {% block tab_items %} |
31 |
| - <li class="nav-item" role="presentation"> |
32 |
| - <a class="nav-link{% if not active_tab %} active{% endif %}" href="{{ object.get_absolute_url }}">{{ object|meta:"verbose_name"|bettertitle }}</a> |
33 |
| - </li> |
34 |
| - {% endblock tab_items %} |
35 |
| - {% if perms.extras.view_objectchange %} |
36 |
| - <li role="presentation" class="nav-item"> |
37 |
| - <a href="{% url 'plugins:netbox_acls:accesslist_changelog' pk=object.pk %}" class="nav-link{% if active_tab == 'changelog'%} active{% endif %}">Change Log</a> |
38 |
| - </li> |
39 |
| - {% endif %} |
40 |
| -</ul> |
41 |
| -{% endblock tabs %} |
| 14 | +{% endblock extra_controls %} |
42 | 15 |
|
43 | 16 | {% block content %}
|
44 |
| - <div class="row mb-3"> |
45 |
| - <div class="col col-md-6"> |
46 |
| - <div class="card"> |
47 |
| - <h5 class="card-header">Access List</h5> |
48 |
| - <div class="card-body"> |
49 |
| - <table class="table table-hover attr-table"> |
50 |
| - <tr> |
51 |
| - <th scope="row">Type</th> |
52 |
| - <td>{{ object.get_type_display }}</td> |
53 |
| - </tr> |
54 |
| - <tr> |
55 |
| - <th scope="row">Default Action</th> |
56 |
| - <td>{% badge object.get_default_action_display bg_color=object.get_default_action_color %}</td> |
57 |
| - </tr> |
58 |
| - <tr> |
59 |
| - <th scope="row">Rules</th> |
60 |
| - {% if object.type == 'standard' %} |
61 |
| - <td>{{ object.aclstandardrules.count|placeholder }}</td> |
62 |
| - {% elif object.type == 'extended' %} |
63 |
| - <td>{{ object.aclextendedrules.count|placeholder }}</td> |
64 |
| - {% endif %} |
65 |
| - <tr> |
66 |
| - <th scope="row">Assigned Host</th> |
67 |
| - <td>{{ object.assigned_object|linkify }}</td> |
68 |
| - </tr> |
69 |
| - </tr> |
70 |
| - </table> |
| 17 | + <div class="row mb-3"> |
| 18 | + <div class="col col-md-6"> |
| 19 | + <div class="card"> |
| 20 | + <h5 class="card-header">Access List</h5> |
| 21 | + <div class="card-body"> |
| 22 | + <table class="table table-hover attr-table"> |
| 23 | + <tr> |
| 24 | + <th scope="row">Type</th> |
| 25 | + <td>{{ object.get_type_display }}</td> |
| 26 | + </tr> |
| 27 | + <tr> |
| 28 | + <th scope="row">Default Action</th> |
| 29 | + <td>{% badge object.get_default_action_display bg_color=object.get_default_action_color %}</td> |
| 30 | + </tr> |
| 31 | + <tr> |
| 32 | + <th scope="row">Rules</th> |
| 33 | + {% if object.type == 'standard' %} |
| 34 | + <td>{{ object.aclstandardrules.count|placeholder }}</td> |
| 35 | + {% elif object.type == 'extended' %} |
| 36 | + <td>{{ object.aclextendedrules.count|placeholder }}</td> |
| 37 | + {% endif %} |
| 38 | + </tr> |
| 39 | + <tr> |
| 40 | + <th scope="row">Assigned Host</th> |
| 41 | + <td>{{ object.assigned_object|linkify }}</td> |
| 42 | + </tr> |
| 43 | + </table> |
| 44 | + </div> |
| 45 | + </div> |
| 46 | + {% include 'inc/panels/custom_fields.html' %} |
| 47 | + </div> |
| 48 | + <div class="col col-md-6"> |
| 49 | + {% include 'inc/panels/tags.html' %} |
| 50 | + {% include 'inc/panels/comments.html' %} |
71 | 51 | </div>
|
72 |
| - </div> |
73 |
| - {% include 'inc/panels/custom_fields.html' %} |
74 |
| - </div> |
75 |
| - <div class="col col-md-6"> |
76 |
| - {% include 'inc/panels/tags.html' %} |
77 |
| - {% include 'inc/panels/comments.html' %} |
78 | 52 | </div>
|
79 |
| - </div> |
80 |
| - <div class="row"> |
81 |
| - <div class="col col-md-12"> |
82 |
| - <div class="card"> |
83 |
| - <h5 class="card-header">{{ object.get_type_display }} Rules</h5> |
84 |
| - <div class="card-body table-responsive"> |
85 |
| - {% render_table rules_table %} |
| 53 | + <div class="row"> |
| 54 | + <div class="col col-md-12"> |
| 55 | + <div class="card"> |
| 56 | + <h5 class="card-header">{{ object.get_type_display }} Rules</h5> |
| 57 | + <div class="card-body table-responsive"> |
| 58 | + {% render_table rules_table %} |
| 59 | + </div> |
| 60 | + </div> |
86 | 61 | </div>
|
87 |
| - </div> |
88 | 62 | </div>
|
89 |
| - </div> |
90 | 63 | {% endblock content %}
|
0 commit comments