Assigned to lightbox component

stable
Xavier Julián 2016-08-01 15:39:26 +02:00 committed by David Barragán Merino
parent 3e5ab894a6
commit 9e4ac74cfe
10 changed files with 101 additions and 28 deletions

View File

@ -0,0 +1,37 @@
###
# Copyright (C) 2014-2016 Taiga Agile LLC <taiga@taiga.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# File: assigned-to-selector.directive.coffee
###
AssignedItemDirective = () ->
link = (scope, el, attrs) ->
return {
# controller: "AssignedToSelectorCtrl",
# controllerAs: "vm",
# bindToController: true,
templateUrl: "components/assigned-to/assigned-item/assigned-item.html",
scope: {
member: "=",
},
link: link
}
AssignedItemDirective.$inject = []
angular.module("taigaComponents").directive("tgAssignedItem", AssignedItemDirective)

View File

@ -0,0 +1 @@
.member {{member}}

View File

@ -0,0 +1,25 @@
###
# Copyright (C) 2014-2015 Taiga Agile LLC <taiga@taiga.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# File: assigned-to-selector.controller.coffee
###
class AssignedToSelectorController
@.$inject = []
constructor: () ->
angular.module('taigaComponents').controller('AssignedToSelectorCtrl', AssignedToSelectorController)

View File

@ -19,20 +19,15 @@
AssignedToSelectorDirective = () ->
link = (scope, el, attrs) ->
console.log scope.assigned.toJS()
console.log scope.project.toJS()
return {
# controller: "AssignedToSelectorCtrl",
# controllerAs: "vm",
# bindToController: true,
controller: "AssignedToSelectorCtrl",
controllerAs: "vm",
bindToController: true,
templateUrl: "components/assigned-to/assigned-to-selector/assigned-to-selector.html",
scope: {
assigned: "=",
project: "="
},
link: link
}
}
AssignedToSelectorDirective.$inject = []

View File

@ -1,4 +1,17 @@
tg-lightbox-close
.assigned-to-container
h2.title(translate="COMMON.ASSIGNED_TO.TITLE_ACTION_EDIT_ASSIGNMENT")
h2.title(translate="LIGHTBOX.ASSIGNED_TO.SELECT")
input.assign-input(
type="text"
placeholder="{{'LIGHTBOX.ASSIGNED_TO.SEARCH' | translate}}"
autofocus
ng-model="vm.assignToMember.name"
ng-model-options="{debounce: 200}"
)
ul.tags-dropdown
li(ng-repeat="member in vm.project.members | filter: vm.assignToMember.name")
tg-assigned-item.assigned-members-option(
member="member"
ng-click="vm.onAddTag(tag[0], tag[1], vm.project)"
)

View File

@ -23,15 +23,16 @@ class AssignedToController
]
constructor: (@lightboxFactory) ->
@.has_permissions = _.includes(@.project.my_permissions, 'modify_epic')
onSelectAssignedTo: (assigned, project) ->
@lightboxFactory.create('tg-assigned-to-selector', {
"class": "lightbox lightbox-assigned-to-selector open"
"assigned": "assigned"
"assignedTo": "assignedTo"
"project": "project"
}, {
"assigned": assigned
"project": project
"assignedTo": @.assignedTo
"project": @.project
})
angular.module('taigaComponents').controller('AssignedToCtrl', AssignedToController)

View File

@ -25,7 +25,7 @@ AssignedToDirective = () ->
bindToController: true,
templateUrl: "components/assigned-to/assigned-to.html",
scope: {
assignedTo: "="
assignedTo: "=",
project: "="
}
}

View File

@ -1,13 +1,24 @@
img.assigned-to(
ng-if="vm.assignedTo"
ng-if="vm.assignedTo && vm.has_permissions"
tg-avatar="vm.assignedTo"
alt="{{vm.assignedTo.get('full_name_display')}}"
title="{{vm.assignedTo.get('full_name_display')}}"
ng-click="vm.onSelectAssignedTo(vm.assignedTo, vm.project)"
)
img.assigned-to(
ng-if="!vm.assignedTo"
ng-if="vm.assignedTo && !vm.has_permissions"
tg-avatar="vm.assignedTo"
alt="{{vm.assignedTo.get('full_name_display')}}"
title="{{vm.assignedTo.get('full_name_display')}}"
)
img.assigned-to(
ng-if="!vm.assignedTo && vm.has_permissions"
src="/#{v}/images/unnamed.png"
alt="{{EPICS.DASHBOARD.UNASSIGNED | translate}}"
ng-click="vm.onSelectAssignedTo(vm.assignedTo, vm.project)"
)
img.assigned-to(
ng-if="!vm.assignedTo && !vm.has_permissions"
src="/#{v}/images/unnamed.png"
alt="{{EPICS.DASHBOARD.UNASSIGNED | translate}}"
)

View File

@ -26,19 +26,12 @@
alt="{{::vm.story.getIn(['project_extra_info', 'name'])}}"
)
.sprint(ng-if="vm.column.sprint") {{::vm.story.get('milestone_name')}}
.assigned(
ng-if="vm.column.assigned && vm.story.get('assigned_to')"
ng-click="vm.onSelectAssignedTo()"
)
.assigned(ng-if="vm.column.assigned && vm.story.get('assigned_to')")
img(
tg-avatar="vm.story.get('assigned_to_extra_info')"
alt="{{::vm.story.getIn(['assigned_to_extra_info', 'full_name_display'])}}"
)
.assigned(
ng-if="vm.column.assigned && !vm.story.get('assigned_to')"
ng-class="{'is-unassigned': !vm.story.get('assigned_to')}"
ng-click="vm.onSelectAssignedTo()"
)
.assigned(ng-if="vm.column.assigned && !vm.story.get('assigned_to')")
img(
src="/#{v}/images/unnamed.png"
alt="{{EPICS.DASHBOARD.UNASSIGNED | translate}}"

View File

@ -86,7 +86,4 @@
margin-right: .25rem;
vertical-align: middle;
}
.is-unassigned {
color: $gray-light;
}
}