diff --git a/app/coffee/modules/userstories/detail.coffee b/app/coffee/modules/userstories/detail.coffee index 8f7473f3..a5b2f860 100644 --- a/app/coffee/modules/userstories/detail.coffee +++ b/app/coffee/modules/userstories/detail.coffee @@ -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}") diff --git a/app/partials/us-detail-edit.jade b/app/partials/us-detail-edit.jade index bc6b1bda..68c674fb 100644 --- a/app/partials/us-detail-edit.jade +++ b/app/partials/us-detail-edit.jade @@ -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'")