<page-header model="ctrl.navModel"></page-header>

<div class="page-container page-body" ng-cloak>

	<h2 class="page-sub-heading">Invite User</h2>

	<div class="p-b-2">
		Send invite or add existing Grafana user to the organization
		<span class="highlight-word">{{contextSrv.user.orgName}}</span>
	</div>

	<form name="ctrl.inviteForm">
		<div class="gf-form-group">
			<div class="gf-form max-width-30">
				<span class="gf-form-label width-10">Email or Username</span>
				<input type="text" ng-model="ctrl.invite.loginOrEmail" required class="gf-form-input" placeholder="email@test.com">
			</div>
			<div class="gf-form max-width-30">
				<span class="gf-form-label width-10">Name</span>
				<input type="text" ng-model="ctrl.invite.name" class="gf-form-input" placeholder="name (optional)">
			</div>
			<div class="gf-form max-width-30">
        <span class="gf-form-label width-10">Role</span>
				<select ng-model="ctrl.invite.role" class="gf-form-input" ng-options="f for f in ['Viewer', 'Editor', 'Admin']">
				</select>
			</div>

			<gf-form-switch class="gf-form" label="Send invite email" checked="ctrl.invite.sendEmail" label-class="width-10"></gf-form-switch>

			<div class="gf-form-button-row">
				<button type="submit" class="btn btn-primary" ng-click="ctrl.sendInvite();">Invite</button>
				<a class="btn btn-inverse" href="org/users">Back</a>
			</div>
	</form>
</div>
