fixed rules table rendering

This commit is contained in:
Abhimanyu Saharan 2023-01-21 14:19:22 +05:30
parent e0c3a9a5f9
commit 8713dd165b
2 changed files with 13 additions and 6 deletions

View File

@ -62,11 +62,11 @@
{% elif object.type == 'extended' %}
<td>{{ object.aclextendedrules.count|placeholder }}</td>
{% endif %}
</tr>
<tr>
<th scope="row">Assigned Host</th>
<td>{{ object.assigned_object|linkify }}</td>
</tr>
</tr>
</table>
</div>
</div>
@ -77,7 +77,8 @@
{% include 'inc/panels/comments.html' %}
</div>
</div>
<div class="row">
{% if rules_table %}
<div class="row">
<div class="col col-md-12">
<div class="card">
<h5 class="card-header">{{ object.get_type_display }} Rules</h5>
@ -87,4 +88,5 @@
</div>
</div>
</div>
{% endif %}
{% endblock content %}

View File

@ -53,11 +53,16 @@ class AccessListView(generic.ObjectView):
table = tables.ACLExtendedRuleTable(instance.aclextendedrules.all())
elif instance.type == choices.ACLTypeChoices.TYPE_STANDARD:
table = tables.ACLStandardRuleTable(instance.aclstandardrules.all())
table.configure(request)
else:
table = None
return {
"rules_table": table,
}
if table:
table.configure(request)
return {
"rules_table": table,
}
return {}
class AccessListListView(generic.ObjectListView):