diff --git a/app/coffee/modules/admin/memberships.coffee b/app/coffee/modules/admin/memberships.coffee index 0662a240..ba12912f 100644 --- a/app/coffee/modules/admin/memberships.coffee +++ b/app/coffee/modules/admin/memberships.coffee @@ -236,7 +236,7 @@ MembershipsRowAvatarDirective = ($log) -> ctx = { full_name: if member.full_name then member.full_name else "" email: member.email - imgurl: if member.photo then member.photo else "http://thecodeplayer.com/u/uifaces/12.jpg" + imgurl: if member.photo then member.photo else "/image/unnamed.png" } html = template(ctx) diff --git a/app/coffee/modules/common/components.coffee b/app/coffee/modules/common/components.coffee index b67cfb4c..c8bfa64d 100644 --- a/app/coffee/modules/common/components.coffee +++ b/app/coffee/modules/common/components.coffee @@ -255,7 +255,10 @@ module.directive("tgAssignedTo", ["$rootScope", "$tgConfirm", AssignedToDirectiv ############################################################################# -## List directives (Issues List, Search) +## Common list directives +############################################################################# +## NOTE: These directives are used in issues and search and are +## completely bindonce, they only serves for visualization of data. ############################################################################# ListItemIssueStatusDirective = -> @@ -286,27 +289,26 @@ ListItemUsStatusDirective = -> ListItemAssignedtoDirective = -> - template = """ + template = _.template("""
- username -
--
+ <%- name %> +
<%- name %>
- """ + """) link = ($scope, $el, $attrs) -> - issue = $scope.$eval($attrs.tgListitemAssignedto) - if issue.assigned_to is null - $el.find("figcaption").html("Unassigned") - else - bindOnce $scope, "membersById", (membersById) -> - member = membersById[issue.assigned_to] - $el.find("figcaption").html(member.full_name) - $el.find("img").attr("src", member.photo) + bindOnce $scope, "membersById", (membersById) -> + item = $scope.$eval($attrs.tgListitemAssignedto) + ctx = {name: "Unassigned", imgurl: "/images/unnamed.png"} - return { - template: template - link:link - } + member = membersById[item.assigned_to] + if member + ctx.imgurl = member.photo + ctx.name = member.full_name + + $el.html(template(ctx)) + + return {link:link} ListItemPriorityDirective = -> diff --git a/app/coffee/modules/kanban/main.coffee b/app/coffee/modules/kanban/main.coffee index 3784edef..f48f93eb 100644 --- a/app/coffee/modules/kanban/main.coffee +++ b/app/coffee/modules/kanban/main.coffee @@ -244,7 +244,7 @@ KanbanUserDirective = ($log) -> render = (user) -> if user is undefined - ctx = {name: "Unassigned", imgurl: "http://thecodeplayer.com/u/uifaces/12.jpg"} + ctx = {name: "Unassigned", imgurl: "/images/unnamed.png"} else ctx = {name: user.full_name_display, imgurl: user.photo} diff --git a/app/coffee/modules/nav.coffee b/app/coffee/modules/nav.coffee index 735194e7..1022dacb 100644 --- a/app/coffee/modules/nav.coffee +++ b/app/coffee/modules/nav.coffee @@ -127,7 +127,7 @@ ProjectMenuDirective = ($log, $compile, $rootscope) ->
  • Logout
  • - username + username diff --git a/app/images/unnamed.png b/app/images/unnamed.png new file mode 100644 index 00000000..a8bce290 Binary files /dev/null and b/app/images/unnamed.png differ