Fix created by section

stable
David Barragán Merino 2015-06-26 13:10:08 +02:00
parent 9fb03994a9
commit 01c8e53026
2 changed files with 10 additions and 6 deletions

View File

@ -152,7 +152,7 @@ module.directive("tgSprintProgressbar", SprintProgressBarDirective)
## Created-by display directive ## Created-by display directive
############################################################################# #############################################################################
CreatedByDisplayDirective = ($template, $compile, $translate)-> CreatedByDisplayDirective = ($template, $compile, $translate, $navUrls)->
# Display the owner information (full name and photo) and the date of # Display the owner information (full name and photo) and the date of
# creation of an object (like USs, tasks and issues). # creation of an object (like USs, tasks and issues).
# #
@ -168,13 +168,14 @@ CreatedByDisplayDirective = ($template, $compile, $translate)->
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
render = (model) -> render = (model) ->
owner = $scope.usersById?[model.owner] or { owner = model.owner_extra_info or {
full_name_display: $translate.instant("COMMON.EXTERNAL_USER") full_name_display: $translate.instant("COMMON.EXTERNAL_USER")
photo: "/images/unnamed.png" photo: "/images/user-noimage.png"
} }
html = template({ html = template({
owner: owner owner: owner
url: if owner?.is_active then $navUrls.resolve("user-profile", {username: owner.username}) else ""
date: moment(model.created_date).format($translate.instant("COMMON.DATETIME")) date: moment(model.created_date).format($translate.instant("COMMON.DATETIME"))
}) })
@ -194,7 +195,8 @@ CreatedByDisplayDirective = ($template, $compile, $translate)->
require: "ngModel" require: "ngModel"
} }
module.directive("tgCreatedByDisplay", ["$tgTemplate", "$compile", "$translate", CreatedByDisplayDirective]) module.directive("tgCreatedByDisplay", ["$tgTemplate", "$compile", "$translate", "$tgNavUrls",
CreatedByDisplayDirective])
############################################################################# #############################################################################

View File

@ -1,7 +1,9 @@
.user-avatar .user-avatar
a(href!="<%- url %>", title!="<%- owner.full_name_display %>")
img(src!="<%- owner.photo %>", alt!="<%- owner.full_name_display %>") img(src!="<%- owner.photo %>", alt!="<%- owner.full_name_display %>")
.created-by .created-by
a(href!="<%- url %>", title!="<%- owner.full_name_display %>")
span.created-title(translate="COMMON.CREATED_BY", translate-values!="{ 'fullDisplayName': '<%- owner.full_name_display %>'}") span.created-title(translate="COMMON.CREATED_BY", translate-values!="{ 'fullDisplayName': '<%- owner.full_name_display %>'}")
span.created-date span.created-date
| <%- date %> | <%- date %>