{% if(is_array(@$d['msg'])): foreach($d['msg'] as $m): %}

<article class="message is-small autohide {{ $m['type'] }}">
  <div class="message-header is-rounded">
    <p>{{ $m['title'] }}</p>
    <button class="delete" aria-label="delete"></button>
  </div>
</article>

{% endforeach; endif; %}

<form method="POST" >
{% wp_nonce_field("admin_update_userselect","gal_form_id",false,true) %}
<input type="hidden" name="galene_room" id="galene_room" value="{{ $d['room']}}" >

<p class="panel-heading mb-3">
	{{ __("Edit accesslist of room",'manager-for-galene-videoconference') }}: {{ $d['room_display_name'] }}
</p>


<div class="content">
  <table class="table is-striped is-fullwidth is-narrow is-hoverable" >
	<thead>
		<th class="text-vertical text-bottom is-size-7" >{{ __("Operator",'manager-for-galene-videoconference') }}</th>
		<th class="text-vertical text-bottom is-size-7" >{{ __("Presenter",'manager-for-galene-videoconference') }}</th>
		<th class="text-vertical text-bottom is-size-7" >{{ __("Listener",'manager-for-galene-videoconference') }}</th>
		<th class="text-bottom" >{{ __("Displayname",'manager-for-galene-videoconference') }}</th>
		<th class="text-bottom" >{{ __("Loginname",'manager-for-galene-videoconference') }}</th>
	</thead>
	<tbody>
  {% foreach($d['users'] as $user): if($user['type'] != 0) continue; %}
	<tr>
		<td>
			<div class="field">
			  <input class="is-checkradio is-success is-circle"  
					id="acc[{{ $user['id'] }}][is_operator]"  
					name="acc[{{ $user['id'] }}][is_operator]" 
					type="checkbox" 
					{{ $user['is_operator']? 'checked="checked"' : '' }}  >
			  <label for="acc[{{ $user['id'] }}][is_operator]"></label>
			</div>
		</td>
		<td>
			<div class="field">
			  <input class="is-checkradio is-success is-circle"  
					id="acc[{{ $user['id'] }}][is_presenter]"  
					name="acc[{{ $user['id'] }}][is_presenter]" 
					type="checkbox" 
					{{ $user['is_presenter']? 'checked="checked"' : '' }}  >
			  <label for="acc[{{ $user['id'] }}][is_presenter]"></label>
			</div>
		</td>
		<td>
			<div class="field">
			  <input class="is-checkradio is-success is-circle"  
					id="acc[{{ $user['id'] }}][is_other]"  
					name="acc[{{ $user['id'] }}][is_other]" 
					type="checkbox" 
					{{ $user['is_other']? 'checked="checked"' : '' }}  >
			  <label for="acc[{{ $user['id'] }}][is_other]"></label>
			</div>
		</td>
		<td>{{ $user['displayName'] }}</td>
		<td>{{ $user['login'] }}</td>
	</tr> 
  {% endforeach; %}
	<tr><td colspan="6"><h6 class="is-size-6 my-1 has-text-centered has-text-weight-bold">{{ __("Wordpress Roles",'manager-for-galene-videoconference') }}</h6></td></tr>
  {% foreach($d['users'] as $user): if($user['type'] != 1) continue;%}
	<tr>
		<td>
			<div class="field">
			  <input class="is-checkradio is-success is-circle"  
					id="acc[{{ $user['id'] }}][is_operator]"  
					name="acc[{{ $user['id'] }}][is_operator]" 
					type="checkbox" 
					{{ $user['is_operator']? 'checked="checked"' : '' }}  >
			  <label for="acc[{{ $user['id'] }}][is_operator]"></label>
			</div>
		</td>
		<td>
			<div class="field">
			  <input class="is-checkradio is-success is-circle"  
					id="acc[{{ $user['id'] }}][is_presenter]"  
					name="acc[{{ $user['id'] }}][is_presenter]" 
					type="checkbox" 
					{{ $user['is_presenter']? 'checked="checked"' : '' }}  >
			  <label for="acc[{{ $user['id'] }}][is_presenter]"></label>
			</div>
		</td>
		<td>
			<div class="field">
			  <input class="is-checkradio is-success is-circle"  
					id="acc[{{ $user['id'] }}][is_other]"  
					name="acc[{{ $user['id'] }}][is_other]" 
					type="checkbox" 
					{{ $user['is_other']? 'checked="checked"' : '' }}  >
			  <label for="acc[{{ $user['id'] }}][is_other]"></label>
			</div>
		</td>
		<td>{{ Galmgr_util::translate_wprole($user['displayName']) }}</td>
		<td></td>
	</tr>
  
  {% endforeach; %}
	</tbody>
  </table>
</div>

<div class="field is-grouped is-grouped-right mt-3">
  <p class="control">
	<button class="button is-primary" type="submit" name="galene_action" id="galene_action" value="admin_update_userselect" >
	  {{ __("Save",'manager-for-galene-videoconference') }}
	</button>
  </p>
  <p class="control">
	<a class="button is-light" href="{{ Galmgr_util::add_arg([ 'galene_action' => 'admin_screen_roomedit', 'galene_room' => $d['room'], 'active_tab' => 'privileges-tab', ]) }}#userlist">
	  {{ __("Cancel",'manager-for-galene-videoconference') }}
	</a>
  </p>
</div>


</form>
<div class="preloader">
  <img src="{% echo esc_url(GALMGR_PLUGIN_URL . '/assets/spinner.svg') %}" alt="spinner">
</div>