Fix errors of tag directive in lightboxes
parent
c8ce1ad9e0
commit
47fa97917e
|
@ -234,10 +234,10 @@ module.directive("tgBlockingMessageInput", ["$log", BlockingMessageInputDirectiv
|
|||
|
||||
CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService, $loading) ->
|
||||
link = ($scope, $el, attrs) ->
|
||||
isNew = true
|
||||
$scope.isNew = true
|
||||
|
||||
$scope.$on "usform:new", (ctx, projectId, status, statusList) ->
|
||||
isNew = true
|
||||
$scope.isNew = true
|
||||
$scope.usStatusList = statusList
|
||||
|
||||
$scope.us = {
|
||||
|
@ -261,7 +261,7 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService,
|
|||
|
||||
$scope.$on "usform:edit", (ctx, us) ->
|
||||
$scope.us = us
|
||||
isNew = false
|
||||
$scope.isNew = false
|
||||
|
||||
# Update texts for edition
|
||||
$el.find(".button-green span").html("Save") #TODO: i18n
|
||||
|
@ -296,7 +296,7 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService,
|
|||
|
||||
$loading.start(target)
|
||||
|
||||
if isNew
|
||||
if $scope.isNew
|
||||
promise = $repo.create("userstories", $scope.us)
|
||||
broadcastEvent = "usform:new:success"
|
||||
else
|
||||
|
|
|
@ -167,12 +167,16 @@ TagLineDirective = ($rootscope, $log, $rs, $tgrepo, $confirm) ->
|
|||
|
||||
bindOnce $scope, "project", (project) ->
|
||||
# If not editable, no tags preloading is needed.
|
||||
editable = $attrs.editable == "true" and project.my_permissions.indexOf($attrs.requiredPerm) != -1
|
||||
editable = project.my_permissions.indexOf($attrs.requiredPerm) != -1
|
||||
|
||||
if not $scope.$eval($attrs.autosaveModel)?
|
||||
$el.find("a.save").remove()
|
||||
|
||||
if not editable
|
||||
$el.find("input").remove()
|
||||
return
|
||||
|
||||
|
||||
positioningFunction = (position, elements) ->
|
||||
menu = elements.element.element
|
||||
menu.css("width", elements.target.width)
|
||||
|
|
|
@ -25,7 +25,7 @@ debounce = @.taiga.debounce
|
|||
|
||||
CreateEditTaskDirective = ($repo, $model, $rs, $rootscope, lightboxService) ->
|
||||
link = ($scope, $el, attrs) ->
|
||||
isNew = true
|
||||
$scope.isNew = true
|
||||
|
||||
$scope.$on "taskform:new", (ctx, sprintId, usId) ->
|
||||
$scope.task = {
|
||||
|
@ -37,7 +37,7 @@ CreateEditTaskDirective = ($repo, $model, $rs, $rootscope, lightboxService) ->
|
|||
assigned_to: null
|
||||
tags: []
|
||||
}
|
||||
isNew = true
|
||||
$scope.isNew = true
|
||||
|
||||
# Update texts for creation
|
||||
$el.find(".button-green span").html("Create") #TODO: i18n
|
||||
|
@ -46,7 +46,7 @@ CreateEditTaskDirective = ($repo, $model, $rs, $rootscope, lightboxService) ->
|
|||
|
||||
$scope.$on "taskform:edit", (ctx, task) ->
|
||||
$scope.task = task
|
||||
isNew = false
|
||||
$scope.isNew = false
|
||||
|
||||
# Update texts for edition
|
||||
$el.find(".button-green span").html("Save") #TODO: i18n
|
||||
|
@ -60,7 +60,7 @@ CreateEditTaskDirective = ($repo, $model, $rs, $rootscope, lightboxService) ->
|
|||
if not form.validate()
|
||||
return
|
||||
|
||||
if isNew
|
||||
if $scope.isNew
|
||||
promise = $repo.create("tasks", $scope.task)
|
||||
broadcastEvent = "taskform:new:success"
|
||||
else
|
||||
|
|
|
@ -31,7 +31,7 @@ block content
|
|||
a.icon.icon-arrow-left(ng-show="previousUrl", tg-bo-href="previousUrl", title="previous issue")
|
||||
a.icon.icon-arrow-right(ng-show="nextUrl", tg-bo-href="nextUrl", title="next issue")
|
||||
|
||||
div(tg-tag-line, editable="true", autosave-model="issue", ng-model="issue.tags", required-perm="modify_issue")
|
||||
div(tg-tag-line, autosave-model="issue", ng-model="issue.tags", required-perm="modify_issue")
|
||||
|
||||
section.duty-content.wysiwyg(tg-editable-description, ng-model="issue", required-perm="modify_issue")
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ block content
|
|||
a.icon.icon-arrow-left(ng-show="previousUrl", tg-bo-href="previousUrl", title="previous task")
|
||||
a.icon.icon-arrow-right(ng-show="nextUrl", tg-bo-href="nextUrl", title="next task")
|
||||
|
||||
div(tg-tag-line, editable="true", autosave-model="task", ng-model="task.tags", required-perm="modify_task")
|
||||
div(tg-tag-line, autosave-model="task", ng-model="task.tags", required-perm="modify_task")
|
||||
|
||||
section.duty-content.wysiwyg(tg-editable-description, ng-model="task", required-perm="modify_task")
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ block content
|
|||
title="previous user story")
|
||||
a.icon.icon-arrow-right(ng-show="nextUrl", tg-bo-href="nextUrl", title="next user story")
|
||||
|
||||
div(tg-tag-line, editable="true", autosave-model="us", ng-model="us.tags", required-perm="modify_us")
|
||||
div(tg-tag-line, autosave-model="us", ng-model="us.tags", required-perm="modify_us")
|
||||
|
||||
section.duty-content.wysiwyg(tg-editable-description, ng-model="us", required-perm="modify_us")
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ form
|
|||
select.severity(ng-model="issue.severity", ng-options="s.id as s.name for s in severityList")
|
||||
|
||||
fieldset
|
||||
div(tg-tag-line, editable="true", ng-model="issue.tags")
|
||||
div(tg-tag-line, ng-model="issue.tags", required-perm="add_issue")
|
||||
|
||||
fieldset
|
||||
textarea.description(placeholder="Description", ng-model="issue.description")
|
||||
|
|
|
@ -15,8 +15,9 @@ form
|
|||
placeholder="Assigned to")
|
||||
option(value="") Unassigned
|
||||
|
||||
fieldset
|
||||
div(tg-tag-line, editable="true", ng-model="task.tags")
|
||||
fieldset(ng-switch="isNew")
|
||||
div(ng-switch-when="true", tg-tag-line, ng-model="task.tags", required-perm="add_task")
|
||||
div(ng-switch-default, tg-tag-line, ng-model="task.tags", required-perm="modify_task")
|
||||
|
||||
fieldset
|
||||
textarea.description(placeholder="Type a short description", ng-model="task.description")
|
||||
|
|
|
@ -8,14 +8,14 @@ form
|
|||
|
||||
fieldset.estimation
|
||||
tg-us-estimation(ng-model="us")
|
||||
//- Render by tg-lb-create-edit-userstory
|
||||
|
||||
fieldset
|
||||
select(name="status", ng-model="us.status", ng-options="s.id as s.name for s in usStatusList",
|
||||
tr="placeholder:common.status")
|
||||
|
||||
fieldset
|
||||
div(tg-tag-line, editable="true", ng-model="us.tags")
|
||||
fieldset(ng-switch="isNew")
|
||||
div(ng-switch-when="true", tg-tag-line, ng-model="us.tags", required-perm="add_us")
|
||||
div(ng-switch-default, tg-tag-line, ng-model="us.tags", required-perm="modify_us")
|
||||
|
||||
fieldset
|
||||
textarea.description(name="description", ng-model="us.description",
|
||||
|
|
Loading…
Reference in New Issue