Set proper default image for unassigned users.

Including image locally.
stable
Andrey Antukh 2014-07-24 14:57:37 +02:00
parent 431abc551d
commit 849c5a92b3
5 changed files with 22 additions and 20 deletions

View File

@ -236,7 +236,7 @@ MembershipsRowAvatarDirective = ($log) ->
ctx = { ctx = {
full_name: if member.full_name then member.full_name else "" full_name: if member.full_name then member.full_name else ""
email: member.email 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) html = template(ctx)

View File

@ -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 = -> ListItemIssueStatusDirective = ->
@ -286,27 +289,26 @@ ListItemUsStatusDirective = ->
ListItemAssignedtoDirective = -> ListItemAssignedtoDirective = ->
template = """ template = _.template("""
<figure class="avatar"> <figure class="avatar">
<img src="" alt="username"/> <img src="<%= imgurl %>" alt="<%- name %>"/>
<figcaption>--</figcaption> <figcaption><%- name %></figcaption>
</figure> </figure>
""" """)
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
issue = $scope.$eval($attrs.tgListitemAssignedto) bindOnce $scope, "membersById", (membersById) ->
if issue.assigned_to is null item = $scope.$eval($attrs.tgListitemAssignedto)
$el.find("figcaption").html("Unassigned") ctx = {name: "Unassigned", imgurl: "/images/unnamed.png"}
else
bindOnce $scope, "membersById", (membersById) ->
member = membersById[issue.assigned_to]
$el.find("figcaption").html(member.full_name)
$el.find("img").attr("src", member.photo)
return { member = membersById[item.assigned_to]
template: template if member
link:link ctx.imgurl = member.photo
} ctx.name = member.full_name
$el.html(template(ctx))
return {link:link}
ListItemPriorityDirective = -> ListItemPriorityDirective = ->

View File

@ -244,7 +244,7 @@ KanbanUserDirective = ($log) ->
render = (user) -> render = (user) ->
if user is undefined if user is undefined
ctx = {name: "Unassigned", imgurl: "http://thecodeplayer.com/u/uifaces/12.jpg"} ctx = {name: "Unassigned", imgurl: "/images/unnamed.png"}
else else
ctx = {name: user.full_name_display, imgurl: user.photo} ctx = {name: user.full_name_display, imgurl: user.photo}

View File

@ -127,7 +127,7 @@ ProjectMenuDirective = ($log, $compile, $rootscope) ->
<li><a href="" title="Logout">Logout</a></li> <li><a href="" title="Logout">Logout</a></li>
</ul> </ul>
<a href="" title="User preferences" class="avatar"> <a href="" title="User preferences" class="avatar">
<img src="http://thecodeplayer.com/u/uifaces/12.jpg" alt="username"/> <img src="/images/unnamed.png" alt="username"/>
</a> </a>
</div> </div>
</div> </div>

BIN
app/images/unnamed.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB