Correctly link user profile

stable
Jesús Espino 2016-06-14 12:01:03 +02:00 committed by David Barragán Merino
parent b88d3ba30e
commit a09a7fe5cd
2 changed files with 10 additions and 4 deletions

View File

@ -173,8 +173,6 @@ UserDisplayDirective = ($template, $compile, $translate, $navUrls)->
# div.creator(tg-user-display, tg-user-id="{{ user.id }}")
#
# Requirements:
# - model object must have the attributes 'created_date' and
# 'owner'(ng-model)
# - scope.usersById object is required.
link = ($scope, $el, $attrs) ->
@ -185,7 +183,7 @@ UserDisplayDirective = ($template, $compile, $translate, $navUrls)->
photo: "/" + window._version + "/images/user-noimage.png"
}
$scope.url = if $scope.owner?.is_active then $navUrls.resolve("user-profile", {username: $scope.owner.username}) else ""
$scope.url = if $scope.user.is_active then $navUrls.resolve("user-profile", {username: $scope.user.username}) else ""
$scope.$on "$destroy", ->
$el.off()

View File

@ -1,4 +1,4 @@
.user-avatar
.user-avatar(ng-if="url")
a(
href="{{url}}"
title="{{user.full_name_display}}"
@ -8,6 +8,14 @@
alt="{{user.full_name_display}}"
)
a.user-full-name(
ng-if="url"
href="{{url}}"
title="{{user.full_name_display}}"
) {{user.full_name_display}}
.user-avatar(ng-if="!url")
img(
src="{{user.photo}}"
alt="{{user.full_name_display}}"
)
span.user-full-name(ng-if="!url") {{user.full_name_display}}