From 35be3df835e5fae94258e0a77a6ba6e982cc86d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Wed, 10 Jun 2015 11:28:33 +0200 Subject: [PATCH] Fix the title meta when open a project detail or profile page clicking with the center button --- app/modules/profile/profile.controller.coffee | 10 ++++++---- app/modules/projects/project/project.controller.coffee | 8 +++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/modules/profile/profile.controller.coffee b/app/modules/profile/profile.controller.coffee index e5ac1770..d2a0e7bb 100644 --- a/app/modules/profile/profile.controller.coffee +++ b/app/modules/profile/profile.controller.coffee @@ -27,11 +27,13 @@ class ProfileController @._setMeta(@.user) _setMeta: (user) -> - title = @translate.instant("USER.PROFILE.PAGE_TITLE", { + ctx = { userFullName: user.get("full_name_display"), userUsername: user.get("username") - }) - description = user.get("bio") - @appMetaService.setAll(title, description) + } + + @translate("USER.PROFILE.PAGE_TITLE", ctx).then (title) => + description = user.get("bio") + @appMetaService.setAll(title, description) angular.module("taigaProfile").controller("Profile", ProfileController) diff --git a/app/modules/projects/project/project.controller.coffee b/app/modules/projects/project/project.controller.coffee index 55816d52..2f980ef0 100644 --- a/app/modules/projects/project/project.controller.coffee +++ b/app/modules/projects/project/project.controller.coffee @@ -22,8 +22,10 @@ class ProjectController @xhrError.response(xhr) _setMeta: (project)-> - title = @translate.instant("PROJECT.PAGE_TITLE", {projectName: project.get("name")}) - description = project.get("description") - @appMetaService.setAll(title, description) + ctx = {projectName: project.get("name")} + + title = @translate("PROJECT.PAGE_TITLE", ctx).then (title) => + description = project.get("description") + @appMetaService.setAll(title, description) angular.module("taigaProjects").controller("Project", ProjectController)