BUG#2404 Check permissions for click the username label on kanban and taskboard
parent
8aa88cf28d
commit
89e7811f81
|
@ -504,6 +504,9 @@ KanbanUserDirective = ($log) ->
|
|||
clickable = false
|
||||
|
||||
link = ($scope, $el, $attrs, $model) ->
|
||||
username_label = $el.parent().find("a.task-assigned")
|
||||
username_label.addClass("not-clickable")
|
||||
|
||||
if not $attrs.tgKanbanUserAvatar
|
||||
return $log.error "KanbanUserDirective: no attr is defined"
|
||||
|
||||
|
@ -523,15 +526,7 @@ KanbanUserDirective = ($log) ->
|
|||
|
||||
html = template(ctx)
|
||||
$el.html(html)
|
||||
username_label = $el.parent().find("a.task-assigned")
|
||||
username_label.text(ctx.name)
|
||||
username_label.on "click", (event) ->
|
||||
if $el.find("a").hasClass("noclick")
|
||||
return
|
||||
|
||||
us = $model.$modelValue
|
||||
$ctrl = $el.controller()
|
||||
$ctrl.changeUsAssignedTo(us)
|
||||
|
||||
bindOnce $scope, "project", (project) ->
|
||||
if project.my_permissions.indexOf("modify_us") > -1
|
||||
|
@ -544,6 +539,15 @@ KanbanUserDirective = ($log) ->
|
|||
$ctrl = $el.controller()
|
||||
$ctrl.changeUsAssignedTo(us)
|
||||
|
||||
username_label.removeClass("not-clickable")
|
||||
username_label.on "click", (event) ->
|
||||
if $el.find("a").hasClass("noclick")
|
||||
return
|
||||
|
||||
us = $model.$modelValue
|
||||
$ctrl = $el.controller()
|
||||
$ctrl.changeUsAssignedTo(us)
|
||||
|
||||
$scope.$on "$destroy", ->
|
||||
$el.off()
|
||||
|
||||
|
|
|
@ -397,12 +397,7 @@ TaskboardUserDirective = ($log) ->
|
|||
|
||||
link = ($scope, $el, $attrs) ->
|
||||
username_label = $el.parent().find("a.task-assigned")
|
||||
username_label.on "click", (event) ->
|
||||
if $el.find('a').hasClass('noclick')
|
||||
return
|
||||
|
||||
$ctrl = $el.controller()
|
||||
$ctrl.editTaskAssignedTo($scope.task)
|
||||
username_label.addClass("not-clickable")
|
||||
|
||||
$scope.$watch 'task.assigned_to', (assigned_to) ->
|
||||
user = $scope.usersById[assigned_to]
|
||||
|
@ -425,6 +420,15 @@ TaskboardUserDirective = ($log) ->
|
|||
$ctrl = $el.controller()
|
||||
$ctrl.editTaskAssignedTo($scope.task)
|
||||
|
||||
username_label.removeClass("not-clickable")
|
||||
username_label.on "click", (event) ->
|
||||
if $el.find('a').hasClass('noclick')
|
||||
return
|
||||
|
||||
$ctrl = $el.controller()
|
||||
$ctrl.editTaskAssignedTo($scope.task)
|
||||
|
||||
|
||||
return {
|
||||
link: link,
|
||||
templateUrl: "taskboard/taskboard-user.html",
|
||||
|
|
Loading…
Reference in New Issue