2023-05-02 02:22:10 +02:00
@ css ( / static / node_modules / tom - select / dist / css / tom - select . min . css )
@ js ( / static / node_modules / tom - select / dist / js / tom - select . base . min . js )
2023-04-16 03:31:40 +02:00
@ js ( js / communities / community_members . js )
@ extends ( templates / layout_normal )
@ section ( main )
2023-05-01 19:18:48 +02:00
< h2 >
< a href = " <?= Container:: $routeCollection->getRoute ('community')->generateLink(['communityId' => $community->getId ()]) ?> " >< ? = $community -> getName () ?> </a> »
2023-05-01 23:37:30 +02:00
< a href = " <?= Container:: $routeCollection->getRoute ('community.settings')->generateLink(['communityId' => $community->getId ()]) ?> " > Settings </ a > »
2023-05-01 19:18:48 +02:00
Edit members
</ h2 >
< div class = " box compactBox " >
2023-04-16 03:31:40 +02:00
< 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 >
2023-04-23 15:55:31 +02:00
< td >
2023-05-02 00:02:38 +02:00
< form id = " editMember_<?= $member->getId () ?> " action = " <?= Container:: $routeCollection->getRoute ('community.members.edit-action')->generateLink(['communityId' => $community->getId (), 'community_member_id' => $member->getId ()]) ?> " method = " post " data - reload - on - success = " true " data - observe - inputs = " owner " ></ form >
< form id = " deleteMember_<?= $member->getId () ?> " action = " <?= Container:: $routeCollection->getRoute ('community.members.delete-action')->generateLink(['communityId' => $community->getId (), 'community_member_id' => $member->getId ()]) ?> " method = " post " data - reload - on - success = " true " ></ form >
2023-04-23 15:55:31 +02:00
< ? = $member -> getUser () -> getDisplayName () ?>
</ td >
< td style = " text-align: center; " >
< input type = " checkbox " form = " editMember_<?= $member->getId () ?> " name = " owner " < ? = $member -> getOwner () ? 'checked' : '' ?> <?= !$editable ? 'disabled' : '' ?> />
</ td >
< td style = " text-align: right; " >
< ? php if ( $editable ) : ?>
2023-05-02 01:03:39 +02:00
< button type = " submit " form = " editMember_<?= $member->getId () ?> " name = " submit_button " class = " small marginRight " disabled > Save </ button ><!--
-->< button type = " submit " form = " deleteMember_<?= $member->getId () ?> " name = " submit_button " data - confirmation = " Are you sure you want to delete this member? " class = " small red " > Delete </ button >
2023-04-23 15:55:31 +02:00
< ? php endif ; ?>
</ td >
2023-04-16 03:31:40 +02:00
</ tr >
< ? php endforeach ; ?>
< tr >
2023-04-23 15:55:31 +02:00
< td >
2023-05-02 00:02:38 +02:00
< form id = " newMember " action = " <?= Container:: $routeCollection->getRoute ('community.members.new-action')->generateLink(['communityId' => $community->getId ()]) ?> " method = " post " data - reload - on - success = " true " data - observe - inputs = " user_id " ></ form >
2023-04-23 15:55:31 +02:00
< select type = " text " form = " newMember " name = " user_id " >
</ td >
< td style = " text-align: center; " >
2023-04-23 19:59:48 +02:00
< input type = " checkbox " form = " newMember " name = " owner " />
2023-04-23 15:55:31 +02:00
</ td >
< td style = " text-align: right; " >
2023-05-02 01:03:39 +02:00
< button type = " submit " form = " newMember " name = " submit_button " class = " small " disabled > Add </ button >
2023-04-23 15:55:31 +02:00
</ td >
2023-04-16 03:31:40 +02:00
</ tr >
</ table >
2023-04-23 20:19:38 +02:00
< p class = " formError justify marginTop " ></ p >
2023-04-16 03:31:40 +02:00
</ div >
@ endsection
@ section ( pageScript )
< script >
2023-04-16 20:54:29 +02:00
var searchUserUrl = '<?= Container::$routeCollection->getRoute(' searchUser ')->generateLink([' q ' => ' QUERY ']) ?>' ;
2023-04-16 03:31:40 +02:00
</ script >
@ endsection