portal/pool: allow adding and removing origin groups

This commit is contained in:
Iain Learmonth 2022-10-08 19:51:56 +01:00
parent a189e8756c
commit 0cc6cf0eda
3 changed files with 90 additions and 7 deletions

View file

@ -11,7 +11,8 @@
</div>
<h3>Groups</h3>
{{ groups_table(pool.groups) }}
<p><a href="{{ url_for("portal.pool.pool_group_add", pool_id=pool.id) }}" class="btn btn-sm btn-success">Add Group</a></p>
{{ groups_table(pool.groups, pool) }}
<h3>Distribution Lists</h3>
{{ mirrorlists_table(pool.lists) }}

View file

@ -175,7 +175,7 @@
</div>
{% endmacro %}
{% macro groups_table(groups) %}
{% macro groups_table(groups, pool=None) %}
<div class="table-responsive">
<table class="table table-striped table-sm">
<thead>
@ -194,7 +194,12 @@
<td>{{ group.description }}</td>
<td>{% if group.eotk %}✅{% else %}❌{% endif %}</td>
<td>{{ group.origins | length }}</td>
<td><a href="{{ url_for("portal.group.group_edit", group_id=group.id) }}" class="btn btn-primary btn-sm">View/Edit</a></td>
<td>
<a href="{{ url_for("portal.group.group_edit", group_id=group.id) }}" class="btn btn-primary btn-sm">View/Edit</a>
{% if pool %}
<a href="{{ url_for("portal.pool.pool_group_remove", pool_id=pool.id, group_id=group.id) }}" class="btn btn-danger btn-sm">Remove</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>