<!--- Edit Task -->
<div class="panel-body form-horizontal">
    <form id="{{edit.listPrefix}}-task-edit-{{edit.unique_id}}" class="form-horizontal" name="taskForm">
        <div class="form-group row">
            <label for="" class="col-form-label col-md-2 col-sm-2" lmsg="projects.task.edit.task_name">[Task Name]</label>

            <div class="col-md-10 col-sm-10">
                <input type="text" class="form-control" maxlength="255" placeholder="Task Name" ng-model="edit.task.editCopy.title">
				<div ng-show="edit.task.editCopy.title.length > 255">
					<br>
					<div class="alert alert-warning">
						<lmsg src="projects.warning.field_longer_than_255">[Length warning]</lmsg>
					</div>
				</div>
            </div>
        </div>
        <div class="form-group row">
            <label for="{{edit.listPrefix}}user-picker-{{edit.unique_id}}-inner" class="col-form-label col-md-2 col-sm-2" name="projects:task:assigned_to" lmsg="projects.task.assigned_to">[Assigned to]</label>

            <div class="col-md-4 col-sm-4 xform-inline">
                <cla-user-picker select_id="{{edit.listPrefix}}user-picker-{{edit.unique_id}}" ng-model="edit.task.editCopy.assignees" project_id="{{edit.task.project_id}}" allow_unset="0" control="edit.userControl"></cla-user-picker>
            </div>
            <label for="{{edit.listPrefix}}due_date-{{edit.unique_id}}-inner" class="col-form-label col-md-2 col-sm-2" lmsg="projects.task.properties.due_date">[Due date]</label>

            <div class="col-md-4 col-sm-4">
                <cla-date-picker id="{{edit.listPrefix}}due_date-{{edit.unique_id}}" ng-model="edit.task.editCopy.due_date" control="edit.task.control"></cla-date-picker>
            </div>
        </div>
        <div class="form-group row">
            <label for="priority-{{edit.unique_id}}" class="col-form-label col-md-2 col-sm-2" lmsg="projects.task.properties.priority">[Priority]</label>

            <div class="col-md-2 col-sm-2">
                <select name="priority" ng-model="edit.task.editCopy.priority" class="form-control js-task-priorities js-priority-{{edit.unique_id}}">
                    <option value="0" lmsg="projects.task.priority.none">[No priority]</option>
                    <option value="1" lmsg="projects.task.priority.low">[Low priority]</option>
                    <option value="2" lmsg="projects.task.priority.medium">[Medium priority]</option>
                    <option value="3" lmsg="projects.task.priority.high">[High priority]</option>
                </select>
            </div>
			<div class="col-md-2 col-sm-2" ng-if="edit.task.project_id == 0"></div>
            <div class="col-md-2 col-sm-4" ng-if="edit.task.project_id > 0">
                <div class="checkbox btn btn-secondary">
                    <label for="private-{{edit.unique_id}}">
                        <input type="checkbox" id="private-{{edit.unique_id}}" ng-model="edit.task.editCopy.is_private">
                        <ion-icon name="lock-closed-outline"></ion-icon>
                        <lmsg src="projects.task.properties.is_private">[Private Task]</lmsg>
                    </label>
                </div>
            </div>
            <label for="duration-{{edit.unique_id}}" class="col-md-2 col-sm-2 col-form-label" lmsg="projects.task.expected_duration">
                [expected duration]
            </label>
            <div class="col-md-1 col-sm-1 ">
                <input type="text" name="duration" id="duration-{{edit.unique_id}}" class="form-control" size="2" ng-model="edit.task.editCopy.duration" ng-pattern="/^$|^(0|[1-9]\d*)([.]\d+)?$/" value="0">
            </div>
            <div class="col-sm-1 text-left task-duration-unit" ng-class="{'hide-unit': edit.task.project_id < 1}">
                 {{edit.task.duration_units}}
            </div>
        </div>
        <div class="col-md-4 offset-md-8" >
            <p class="text-danger duration-warning" ng-class="{'show-duration-warning': taskForm.duration.$invalid}"><lmsg src="projects.task.duration_value_warning">[Please input a valid duration value (number)]</lmsg></p>
        </div>
        <div class="form-group row">
            <div class="col-md-10 offset-md-2 col-sm-10 offset-sm-2">
                <button class="btn btn-success" ng-show="edit.addMode" ng-click="edit.saveTaskEdit($event, task)" ng-disabled="taskForm.duration.$invalid" lmsg="projects.task.add_task">[Add Task]</button>
                <button class="btn btn-primary" ng-show="!edit.addMode" ng-click="edit.saveTaskEdit($event, task)" ng-disabled="taskForm.duration.$invalid" lmsg="projects.task.save_task">[Save]</button>
                <button class="btn btn-danger" rel="tooltip" ng-click="edit.deleteTask($event, task)" ng-show="edit.task.perms.can_edit"><lmsg src="projects.task.delete">[Delete]</lmsg></button>
                <button class="btn btn-link" ng-click="edit.cancelTaskEdit($event, task)" lmsg="projects.task.cancel">[Cancel]</button>
            </div>
        </div>
    </form>
</div>
<!--- End Edit Task -->
