rvr-nextgen/views/communities/community_members.php

42 lines
2.1 KiB
PHP
Raw Normal View History

2023-04-16 03:31:40 +02:00
@css(node_modules/choices.js/public/assets/styles/choices.min.css)
@js(node_modules/choices.js/public/assets/scripts/choices.js)
@js(js/communities/community_members.js)
@extends(templates/layout_normal)
@section(main)
<h2><?= $community->getName() ?> - Edit members</h2>
<div class="box">
<table class="fullWidth">
<thead>
<tr>
<th style="width: 50%;"></th>
<th style="width: 25%; text-align: center;">Owner</th>
<th style="width: 25%;"></th>
</tr>
</thead>
<?php foreach ($members as $member): ?>
<?php $editable = $member->getUserId() !== Container::$request->user()->getUniqueId(); ?>
<tr>
<td><?= $member->getUser()->getDisplayName() ?></td>
<td style="text-align: center;"><input type="checkbox" class="member_owner" data-id="<?= $member->getId() ?>" <?= $member->getOwner() ? 'checked' : '' ?> <?= !$editable ? 'disabled' : '' ?> /></td>
<td style="text-align: right;"><button type="button" class="small red delete_member" data-id="<?= $member->getId() ?>" <?= !$editable ? 'disabled' : '' ?>>Delete</button></td>
</tr>
<?php endforeach; ?>
<tr>
<td><select type="text" id="new_member_user_id"></td>
<td></td>
<td style="text-align: right;"><button type="button" class="small" id="new_member_button" disabled>Add</button></td>
</tr>
</table>
</div>
@endsection
@section(pageScript)
<script>
var newMemberUrl = '/<?= Container::$routeCollection->getRoute('community-members-new')->generateLink(['communityId' => $community->getId()]) ?>';
var editMemberUrl = '/<?= Container::$routeCollection->getRoute('community-members-edit')->generateLink(['communityId' => $community->getId()]) ?>';
var deleteMemberUrl = '/<?= Container::$routeCollection->getRoute('community-members-delete')->generateLink(['communityId' => $community->getId()]) ?>';
</script>
@endsection