<div class="modal-header">
	<h3 class="modal-title">{{title}}</h3>
</div>
<div class="modal-body">
	<div class="form">
		<div ng-if="message.danger">
			<alert type="danger" >{{message.danger}}</alert>
			<br>
		</div>
		<form name="gitInput" id="gitConf" ng-submit="gitInput.$valid && onSubmit()">
			<div class="form-group">
				<div>
					<label>Select Account: </label>
					<select id="gitAccount"  ng-required="true" ng-options="git._id as git.label for git in gitAccounts" tooltip="Select Account" ng-model="gitAcc" ng-change="selectGitAccount(gitAcc)" ng-disabled="gitSoa">
					</select>
					<br>
					<span class="manualToolTip">Select the Git Account where your swagger file is located.</span>
				</div>
				<br>
				<div ng-show="!hideFilePath">
					<label>FilePath: </label>
					<input type="text" class="form-control"  ng-required="!hideFilePath" ng-model="filepath" placeholder="/swagger.yml" />
					<span class="manualToolTip">Select the file path to your swagger.yml/yaml file in your repository.</span>
				</div>
				<div ng-if="selectedAccount">
					<div ng-if="!gitSoa">
						<div ng-if="repos && repos.length === 0" style="margin-bottom: 10px">
							<alert type="warning">{{translation.noReposFound[LANG]}}</alert>
						</div>
						<fieldset ng-if="selectedAccount.loading">
							<legent style="text-decoration: underline">{{translation.repositories[LANG]}}</legent>
							<br>
							<span class="manualToolTip">Click on a repository to select one.</span>
							<div id="reposListGithub" ng-if="selectedAccount.provider === 'github'">
								<input type="text" class="form-control endpoint-search" ng-model="searchKeyword" placeholder="Search ..." />
								<br>
								<div>
									<ul class="blueListing endpointListing">
										<li class="blueLi row-list gitEndpointSize" id="repo_full_name_{{repo.id}}" ng-repeat="repo in repos | reposSearchFilter:searchKeyword" >
											<a href="" class="" ng-click="!selectRepoBranch(repo)">{{repo.full_name}}</a>
										</li>
									</ul>
								</div>
								<br>
								<a href="" class="loadMoreEndPoint btn btn-block f-left" ng-click="listRepos(selectedAccount, 0, 'loadMore')" ng-if="selectedAccount.allowLoadMore">Load More</a>
							</div>
							
							<div id="reposList" ng-show="selectedAccount.provider === 'bitbucket_enterprise' || selectedAccount.provider === 'bitbucket'">
								<input type="text" class="form-control endpoint-search" ng-model="searchValue"  ng-change="listRepos(selectedAccount, 0, 'loadMore', searchValue)" placeholder="Search ..." />
								<br>
								<div>
									<ul class="blueListing endpointListing">
										<li class="blueLi row-list gitEndpointSize" id="repo_full_name_{{repo.id}}" ng-repeat="repo in repos" >
											<a href="" class="" ng-click="!selectRepoBranch(repo)">{{repo.full_name}}</a>
										</li>
									</ul>
								</div>
								<br>
								<a href="" class="loadMoreEndPoint btn btn-block f-left" ng-click="listRepos(selectedAccount, 0, 'loadMore')" ng-if="selectedAccount.allowLoadMore">Load More</a>
							</div>
						</fieldset>
					</div>
					<div ng-if="gitSoa">
						<br>
						<fieldset>
							<div>
								<em class="f-left" ng-if="selectedAccount"><b>Owner:</b> {{selectedAccount.owner}} </em>
								<br>
								<em class="f-left" ng-if="swaggerRepo"><b>Repository:</b> {{swaggerRepo.owner}} / {{swaggerRepo.name}} </em>
								<br>
								<em class="f-left"> All swagger files should come from the same repository as the soa.json.</em>
							</div>
							
						</fieldset>
						<br>
					</div>
					<div ng-show="selectedAccount.loading && repoBranch">
						<label>Select Branch: </label>
						<select id="repoBranch"  ng-required="true" ng-options="branch.name as branch.name for branch in repoBranch" tooltip="Select Branch" ng-model="selectedBranch" ng-change="selectBranch(selectedBranch)">
						</select>
						<br>
						<span class="manualToolTip">Select the branch where the swagger file is located.</span>
					</div>
				</div>
			</div>
			<div class="c-both w100 t-right">
				<hr />
				<input ng-if="selectedBranch" type="submit" ng-click="submit()" class="btn btn-primary" value="Submit" />
				<button class="btn btn-danger" type="button" ng-click="closeModal()" value="Cancel">Cancel</button>
			</div>
		</form>
	</div>
</div>