<div class="modal-header">
	<h3 class="modal-title" ng-hide="userId" >{{ 'tlcTitle' | translate }}</h3>
	<h3 class="modal-title" ng-show="userId" translate="tlcTitleUser" translate-compile translate-values="targetUser"></h3>
</div>

<form name="tlCreate" class="form-horizontal" role="form" ng-submit="submit()" novalidate>

	<div class="panel panel-default">
		<div class="panel-body">
			<div class="col-md-12">
				<div class="list-group-item">
					<i class="fa fa-info-circle" aria-hidden="true"></i><span class="info-span"><b>{{ 'tlcWarningInfoMessage' | translate }}</b></span>
				</div>
				<div class="list-group-item">
					<i class="fa fa-info-circle" aria-hidden="true"></i><span class="info-span"><b>{{ 'tlcToleranceInfoMessage' | translate }}</b></span>
				</div>
			</div>
		</div>
	</div>

	<div class="modal-body">

		<div class="form-group" bs-has-error>
			<label for="usernameInput" class="col-sm-3 control-label">{{ 'tlcTransactionType' | translate }}</label>
			<div class="col-sm-9">
				<select class="form-control" ng-model="typeCode" ng-required="true" required name="typeCode">
					<option value="" disabled selected>{{ 'tlcTransactionTypePlaceHolder' | translate }}</option>
					<option value="{{ type.code }}" ng-repeat="type in transactionTypes">{{ type.code }} - {{ type.name }}</option>
				</select>
			</div>
		</div>
		
		<div class="form-group" ng-show="getShowParameter(typeCode)">
			<label for="parameterInput" class="col-sm-3 control-label">{{ 'tlcParameter' | translate }}</label>
			<div class="col-sm-9">
				<select class="form-control" ng-model="parameter" ng-required="true">
					<option value="{{ plan.id }}" ng-repeat="plan in plans">{{ plan.name }}</option>
				</select>
			</div>
		</div>

		<div class="form-group" bs-has-error>
			<label for="limitInput" class="col-sm-3 control-label">{{ 'tlcLimit' | translate }}</label>
			<div class="col-sm-9">
				<input type="number" class="form-control" id="limitInput" min="0" max="2147483647" ng-model="limit" name="limit" placeholder="{{ 'tlcLimitPlaceHolder' | translate }}" />
				<span class="has-error control-label" ng-show="tlCreate.limit.$error.min || tlCreate.limit.$error.max"><i class="fa fa-exclamation-circle" aria-hidden="true" title="{{ 'tlcLimitValidation' | translate }}"></i> {{ 'tlcLimitValidation' | translate }}</span>
			</div>
		</div>

		<div class="form-group" bs-has-error>
			<label for="warningInput" class="col-sm-3 control-label"><span class="fa fa-question-circle" aria-hidden="true" ng-required="true" required tooltip="{{ 'tlcWarningInfoAltMessage' | translate }}"></span> <span>{{ 'tlcWarning' | translate }}</span></label>
			<div class="col-sm-9">
				<div class="input-group">
					<input type="number" class="form-control" id="warningInput" min="0" max="100" ng-model="warning" name="warning" placeholder="{{ 'tlcWarningPlaceHolder' | translate }}" />
					<div class="input-group-addon">%</div>
				</div>
				<span class="has-error control-label" ng-show="tlCreate.warning.$error.min || tlCreate.warning.$error.max"><i class="fa fa-exclamation-circle" aria-hidden="true" title="{{ 'tlcWarningMinMaxValidation' | translate }}"></i> {{ 'tlcWarningMinMaxValidation' | translate }}</span>
			</div>
		</div>

		<div class="form-group" bs-has-error>
			<label for="toleranceInput" class="col-sm-3 control-label"><span class="fa fa-question-circle" aria-hidden="true" tooltip="{{ 'tlcToleranceInfoAltMessage' | translate }}"></span> <span>{{ 'tlcTolerance' | translate }}</span></label>
			<div class="col-sm-9">
				<div class="input-group">
					<input type="number" class="form-control" id="toleranceInput" min="0" ng-model="tolerance" name="tolerance" placeholder="{{ 'tlcTolerancePlaceHolder' | translate }}" />
					<div class="input-group-addon">%</div>
				</div>
				<span class="has-error control-label" ng-show="tlCreate.tolerance.$error.min"><i class="fa fa-exclamation-circle" aria-hidden="true" title="{{ 'tlcToleranceMinValidation' | translate }}"></i> {{ 'tlcToleranceMinValidation' | translate }}</span>
			</div>
		</div>
	</div>

	<div class="panel panel-default" ng-show="limit != null && tlCreate.warning.$valid && tlCreate.tolerance.$valid">
		<div class="panel-body">
			<div class="form-group">
				<div class="col-md-12">
					<div ng-show="warning != null" class="list-group-item alert-warning">
						<span class="badge">{{ warning/100 * limit | number:0 }}</span> <span ng-bind-html="'tlcWarningHelper' | translate"></span>
					</div>
					<div ng-show="warning == null" class="list-group-item alert-warning">
						<span ng-bind-html="'tlcNoWarningWillBeSent' | translate"></span>
					</div>
					<div ng-show="tolerance == null" class="list-group-item alert-warning">
						<span ng-bind-html="'tlcNoBlockedTransactions' | translate"></span>
					</div>
					<div ng-show="tolerance != null" class="list-group-item alert-warning">
						<span class="badge">{{ (tolerance/100 * limit) + limit | number:0 }}</span><span ng-bind-html="'tlcToleranceHelper' | translate"></span>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="panel panel-default" ng-show="limit == null && tlCreate.limit.$valid">
		<div class="panel-body">
			<div class="form-group">
				<div class="col-md-12">
					<div class="list-group-item alert-warning">
						<span ng-bind-html="'tlcNoLimitIsSet' | translate"></span>
					</div>
				</div>
			</div>
		</div>
	</div>

	<div class="modal-footer">
		<button type="submit" class="btn btn-success">{{ 'create' | translate }}</button>
		<button type="button" class="btn btn-default" ng-click="cancel()">{{ 'cancel' | translate }}</button>
	</div>
</form>

