{{#section/base-editor document=document folder=folder page=page busy=waiting tip="Gemini enterprise issue and ticketing software (https://www.countersoft.com)" isDirty=(action 'isDirty') onCancel=(action 'onCancel') onAction=(action 'onAction')}}

<div class="row">
	<div class="col-6">
		<div class="form-group">
			<label for="gemini-url">Gemini URL</label>
			{{focus-input id="gemini-url" type="text" value=config.url class="form-control"}}
			<small class="form-text text-muted">e.g. http://helpdesk.countersoft.com</small>
		</div>
		<div class="form-group">
			<label>Username</label>
			{{input id="gemini-username" type="text" value=config.username class="form-control"}}
			<small class="form-text text-muted">Gemini Username</small>
		</div>
		<div class="form-group">
			<label for="gemini-apikey">API Key</label>
			{{input id="gemini-apikey" type="password" value=config.APIKey class="form-control"}}
			<small class="form-text text-muted">Gemini user API key (from user profile)</small>
		</div>
		<div class="btn btn-primary" {{action 'auth'}}>Authenticate</div>
	</div>

	<div class="col-6">
		{{#if authenticated}}
			<div class="form-group">
				<label>Select Gemini workspace</label>
				<ul class="section-gemini-workspaces">
					{{#each workspaces as |card|}}
						<li class="section-gemini-workspace" title="{{card.Title}}" data-toggle="tooltip" data-placement="top" id="gemini-workspace-{{card.Id}}">
							<div class="section-gemini-card" style="background-color:{{card.Color}};" {{action 'onWorkspaceChange' card.Id}}>{{card.Key}}</div>
							{{#if card.selected}}
								<div class="section-gemini-selected-card">&#10003;</div>
							{{/if}}
						</li>
					{{/each}}
				</ul>
			</div>
		{{/if}}
	</div>
</div>

{{/section/base-editor}}
