Validate issue form

stable
David Barragán Merino 2014-08-07 11:01:37 +02:00
parent 0290e68b13
commit 4ba0e590f9
2 changed files with 7 additions and 3 deletions

View File

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

View File

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