<div class="row page-titles no-print">
    <div class="col-md-6 col-8 align-self-center">
        <h3 class="text-themecolor m-b-0 m-t-0">{{phrase.std_cat}}</h3>
    </div>
    <div class="col-md-6 col-4 align-self-center">

    </div>
</div>

<div class="row" ng-show="views.list">
	<div class="col-12">
		<div class="card">
			<div class="card-block">
				<button ng-click="changeView('add')" class="btn pull-right btn-success card-block-input-item">{{phrase.add_cat}}</button>
				<div class="pull-right card-block-input-group card-block-input-item">
					<div class="input-group input-group-sm">
						<input type="text" name="table_search" ng-model="searchText" placeholder="{{phrase.Search}}" class="form-control input-sm">
						<span class="input-group-addon"><i class="fa fa-search"></i></span>
					</div>
				</div>
				<h4 class="card-title">{{phrase.list_std_cat}}</h4>
				<div class="table-responsive">

					<table class="table table-bordered table-hover">
						<tbody>
							<tr>
								<th>{{phrase.catTitle}}</th>
								<th>{{phrase.catDesc}}</th>
								<th style="width:160px;" >{{phrase.Operations}}</th>
							</tr>
							<tr ng-repeat="student_categories_one in student_categories | filter:searchText">
								<td>{{student_categories_one.cat_title}}</td>
								<td>{{student_categories_one.cat_desc}}</td>
								<td>
									<button ng-click="edit(student_categories_one.id)" type="button" class="btn btn-info btn-circle" title="{{phrase.Edit}}" tooltip><i class="fa fa-pencil"></i></button>
									<button ng-click="remove(student_categories_one,$index)" type="button" class="btn btn-danger btn-circle" title="{{phrase.Remove}}" tooltip><i class="fa fa-trash-o"></i></button>
								</td>
							</tr>
							<tr ng-show="!student_categories.length"><td class="noTableData" colspan="3">{{phrase.noDataAvailable}}</td></tr>
						</tbody>
					</table>
					

				</div>
			</div>
		</div>
	</div>
</div>

<div class="row" ng-show="views.add">
	<div class="col-12">
		<div class="card">
			<div class="card-block">
				<button ng-click="changeView('list')" class="btn btn-danger btn-flat pull-right card-block-input-item">{{phrase.cancelAdd}}</button>
				<h4 class="card-title">{{phrase.add_cat}}</h4>
				<div>

					<form class="form-horizontal" name="student_categories_add_form" role="form" ng-submit="saveAdd()" novalidate>
						<div class="form-group row" ng-class="{'has-error': student_categories_add_form.cat_title.$invalid}">
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.catTitle}} *</label>
							<div class="col-sm-10">
								<input type="text" name="cat_title" ng-model="form.cat_title" class="form-control" placeholder="{{phrase.catTitle}}" required>
							</div>
						</div>
						<div class="form-group row" >
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.catDesc}} </label>
							<div class="col-sm-10">
								<textarea name="cat_desc" class="form-control" ng-model="form.cat_desc" placeholder="{{phrase.catDesc}}" ></textarea>
							</div>
						</div>
						<div class="form-group m-b-0">
							<div class="offset-sm-2 col-sm-10">
								<button type="submit" class="btn btn-info waves-effect waves-light" ng-disabled="student_categories_add_form.$invalid">{{phrase.add_cat}}</button>
							</div>
						</div>
					</form>

				</div>
			</div>
		</div>
	</div>
</div>

<div class="row" ng-show="views.edit">
	<div class="col-12">
		<div class="card">
			<div class="card-block">
				<button ng-click="changeView('list')" class="btn btn-danger btn-flat pull-right card-block-input-item">{{phrase.cancelEdit}}</button>
				<h4 class="card-title">{{phrase.edit_cat}}</h4>
				<div>

					<form class="form-horizontal" name="student_categories_edit_form" role="form" ng-submit="saveEdit()" novalidate>
                    						<div class="form-group row" ng-class="{'has-error': student_categories_edit_form.cat_title.$invalid}">
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.catTitle}} *</label>
							<div class="col-sm-10">
								<input type="text" name="cat_title" ng-model="form.cat_title" class="form-control" placeholder="{{phrase.catTitle}}" required>
							</div>
						</div>
						<div class="form-group row" >
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.catDesc}} </label>
							<div class="col-sm-10">
								<textarea name="cat_desc" class="form-control" ng-model="form.cat_desc" placeholder="{{phrase.catDesc}}" ></textarea>
							</div>
						</div>
						<div class="form-group m-b-0">
							<div class="offset-sm-2 col-sm-10">
								<button type="submit" class="btn btn-info waves-effect waves-light" ng-disabled="student_categories_edit_form.$invalid">{{phrase.edit_cat}}</button>
							</div>
						</div>
					</form>

				</div>
			</div>
		</div>
	</div>
</div>
