Validate task form
parent
4ba0e590f9
commit
a8c306d9ec
|
@ -129,9 +129,13 @@ TaskDirective = ($tgrepo, $log, $location, $confirm) ->
|
||||||
|
|
||||||
link = ($scope, $el, $attrs) ->
|
link = ($scope, $el, $attrs) ->
|
||||||
$ctrl = $el.controller()
|
$ctrl = $el.controller()
|
||||||
|
form = $el.checksley()
|
||||||
linkSidebar($scope, $el, $attrs, $ctrl)
|
linkSidebar($scope, $el, $attrs, $ctrl)
|
||||||
|
|
||||||
$el.on "click", ".save-task", (event) ->
|
$el.on "click", ".save-task", (event) ->
|
||||||
|
if not form.validate()
|
||||||
|
return
|
||||||
|
|
||||||
$tgrepo.save($scope.task).then ->
|
$tgrepo.save($scope.task).then ->
|
||||||
$confirm.notify("success")
|
$confirm.notify("success")
|
||||||
$location.path("/project/#{$scope.project.slug}/tasks/#{$scope.task.ref}")
|
$location.path("/project/#{$scope.project.slug}/tasks/#{$scope.task.ref}")
|
||||||
|
|
|
@ -4,7 +4,7 @@ block head
|
||||||
title Taiga Project management web application with scrum in mind!
|
title Taiga Project management web application with scrum in mind!
|
||||||
|
|
||||||
block content
|
block content
|
||||||
div.wrapper(tg-task-detail, ng-controller="TaskDetailController as ctrl",
|
form.wrapper(tg-task-detail, ng-controller="TaskDetailController as ctrl",
|
||||||
ng-init="section='backlog'")
|
ng-init="section='backlog'")
|
||||||
div.main.us-detail
|
div.main.us-detail
|
||||||
div.us-detail-header
|
div.us-detail-header
|
||||||
|
@ -13,7 +13,7 @@ block content
|
||||||
|
|
||||||
section.us-story-main-data
|
section.us-story-main-data
|
||||||
div.us-title(ng-class="{blocked: task.is_blocked}")
|
div.us-title(ng-class="{blocked: task.is_blocked}")
|
||||||
input(type="text", ng-model="task.subject")
|
input(type="text", ng-model="task.subject", data-required="true", data-maxlength="500")
|
||||||
p.block-desc-container(ng-show="task.is_blocked")
|
p.block-desc-container(ng-show="task.is_blocked")
|
||||||
span.block-description-title Blocked
|
span.block-description-title Blocked
|
||||||
span.block-description(tg-bind-html="task.blocked_note || 'This task is blocked'")
|
span.block-description(tg-bind-html="task.blocked_note || 'This task is blocked'")
|
||||||
|
|
Loading…
Reference in New Issue