<template name="adminFlex">
	<aside class="sidebar-light sidebar--medium" role="navigation">
		<header class="sidebar-flex__header">
			<h1 class="sidebar-flex__title">{{_ "Administration"}}</h1>
			{{#unless embeddedVersion}}
				<button class="sidebar-flex__close-button" data-action="close">
					{{> icon block="sidebar-flex__close-icon" icon="cross"}}
				</button>
			{{/unless}}
		</header>
		<div class="rooms-list {{#if embeddedVersion}}rooms-list--embedded{{/if}}" aria-label="{{_ "Administration"}}">
			<ul class="rooms-list__list">
				{{> sidebarItem menuItem "Info" "info-circled" "admin-info" "" }}

				{{#if hasPermission 'run-import'}}
					{{> sidebarItem menuItem "Import" "import" "admin-import" "" }}
				{{/if}}

				{{#if hasPermission 'view-room-administration'}}
					{{> sidebarItem menuItem "Rooms" "hashtag" "admin-rooms" "" }}
				{{/if}}

				{{#if hasPermission 'view-user-administration'}}
					{{> sidebarItem menuItem "Users" "team" "admin-users" "" }}
				{{/if}}

				{{#each adminBoxOptions}}
					{{#if permissionGranted}}
						{{> sidebarItem menuItem label icon href "" }}
					{{/if}}
				{{/each}}
			</ul>

			{{#if hasPermission 'view-privileged-setting'}}
				<h3 class="rooms-list__type">{{_ "Settings"}}</h3>
				<div class="rc-input sidebar-flex__search">
					<label class="rc-input__label">
						<div class="rc-input__wrapper">
							<div class="rc-input__icon">
								{{> icon block="rc-input__icon-sv" icon="magnifier"}}
							</div>
							<input type="text" class="rc-input__element rc-input__element--small" name="settings-search" placeholder="{{_ 'Search'}}">
						</div>
					</label>
				</div>
				<ul class="rooms-list__list">
					{{#each groups}}
						{{> sidebarItem menuItem label false "admin" _id }}
					{{/each}}
				</ul>
			{{/if}}
		</div>
	</aside>
</template>
