Correctly link user profile
parent
b88d3ba30e
commit
a09a7fe5cd
|
@ -173,8 +173,6 @@ UserDisplayDirective = ($template, $compile, $translate, $navUrls)->
|
||||||
# div.creator(tg-user-display, tg-user-id="{{ user.id }}")
|
# div.creator(tg-user-display, tg-user-id="{{ user.id }}")
|
||||||
#
|
#
|
||||||
# Requirements:
|
# Requirements:
|
||||||
# - model object must have the attributes 'created_date' and
|
|
||||||
# 'owner'(ng-model)
|
|
||||||
# - scope.usersById object is required.
|
# - scope.usersById object is required.
|
||||||
|
|
||||||
link = ($scope, $el, $attrs) ->
|
link = ($scope, $el, $attrs) ->
|
||||||
|
@ -185,7 +183,7 @@ UserDisplayDirective = ($template, $compile, $translate, $navUrls)->
|
||||||
photo: "/" + window._version + "/images/user-noimage.png"
|
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", ->
|
$scope.$on "$destroy", ->
|
||||||
$el.off()
|
$el.off()
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.user-avatar
|
.user-avatar(ng-if="url")
|
||||||
a(
|
a(
|
||||||
href="{{url}}"
|
href="{{url}}"
|
||||||
title="{{user.full_name_display}}"
|
title="{{user.full_name_display}}"
|
||||||
|
@ -8,6 +8,14 @@
|
||||||
alt="{{user.full_name_display}}"
|
alt="{{user.full_name_display}}"
|
||||||
)
|
)
|
||||||
a.user-full-name(
|
a.user-full-name(
|
||||||
|
ng-if="url"
|
||||||
href="{{url}}"
|
href="{{url}}"
|
||||||
title="{{user.full_name_display}}"
|
title="{{user.full_name_display}}"
|
||||||
) {{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}}
|
||||||
|
|
Loading…
Reference in New Issue