Validate task form

stable
David Barragán Merino 2014-08-07 11:02:07 +02:00
parent 4ba0e590f9
commit a8c306d9ec
2 changed files with 6 additions and 2 deletions

View File

@ -129,9 +129,13 @@ TaskDirective = ($tgrepo, $log, $location, $confirm) ->
link = ($scope, $el, $attrs) ->
$ctrl = $el.controller()
form = $el.checksley()
linkSidebar($scope, $el, $attrs, $ctrl)
$el.on "click", ".save-task", (event) ->
if not form.validate()
return
$tgrepo.save($scope.task).then ->
$confirm.notify("success")
$location.path("/project/#{$scope.project.slug}/tasks/#{$scope.task.ref}")

View File

@ -4,7 +4,7 @@ block head
title Taiga Project management web application with scrum in mind!
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'")
div.main.us-detail
div.us-detail-header
@ -13,7 +13,7 @@ block content
section.us-story-main-data
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")
span.block-description-title Blocked
span.block-description(tg-bind-html="task.blocked_note || 'This task is blocked'")