set the current page title

stable
Juanfran 2014-08-11 12:41:48 +02:00
parent 4b52dd32e3
commit e644822a25
16 changed files with 110 additions and 31 deletions

View File

@ -39,10 +39,11 @@ class MembershipsController extends mixOf(taiga.Controller, taiga.PageMixin, tai
"$tgResources", "$tgResources",
"$routeParams", "$routeParams",
"$q", "$q",
"$tgLocation" "$tgLocation",
"$appTitle"
] ]
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location) -> constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle) ->
_.bindAll(@) _.bindAll(@)
@scope.sectionName = "Memberships" #i18n @scope.sectionName = "Memberships" #i18n
@ -50,6 +51,10 @@ class MembershipsController extends mixOf(taiga.Controller, taiga.PageMixin, tai
@scope.filters = {} @scope.filters = {}
promise = @.loadInitialData() promise = @.loadInitialData()
promise.then () =>
@appTitle.set("Membership - " + @scope.project.name)
promise.then null, -> promise.then null, ->
console.log "FAIL" #TODO console.log "FAIL" #TODO

View File

@ -43,13 +43,18 @@ class ProjectProfileController extends mixOf(taiga.Controller, taiga.PageMixin)
"$tgResources", "$tgResources",
"$routeParams", "$routeParams",
"$q", "$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 = {} @scope.project = {}
promise = @.loadInitialData() promise = @.loadInitialData()
promise.then () =>
@appTitle.set("Project profile - " + @scope.sectionName + " - " + @scope.project.name)
promise.then null, -> promise.then null, ->
console.log "FAIL" #TODO console.log "FAIL" #TODO

View File

@ -43,13 +43,18 @@ class ProjectValuesController extends mixOf(taiga.Controller, taiga.PageMixin)
"$tgResources", "$tgResources",
"$routeParams", "$routeParams",
"$q", "$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 = {} @scope.project = {}
promise = @.loadInitialData() promise = @.loadInitialData()
promise.then () =>
@appTitle.set("Project values - " + @scope.sectionName + " - " + @scope.project.name)
promise.then null, -> promise.then null, ->
console.log "FAIL" #TODO console.log "FAIL" #TODO

View File

@ -40,16 +40,21 @@ class RolesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fil
"$tgResources", "$tgResources",
"$routeParams", "$routeParams",
"$q", "$q",
"$tgLocation" "$tgLocation",
"$appTitle"
] ]
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location) -> constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle) ->
_.bindAll(@) _.bindAll(@)
@scope.sectionName = "Roles" #i18n @scope.sectionName = "Roles" #i18n
@scope.project = {} @scope.project = {}
promise = @.loadInitialData() promise = @.loadInitialData()
promise.then () =>
@appTitle.set("Roles - " + @scope.project.name)
promise.then null, -> promise.then null, ->
console.log "FAIL" #TODO console.log "FAIL" #TODO

View File

@ -42,10 +42,11 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
"$tgResources", "$tgResources",
"$routeParams", "$routeParams",
"$q", "$q",
"$tgLocation" "$tgLocation",
"$appTitle"
] ]
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location) -> constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle) ->
_.bindAll(@) _.bindAll(@)
@scope.sectionName = "Backlog" @scope.sectionName = "Backlog"
@ -53,6 +54,9 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
promise = @.loadInitialData() promise = @.loadInitialData()
promise.then () =>
@appTitle.set("Backlog - " + @scope.project.name)
promise.then null, => promise.then null, =>
console.log "FAIL" console.log "FAIL"

View File

@ -408,3 +408,15 @@ ToggleCommentDirective = () ->
return {link:link} return {link:link}
module.directive("tgToggleComment", ToggleCommentDirective) module.directive("tgToggleComment", ToggleCommentDirective)
#############################################################################
## Set the page title
#############################################################################
AppTitle = () ->
set = (text) ->
$("title").text(text)
return {set: set}
module.factory("$appTitle", AppTitle)

View File

@ -43,16 +43,21 @@ class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin, tai
"$routeParams", "$routeParams",
"$q", "$q",
"$location", "$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" @.attachmentsUrlName = "issues/attachments"
@scope.issueRef = @params.issueref @scope.issueRef = @params.issueref
@scope.sectionName = "Issue Details" @scope.sectionName = "Issue Details"
promise = @.loadInitialData() promise = @.loadInitialData()
promise.then () =>
@appTitle.set(@scope.issue.subject + " - " + @scope.project.name)
promise.then null, -> promise.then null, ->
console.log "FAIL" #TODO console.log "FAIL" #TODO

View File

@ -45,15 +45,20 @@ class IssuesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
"$tgResources", "$tgResources",
"$routeParams", "$routeParams",
"$q", "$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.sprintId = @params.id
@scope.sectionName = "Issues" @scope.sectionName = "Issues"
@scope.filters = {} @scope.filters = {}
promise = @.loadInitialData() promise = @.loadInitialData()
promise.then () =>
@appTitle.set("Issues - " + @scope.project.name)
promise.then null, -> promise.then null, ->
console.log "FAIL" #TODO console.log "FAIL" #TODO

View File

