Validate US form

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

View File

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

View File

@ -4,7 +4,7 @@ block head
title Taiga Project management web application with scrum in mind!
block content
div.wrapper(tg-us-detail, ng-controller="UserStoryDetailController as ctrl",
form.wrapper(tg-us-detail, ng-controller="UserStoryDetailController 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: us.is_blocked}")
input(type="text", ng-model="us.subject")
input(type="text", ng-model="us.subject", data-required="true", data-maxlength="500")
p.block-desc-container(ng-show="us.is_blocked")
span.block-description-title Blocked
span.block-description(tg-bind-html="us.blocked_note || 'This US is blocked'")