Works almost
This commit is contained in:
48
abac/templates/rule_detail.html
Normal file
48
abac/templates/rule_detail.html
Normal file
@@ -0,0 +1,48 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<header>
|
||||
<h1>{{ rule.name }}</h1>
|
||||
<p>File Owner: {{ rule.file.owner.username }}</p>
|
||||
<a href="{% url 'abac:file_detail' file_id=rule.file.id %}">Back to {{ rule.file.name }}</a>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
<div class="container">
|
||||
<h2>{{ rule.name }} Details</h2>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Attribute Name</th>
|
||||
<th>Operator</th>
|
||||
<th>Value</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for rule_attribute in rule_attributes %}
|
||||
<tr>
|
||||
<td>{{ rule_attribute.attribute_type.name }}</td>
|
||||
<td>{{ rule_attribute.operator }}</td>
|
||||
<td>{{ rule_attribute.value }}</td>
|
||||
<td>
|
||||
<a href="{% url 'abac:delete_rule_attribute' file_id=file.id rule_id=rule.id rule_attribute_id=rule_attribute.id %}" class="btn btn-danger">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<!-- Form to add new RuleAttribute -->
|
||||
<form method="post" action="{% url 'abac:rule_detail' file_id=file.id rule_id=rule.id %}">
|
||||
{% csrf_token %}
|
||||
<td>{{ form.attribute_type }}</td>
|
||||
<td>{{ form.operator }}</td>
|
||||
<td>{{ form.value }}</td>
|
||||
<td><input type="submit" class="btn btn-success" value="Add"></td>
|
||||
</form>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user