@section('header')
	@include('common.header')
@stop

@section('content')


<style>

</style>

	<div id="task_page" ng-controller="TasksPageCtrl">
		<span ng-init="subtypes = {{ $subtypes }}"></span>
		<span ng-init="users = {{ $users }}"></span>
		<span ng-init="severities = {{ $severities }}"></span>
		<span ng-init="statuses = {{ $statuses }}"></span>
		<span ng-init="types = {{ $types }}"></span>

		<div class="row col-sm-12">
			<div id="grid_sidebar" class="col-sm-3 form-horizontal">
                
                {{-- ng repeat builds all select inputs --}}
				<div id="select_section" class="form-group">
					{{-- form styling from http://codepen.io/jaycbrf/pen/iBszr/ --}}

					<div class="row" ng-repeat="input in selectInputs track by $index">
						<label class="col-sm-2 control-label">{[{ input.label }]}</label>
						<div class="col-sm-10 inputGroupContainer">
							<div class="input-group">
								<span class="input-group-addon"><i class="fa {[{ input.icon }]}"></i></span>
								<div class="select_box" ng-class="{ 'col-sm-10': selections[input.model], 'col-sm-12' : !selections[input.model] }">
									<select class="form-control"
                                            ng-class="{ 'not-empty': selections[input.model], 'empty' : !selections[input.model] }"
                                            ng-model="selections[input.model]" 
                                            ng-options="item.id as item.name for item in input.values track by item.id">
                                        <option value="" ng-selected="!input.model" ng-hide="input.model">all</option>
									</select>
								</div>
								<a href="#" class="reset-btn" ng-click="resetSingleSelect( input.model )" ng-show="selections[input.model]">
                                    <label class="col-sm-1 control-label">
                                        <i class="fa fa-times"></i>
                                    </label>
                                </a>
							</div>
						</div>
					</div>
                </div>

                {{-- ng repeat builds pairs of radios --}}
                <div id="checkbox_section" class="form-group">

                    <div class="row" ng-repeat="input in radioInputs track by $index">
                        <div class="col-sm-10 col-sm-offset-2">
                            <div class="input-group">
                                <span id="money" class="input-group-addon"><i class="fa {[{ radioInputs[$index].icon }]}"></i></span>
                                <div class="col-sm-12 radio_collection">
                                    <div class="col-sm-4 radio_container empty" ng-class="{ 'radio_selected': selections[radioInputs[$index].model]== 0 }">
                                        <label class="col-sm-5">{[{ radioInputs[$index].labelOne }]}</label>
                                        <input type="radio" ng-model=" selections[radioInputs[$index].model] " ng-value="0" ng-checked="true">

                                    </div>

                                    <div class="col-sm-4 radio_container empty" ng-class="{ 'not-empty': selections[radioInputs[$index].model]== 1 }">
                                        <label class="col-sm-5">{[{ radioInputs[$index].labelTwo }]}</label>
                                        <input type="radio" ng-model=" selections[radioInputs[$index].model] " ng-value="1">

                                    </div>

                                    <div class="col-sm-4 radio_container empty"ng-class="{ 'radio_selected': selections[radioInputs[$index].model]== 2 }">
                                        <label class="col-sm-5">{[{ radioInputs[$index].labelThree }]}</label>
                                        <input type="radio" ng-model=" selections[radioInputs[$index].model] " ng-value="2">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-sm-10 col-sm-offset-2 inputGroupContainer">
                            <div class="input-group check_box">
                                <div class="col-sm-6 col-sm-offset-1">
                                    <label class="col-sm-8 col-sm-offset-1">Invoiced</label>
                                    <input type="checkbox" ng-model="selections.invoiced" ng-true-value="1" ng-false-value="0">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                    
                <div id="text_section" class="form-group">
                    <div class="row">
                        <label class="col-sm-2 control-label">Text Search</label>
                        <div class="col-sm-10 inputGroupContainer">
                            <div class="input-group text_input">
                                <div class="col-sm-10 text_input">
                                    <input class="form-control" type="text" ng-model-options='{ debounce: 750 }' ng-model="selections.textSearch" />
                                </div>							
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <label class="col-sm-2 control-label" style="padding-top: 0">Client Search</label>
                        <div class="col-sm-10 inputGroupContainer">
                            <div class="input-group">
                                <ui-select class="col-sm-12 text_input" 
                                           ng-model="clientSelectionModel"
                                           on-select="onClientSelected( $item, $select )"
                                           ng-disabled="selections.customerId"
                                           reset-search-input="true">
                                    <ui-select-match placeholder="Search for clients" allow-clear="true">{[{ $select.selected.name }]}
                                    </ui-select-match>
                                    <ui-select-choices refresh="searchMediaClient($select)" refresh-delay="300" repeat="searchRes in searchRes">
                                        <span ng-bind-html="searchRes.name"></span>
                                    </ui-select-choices>
                                </ui-select>
                            </div>
                        </div>
                    </div>

                    <div style="text-align: center; margin-bottom: 15px; font-weight: 900;">or</div>

                    <div class="row">
                        <label class="col-sm-2 control-label" style="padding-top: 0">Customer Search</label>
                        <div class="col-sm-10 inputGroupContainer">
                            <div class="input-group">
                                <ui-select class="col-sm-12 text_input"
                                           ng-model="custSelectionModel"
                                           on-select="onCustomerSelected( $item, $select )"
                                           ng-disabled="selections.clientId">
                                    <ui-select-match placeholder="Search for customers" allow-clear="true">{[{ $select.selected.name }]}
                                    </ui-select-match>
                                    <ui-select-choices refresh="searchMediaCustomer($select)" refresh-delay="300" repeat="searchRes in searchRes">
                                        <span ng-bind-html="searchRes.name"></span>
                                    </ui-select-choices>
                                </ui-select>
                            </div>
                        </div>
                    </div>
                    


            
               </div>



					{{-- range to add to V2 --}}
					{{--<div class="row form-group">--}}
						{{--<label class="col-sm-2 control-label">Range</label>--}}
						{{--<div class="col-sm-10 inputGroupContainer">--}}

							{{--<div class="row">--}}
								{{--<div class="col-sm-6">--}}
									{{--<div class="col-sm-12">--}}
										{{--<span class="input-group-addon col-sm-1"><i class="glyphicon fa-flag-o"></i></span>--}}
										{{--<div class="col-sm-8">--}}
											{{--<input placeholder="From" class="form-control"  type="number" ng-model="selections.min">--}}
										{{--</div>--}}
										{{--<div class="col-sm-2">--}}
											{{--<a href="#" class="reset-btn" ng-click=" resetGeneric( false, 'min') " ng-show="selections.min"><label class="col-sm-1 control-label"><i class="fa fa-times"></i></label></a>--}}
										{{--</div>--}}
									{{--</div>--}}
								{{--</div>--}}
								{{--<div class="col-sm-6">--}}
									{{--<div class="col-sm-12">--}}
										{{--<span class="input-group-addon col-sm-1"><i class="glyphicon fa-flag"></i></span>--}}
										{{--<div class="col-sm-8">--}}
											{{--<input placeholder="To" class="form-control"  type="number" ng-model="selections.max">--}}
										{{--</div>--}}
										{{--<div class="col-sm-2">--}}
											{{--<a href="#" class="reset-btn" ng-click=" resetGeneric( false, 'max') " ng-show="selections.max"><label class="col-sm-1 control-label"><i class="fa fa-times"></i></label></a>--}}
										{{--</div>--}}
									{{--</div>--}}
								{{--</div>--}}
							{{--</div>--}}
								{{----}}
								{{--<div class="col-sm-5">--}}
									{{--<div class="input-group">--}}
										{{--<span class="input-group-addon"><i class="glyphicon fa-flag-checkered"></i></span>--}}
										{{--<input placeholder="To" class="form-control"  type="text">--}}
									{{--</div>--}}
								{{--</div>--}}
						{{--</div>--}}
					{{--</div>--}}

					<div id="grid_controls" class="row form-group">
						<div class="col-sm-12">
							<button id="tasks_reset_button" class="btn btn-warning" ng-click=" resetAll() ">Reset</button>
                        </div>
					</div>
			

				{{-- Results: possibly another V2 feature --}}
				{{--<div id="grid_results" class="col-sm-12 form-horizontal">--}}

					{{--<h4 class="">Results</h4>--}}

					{{--<div class="form-group row">--}}
						{{--<label class="col-sm-3 control-label">User  : </label>--}}
						{{--<div class="col-md-9 inputGroupContainer">--}}
							{{--<div class="input-group">--}}
								{{--<div>{[{ getUsername(user) }]}</div>--}}
							{{--</div>--}}
						{{--</div>--}}
					{{--</div>--}}
					{{--<div class="form-group row">--}}
						{{--<label class="col-sm-3 control-label">Type  : </label>--}}
							{{--<div class="col-md-9 inputGroupContainer">--}}
								{{--<div class="input-group">--}}
							{{--<div>{[{ type }]}</div>--}}
						{{--</div>--}}
					{{--</div>--}}
					{{--</div>--}}
					{{--<div class="form-group row">--}}
						{{--<label class="col-sm-3 control-label">Subtype  : </label>--}}
						{{--<div class="col-sm-9 inputGroupContainer">--}}
							{{--<div class="input-group">--}}
								{{--<div>{[{ subtype }]}</div>--}}
							{{--</div>--}}
						{{--</div>--}}
					{{--</div>--}}
					{{--<div class="form-group row">--}}
						{{--<label class="col-sm-3 control-label">Status  : </label>--}}
						{{--<div class="col-sm-9 inputGroupContainer">--}}
							{{--<div class="input-group">--}}
								{{--<div>{[{ status }]}</div>--}}
							{{--</div>--}}
						{{--</div>--}}
					{{--</div>--}}
					{{--<div class="form-group row">--}}
						{{--<label class="col-sm-3 control-label">Severity  : </label>--}}
						{{--<div class="col-sm-9 inputGroupContainer">--}}
							{{--<div class="input-group">--}}
								{{--<div>{[{ severity }]}</div>--}}
							{{--</div>--}}
						{{--</div>--}}
					{{--</div>--}}

				{{--</div>--}}
            </div>
			<div id="grid_container" class="col-sm-9 my_grid" >
				{{--<div id="grid1" ui-grid-pagination ui-grid-selection ui-grid-cellNav ui-grid-pinning ui-grid="gridOptions" ui-grid-paginationclass="my_grid" NOTUSEDui-grid="{ data: tasks }"></div>--}}
				<div id="grid1" ui-grid-pagination ui-grid-selection ui-grid="gridOptions" ui-grid-paginationclass="my_grid" NOTUSEDui-grid="{ data: tasks }" ui-grid-edit ui-grid-resize-columns></div>
			</div>
		</div>

	<script>

	</script>




@stop