@ -43,15 +43,19 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
"$tgResources", "$tgResources",
"$routeParams", "$routeParams",
"$q", "$q",
"$tgLocation" "$tgLocation",
"$appTitle"
] ]
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location) -> constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle) ->
_.bindAll(@) _.bindAll(@)
@scope.sectionName = "Kanban" @scope.sectionName = "Kanban"
promise = @.loadInitialData() promise = @.loadInitialData()
promise.then () =>
@appTitle.set("Kanban - " + @scope.project.name)
promise.then null, => promise.then null, =>
console.log "FAIL" console.log "FAIL"

View File

@ -12,9 +12,11 @@ class ProjectNavController extends taiga.Controller
module.controller("ProjectNavController", ProjectNavController) module.controller("ProjectNavController", ProjectNavController)
class ProjectsController extends taiga.Controller 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() if !$auth.isAuthenticated()
$location.path("/login") $location.path("/login")
@ -45,11 +47,13 @@ class ProjectsController extends taiga.Controller
module.controller("ProjectsController", ProjectsController) module.controller("ProjectsController", ProjectsController)
class ProjectController extends taiga.Controller 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 @scope.hideMenu = false
@.loadInitialData() @.loadInitialData()
.then () =>
@appTitle.set(@scope.project.name)
loadInitialData: -> loadInitialData: ->
# Resolve project slug # Resolve project slug

View File

@ -40,13 +40,18 @@ class SearchController extends mixOf(taiga.Controller, taiga.PageMixin)
"$tgResources", "$tgResources",
"$routeParams", "$routeParams",
"$q", "$q",
"$location" "$location",
"$appTitle"
] ]
constructor: (@scope, @repo, @rs, @params, @q, @location) -> constructor: (@scope, @repo, @rs, @params, @q, @location, @appTitle) ->
@scope.sectionName = "Search" @scope.sectionName = "Search"
promise = @.loadInitialData() promise = @.loadInitialData()
promise.then () =>
@appTitle.set("Search")
promise.then null, -> promise.then null, ->
console.log "FAIL" #TODO console.log "FAIL" #TODO

View File

@ -41,16 +41,21 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin)
"$tgConfirm", "$tgConfirm",
"$tgResources", "$tgResources",
"$routeParams", "$routeParams",
"$q" "$q",
"$appTitle"
] ]
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q) -> constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @appTitle) ->
_.bindAll(@) _.bindAll(@)
@scope.sprintId = @params.id @scope.sprintId = @params.id
@scope.sectionName = "Taskboard" @scope.sectionName = "Taskboard"
promise = @.loadInitialData() promise = @.loadInitialData()
promise.then () =>
@appTitle.set("Taskboard - " + @scope.project.name)
promise.then null, -> promise.then null, ->
console.log "FAIL" #TODO console.log "FAIL" #TODO

View File

@ -40,16 +40,21 @@ class TaskDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taig
"$routeParams", "$routeParams",
"$q", "$q",
"$location", "$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" @.attachmentsUrlName = "tasks/attachments"
@scope.taskRef = @params.taskref @scope.taskRef = @params.taskref
@scope.sectionName = "Task Details" @scope.sectionName = "Task Details"
promise = @.loadInitialData() promise = @.loadInitialData()
promise.then () =>
@appTitle.set(@scope.task.subject + " - " + @scope.project.name)
promise.then null, -> promise.then null, ->
console.log "FAIL" #TODO console.log "FAIL" #TODO

View File

@ -41,16 +41,21 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin,
"$routeParams", "$routeParams",
"$q", "$q",
"$location", "$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" @.attachmentsUrlName = "userstories/attachments"
@scope.issueRef = @params.issueref @scope.issueRef = @params.issueref
@scope.sectionName = "User Story Details" @scope.sectionName = "User Story Details"
promise = @.loadInitialData() promise = @.loadInitialData()
promise.then () =>
@appTitle.set(@scope.us.subject + " - " + @scope.project.name)
promise.then null, -> promise.then null, ->
console.log "FAIL" #TODO console.log "FAIL" #TODO

View File

@ -43,10 +43,11 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taig
"$q", "$q",
"$location", "$location",
"$filter", "$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" @.attachmentsUrlName = "wiki/attachments"
@scope.projectSlug = @params.pslug @scope.projectSlug = @params.pslug
@ -54,6 +55,10 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taig
@scope.sectionName = "Wiki" @scope.sectionName = "Wiki"
promise = @.loadInitialData() promise = @.loadInitialData()
promise.then () =>
@appTitle.set("Wiki - " + @scope.project.name)
promise.then null, -> promise.then null, ->
console.log "FAIL" #TODO console.log "FAIL" #TODO

View File

@ -2,7 +2,7 @@ doctype html
html(lang="en", ng-app="taiga") html(lang="en", ng-app="taiga")
head head
meta(charset="utf-8") meta(charset="utf-8")
title= Taiga title Taiga
meta(http-equiv="content-type", content="text/html; charset=utf-8") meta(http-equiv="content-type", content="text/html; charset=utf-8")
meta(name="description", content="Taiga Landing page") meta(name="description", content="Taiga Landing page")
meta(name="keywords", content="Agile, Taiga, Management, Github") meta(name="keywords", content="Agile, Taiga, Management, Github")