forked from rc/aircox
cfr #121 Co-authored-by: Christophe Siraut <d@tobald.eu.org> Co-authored-by: bkfox <thomas bkfox net> Co-authored-by: Thomas Kairos <thomas@bkfox.net> Reviewed-on: rc/aircox#131 Co-authored-by: Chris Tactic <ctactic@noreply.git.radiocampus.be> Co-committed-by: Chris Tactic <ctactic@noreply.git.radiocampus.be>
This commit is contained in:
30
aircox/templates/aircox/dashboard/widgets/user_groups.html
Normal file
30
aircox/templates/aircox/dashboard/widgets/user_groups.html
Normal file
@ -0,0 +1,30 @@
|
||||
{% load i18n %}
|
||||
|
||||
<a-modal ref="user-groups-modal">
|
||||
<template #title="{item}">[[ item?.username ]]</template>
|
||||
<template #default="{item}">
|
||||
<a-many-to-many-edit v-if="item" ref="user-groups"
|
||||
:url="'{% url 'api:usergroup-list' %}?user=' + item.id"
|
||||
commit-url="{% url 'api:usergroup-commit' %}"
|
||||
|
||||
:source_id="item.id" source_field="user"
|
||||
target_field="group"
|
||||
:autocomplete="{url:'{% url 'api:group-autocomplete' %}?search=${query}&no_user=' + item.id, 'label-field':'name', 'value-field':'id'}"
|
||||
>
|
||||
<template #items-title>{% translate "Groups" %}</template>
|
||||
|
||||
<template #item="{item}">
|
||||
[[ item.data.group.name ]]
|
||||
</template>
|
||||
|
||||
<template #autocomplete-item="{item}">
|
||||
[[ item.name ]]
|
||||
</template>
|
||||
</a-many-to-many-edit>
|
||||
</template>
|
||||
<template #footer="{item, close}">
|
||||
<button type="button" class="button" @click="$refs['user-groups'].save(); close()">
|
||||
Save
|
||||
</button>
|
||||
</template>
|
||||
</a-modal>
|
Reference in New Issue
Block a user