<ol class="breadcrumb">
	<li><a href="#/">Dashboard</a></li>
	<li>Settings</li>
	<li><a href="#/tags">Tags</a></li>
	<li class="active">{{vm.action}} Tag</li>
</ol>

<div class="container-fluid">
	<div class="row">
		<div class="col-md-12">
			<form name="form" class="form-horizontal" ng-submit="vm._save(vm.tag)" novalidate>
				<input type="hidden" ng-if="vm.action == 'Edit'" name="id" id="id" ng-model="vm.tag.id">
				<div class="panel panel-midnightblue">
					<div class="panel-heading">
						<h2>{{vm.action}} Tag</h2>
					</div>
					<div class="panel-body">
						<p>Fields with <span style="color: #cc0000;">*</span> are required.</p>
						<div class="form-group">
							<label for="name" class="col-sm-2 control-label">Name <span style="color: #cc0000;">*</span></label>
							<div class="col-sm-8">
								<input type="text" class="form-control" name="name" id="name" ng-model="vm.tag.name" ng-required="true" ng-minlength="3">
								<p class="help-block" ng-show="form.name.$touched && form.name.$error.required">Value is required.</p>
								<p class="help-block" ng-show="form.name.$touched && form.name.$error.minlength">Value is too short.</p>
							</div>
						</div>
						<div class="form-group">
							<label for="color" class="col-sm-2 control-label">Color <span style="color: #cc0000;">*</span></label>
							<div class="col-sm-8">
								<div class="input-group">							
									<span class="input-group-addon">
										<i class="ti ti-paint-bucket"></i>
									</span>
									<input type="text" data-colorpicker class="form-control cpicker" name="color" id="color" data-color-format="hex" ng-model="vm.tag.color" ng-required="true">
								</div>
								<p class="help-block" ng-show="form.color.$touched && form.color.$error.required">Value is required.</p>
							</div>
						</div>
					</div>
					<div class="panel-footer">
						<div class="row">
							<div class="col-sm-8 col-sm-offset-2">
								<button type="submit" ng-disabled="!form.$valid" class="btn-primary btn">Save</button>
								<a href="#/tags" class="btn-default btn">Cancel</a>
							</div>
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
