diff --git a/app/coffee/modules/admin/memberships.coffee b/app/coffee/modules/admin/memberships.coffee index 1cc1c767..1d39f477 100644 --- a/app/coffee/modules/admin/memberships.coffee +++ b/app/coffee/modules/admin/memberships.coffee @@ -39,10 +39,11 @@ class MembershipsController extends mixOf(taiga.Controller, taiga.PageMixin, tai "$tgResources", "$routeParams", "$q", - "$tgLocation" + "$tgLocation", + "$appTitle" ] - constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location) -> + constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle) -> _.bindAll(@) @scope.sectionName = "Memberships" #i18n @@ -50,6 +51,10 @@ class MembershipsController extends mixOf(taiga.Controller, taiga.PageMixin, tai @scope.filters = {} promise = @.loadInitialData() + + promise.then () => + @appTitle.set("Membership - " + @scope.project.name) + promise.then null, -> console.log "FAIL" #TODO diff --git a/app/coffee/modules/admin/project-profile.coffee b/app/coffee/modules/admin/project-profile.coffee index a683c39a..b8af6bd9 100644 --- a/app/coffee/modules/admin/project-profile.coffee +++ b/app/coffee/modules/admin/project-profile.coffee @@ -43,13 +43,18 @@ class ProjectProfileController extends mixOf(taiga.Controller, taiga.PageMixin) "$tgResources", "$routeParams", "$q", - "$location" + "$location", + "$appTitle" ] - constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location) -> + constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle) -> @scope.project = {} promise = @.loadInitialData() + + promise.then () => + @appTitle.set("Project profile - " + @scope.sectionName + " - " + @scope.project.name) + promise.then null, -> console.log "FAIL" #TODO diff --git a/app/coffee/modules/admin/project-values.coffee b/app/coffee/modules/admin/project-values.coffee index 638bb4f5..406198c5 100644 --- a/app/coffee/modules/admin/project-values.coffee +++ b/app/coffee/modules/admin/project-values.coffee @@ -43,13 +43,18 @@ class ProjectValuesController extends mixOf(taiga.Controller, taiga.PageMixin) "$tgResources", "$routeParams", "$q", - "$location" + "$location", + "$appTitle" ] - constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location) -> + constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle) -> @scope.project = {} promise = @.loadInitialData() + + promise.then () => + @appTitle.set("Project values - " + @scope.sectionName + " - " + @scope.project.name) + promise.then null, -> console.log "FAIL" #TODO diff --git a/app/coffee/modules/admin/roles.coffee b/app/coffee/modules/admin/roles.coffee index a3a27b69..0dda53a2 100644 --- a/app/coffee/modules/admin/roles.coffee +++ b/app/coffee/modules/admin/roles.coffee @@ -40,16 +40,21 @@ class RolesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fil "$tgResources", "$routeParams", "$q", - "$tgLocation" + "$tgLocation", + "$appTitle" ] - constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location) -> + constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle) -> _.bindAll(@) @scope.sectionName = "Roles" #i18n @scope.project = {} promise = @.loadInitialData() + + promise.then () => + @appTitle.set("Roles - " + @scope.project.name) + promise.then null, -> console.log "FAIL" #TODO diff --git a/app/coffee/modules/backlog/main.coffee b/app/coffee/modules/backlog/main.coffee index de9f2100..f83ed9b0 100644 --- a/app/coffee/modules/backlog/main.coffee +++ b/app/coffee/modules/backlog/main.coffee @@ -42,10 +42,11 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F "$tgResources", "$routeParams", "$q", - "$tgLocation" + "$tgLocation", + "$appTitle" ] - constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location) -> + constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle) -> _.bindAll(@) @scope.sectionName = "Backlog" @@ -53,6 +54,9 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F promise = @.loadInitialData() + promise.then () => + @appTitle.set("Backlog - " + @scope.project.name) + promise.then null, => console.log "FAIL" diff --git a/app/coffee/modules/common.coffee b/app/coffee/modules/common.coffee index e5fa975a..48c6cf90 100644 --- a/app/coffee/modules/common.coffee +++ b/app/coffee/modules/common.coffee @@ -408,3 +408,15 @@ ToggleCommentDirective = () -> return {link:link} module.directive("tgToggleComment", ToggleCommentDirective) + +############################################################################# +## Set the page title +############################################################################# + +AppTitle = () -> + set = (text) -> + $("title").text(text) + + return {set: set} + +module.factory("$appTitle", AppTitle) diff --git a/app/coffee/modules/issues/detail.coffee b/app/coffee/modules/issues/detail.coffee index 8984d356..27304b48 100644 --- a/app/coffee/modules/issues/detail.coffee +++ b/app/coffee/modules/issues/detail.coffee @@ -43,16 +43,21 @@ class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin, tai "$routeParams", "$q", "$location", - "$log" + "$log", + "$appTitle" ] - constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @log) -> + constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @log, @appTitle) -> @.attachmentsUrlName = "issues/attachments" @scope.issueRef = @params.issueref @scope.sectionName = "Issue Details" promise = @.loadInitialData() + + promise.then () => + @appTitle.set(@scope.issue.subject + " - " + @scope.project.name) + promise.then null, -> console.log "FAIL" #TODO diff --git a/app/coffee/modules/issues/list.coffee b/app/coffee/modules/issues/list.coffee index 4e261cc3..1fb262e3 100644 --- a/app/coffee/modules/issues/list.coffee +++ b/app/coffee/modules/issues/list.coffee @@ -45,15 +45,20 @@ class IssuesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi "$tgResources", "$routeParams", "$q", - "$location" + "$location", + "$appTitle" ] - constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location) -> + constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle) -> @scope.sprintId = @params.id @scope.sectionName = "Issues" @scope.filters = {} promise = @.loadInitialData() + + promise.then () => + @appTitle.set("Issues - " + @scope.project.name) + promise.then null, -> console.log "FAIL" #TODO diff --git a/app/coffee/modules/kanban/main.coffee b/app/coffee/modules/kanban/main.coffee index bba052c5..6e74c71b 100644 --- a/app/coffee/modules/kanban/main.coffee +++ b/app/coffee/modules/kanban/main.coffee @@ -43,15 +43,19 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi "$tgResources", "$routeParams", "$q", - "$tgLocation" + "$tgLocation", + "$appTitle" ] - constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location) -> + constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle) -> _.bindAll(@) @scope.sectionName = "Kanban" promise = @.loadInitialData() + promise.then () => + @appTitle.set("Kanban - " + @scope.project.name) + promise.then null, => console.log "FAIL" diff --git a/app/coffee/modules/projects/main.coffee b/app/coffee/modules/projects/main.coffee index 85c0b8b9..d8e83176 100644 --- a/app/coffee/modules/projects/main.coffee +++ b/app/coffee/modules/projects/main.coffee @@ -12,9 +12,11 @@ class ProjectNavController extends taiga.Controller module.controller("ProjectNavController", ProjectNavController) class ProjectsController extends taiga.Controller - @.$inject = ["$scope", "$tgResources", "$rootScope", "$tgNavUrls", "$tgAuth", "$location"] + @.$inject = ["$scope", "$tgResources", "$rootScope", "$tgNavUrls", "$tgAuth", "$location", "$appTitle"] + + constructor: (@scope, @rs, @rootscope, @navurls, $auth, $location, appTitle) -> + appTitle.set("Projects") - constructor: (@scope, @rs, @rootscope, @navurls, $auth, $location) -> if !$auth.isAuthenticated() $location.path("/login") @@ -45,11 +47,13 @@ class ProjectsController extends taiga.Controller module.controller("ProjectsController", ProjectsController) class ProjectController extends taiga.Controller - @.$inject = ["$scope", "$tgResources", "$tgRepo", "$routeParams", "$q", "$rootScope"] + @.$inject = ["$scope", "$tgResources", "$tgRepo", "$routeParams", "$q", "$rootScope", "$appTitle"] - constructor: (@scope, @rs, @repo, @params, @q, @rootscope) -> + constructor: (@scope, @rs, @repo, @params, @q, @rootscope, @appTitle) -> @scope.hideMenu = false @.loadInitialData() + .then () => + @appTitle.set(@scope.project.name) loadInitialData: -> # Resolve project slug diff --git a/app/coffee/modules/search.coffee b/app/coffee/modules/search.coffee index 4ffbab0a..6cbaa33b 100644 --- a/app/coffee/modules/search.coffee +++ b/app/coffee/modules/search.coffee @@ -40,13 +40,18 @@ class SearchController extends mixOf(taiga.Controller, taiga.PageMixin) "$tgResources", "$routeParams", "$q", - "$location" + "$location", + "$appTitle" ] - constructor: (@scope, @repo, @rs, @params, @q, @location) -> + constructor: (@scope, @repo, @rs, @params, @q, @location, @appTitle) -> @scope.sectionName = "Search" promise = @.loadInitialData() + + promise.then () => + @appTitle.set("Search") + promise.then null, -> console.log "FAIL" #TODO diff --git a/app/coffee/modules/taskboard/main.coffee b/app/coffee/modules/taskboard/main.coffee index baaf1c6e..8409a06a 100644 --- a/app/coffee/modules/taskboard/main.coffee +++ b/app/coffee/modules/taskboard/main.coffee @@ -41,16 +41,21 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin) "$tgConfirm", "$tgResources", "$routeParams", - "$q" + "$q", + "$appTitle" ] - constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q) -> + constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @appTitle) -> _.bindAll(@) @scope.sprintId = @params.id @scope.sectionName = "Taskboard" promise = @.loadInitialData() + + promise.then () => + @appTitle.set("Taskboard - " + @scope.project.name) + promise.then null, -> console.log "FAIL" #TODO diff --git a/app/coffee/modules/tasks/detail.coffee b/app/coffee/modules/tasks/detail.coffee index fd3f7c7f..7cc9c5fa 100644 --- a/app/coffee/modules/tasks/detail.coffee +++ b/app/coffee/modules/tasks/detail.coffee @@ -40,16 +40,21 @@ class TaskDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taig "$routeParams", "$q", "$location", - "$log" + "$log", + "$appTitle" ] - constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @log) -> + constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @log, @appTitle) -> @.attachmentsUrlName = "tasks/attachments" @scope.taskRef = @params.taskref @scope.sectionName = "Task Details" promise = @.loadInitialData() + + promise.then () => + @appTitle.set(@scope.task.subject + " - " + @scope.project.name) + promise.then null, -> console.log "FAIL" #TODO diff --git a/app/coffee/modules/userstories/detail.coffee b/app/coffee/modules/userstories/detail.coffee index fbb1734c..68cb4451 100644 --- a/app/coffee/modules/userstories/detail.coffee +++ b/app/coffee/modules/userstories/detail.coffee @@ -41,16 +41,21 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin, "$routeParams", "$q", "$location", - "$log" + "$log", + "$appTitle" ] - constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @log) -> + constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @log, @appTitle) -> @.attachmentsUrlName = "userstories/attachments" @scope.issueRef = @params.issueref @scope.sectionName = "User Story Details" promise = @.loadInitialData() + + promise.then () => + @appTitle.set(@scope.us.subject + " - " + @scope.project.name) + promise.then null, -> console.log "FAIL" #TODO diff --git a/app/coffee/modules/wiki/main.coffee b/app/coffee/modules/wiki/main.coffee index e5963dde..d06002fe 100644 --- a/app/coffee/modules/wiki/main.coffee +++ b/app/coffee/modules/wiki/main.coffee @@ -43,10 +43,11 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taig "$q", "$location", "$filter", - "$log" + "$log", + "$appTitle" ] - constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @filter, @log) -> + constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @filter, @log, @appTitle) -> @.attachmentsUrlName = "wiki/attachments" @scope.projectSlug = @params.pslug @@ -54,6 +55,10 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taig @scope.sectionName = "Wiki" promise = @.loadInitialData() + + promise.then () => + @appTitle.set("Wiki - " + @scope.project.name) + promise.then null, -> console.log "FAIL" #TODO diff --git a/app/index.jade b/app/index.jade index 4c279563..7d4741d9 100644 --- a/app/index.jade +++ b/app/index.jade @@ -2,7 +2,7 @@ doctype html html(lang="en", ng-app="taiga") head meta(charset="utf-8") - title= Taiga + title Taiga meta(http-equiv="content-type", content="text/html; charset=utf-8") meta(name="description", content="Taiga Landing page") meta(name="keywords", content="Agile, Taiga, Management, Github")