Fix: Use $tgNavUrls to get urls
parent
add92dddf4
commit
69af98d3bf
|
@ -40,10 +40,11 @@ class MembershipsController extends mixOf(taiga.Controller, taiga.PageMixin, tai
|
||||||
"$routeParams",
|
"$routeParams",
|
||||||
"$q",
|
"$q",
|
||||||
"$tgLocation",
|
"$tgLocation",
|
||||||
|
"$tgNavUrls",
|
||||||
"$appTitle"
|
"$appTitle"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle) ->
|
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @navUrls, @appTitle) ->
|
||||||
_.bindAll(@)
|
_.bindAll(@)
|
||||||
|
|
||||||
@scope.sectionName = "Manage Members" #i18n
|
@scope.sectionName = "Manage Members" #i18n
|
||||||
|
@ -55,8 +56,11 @@ class MembershipsController extends mixOf(taiga.Controller, taiga.PageMixin, tai
|
||||||
promise.then () =>
|
promise.then () =>
|
||||||
@appTitle.set("Membership - " + @scope.project.name)
|
@appTitle.set("Membership - " + @scope.project.name)
|
||||||
|
|
||||||
promise.then null, ->
|
promise.then null, (xhr) =>
|
||||||
console.log "FAIL" #TODO
|
if xhr and xhr.status == 404
|
||||||
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
|
@location.replace()
|
||||||
|
return @q.reject(xhr)
|
||||||
|
|
||||||
@scope.$on("membersform:new:success", @.loadMembers)
|
@scope.$on("membersform:new:success", @.loadMembers)
|
||||||
|
|
||||||
|
@ -80,10 +84,6 @@ class MembershipsController extends mixOf(taiga.Controller, taiga.PageMixin, tai
|
||||||
@scope.projectId = data.project
|
@scope.projectId = data.project
|
||||||
return data
|
return data
|
||||||
|
|
||||||
promise.then null, =>
|
|
||||||
@location.path("/not-found")
|
|
||||||
@location.replace()
|
|
||||||
|
|
||||||
return promise.then(=> @.loadProject())
|
return promise.then(=> @.loadProject())
|
||||||
.then(=> @.loadUsersAndRoles())
|
.then(=> @.loadUsersAndRoles())
|
||||||
.then(=> @.loadMembers())
|
.then(=> @.loadMembers())
|
||||||
|
|
|
@ -45,10 +45,11 @@ class ProjectProfileController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
"$routeParams",
|
"$routeParams",
|
||||||
"$q",
|
"$q",
|
||||||
"$tgLocation",
|
"$tgLocation",
|
||||||
|
"$tgNavUrls",
|
||||||
"$appTitle"
|
"$appTitle"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle) ->
|
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @navUrls, @appTitle) ->
|
||||||
@scope.project = {}
|
@scope.project = {}
|
||||||
|
|
||||||
promise = @.loadInitialData()
|
promise = @.loadInitialData()
|
||||||
|
@ -58,7 +59,7 @@ class ProjectProfileController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
|
|
||||||
promise.then null, (xhr) =>
|
promise.then null, (xhr) =>
|
||||||
if xhr and xhr.status == 404
|
if xhr and xhr.status == 404
|
||||||
@location.path("/not-found")
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
@location.replace()
|
@location.replace()
|
||||||
return @q.reject(xhr)
|
return @q.reject(xhr)
|
||||||
|
|
||||||
|
|
|
@ -44,10 +44,11 @@ class ProjectValuesController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
"$routeParams",
|
"$routeParams",
|
||||||
"$q",
|
"$q",
|
||||||
"$tgLocation",
|
"$tgLocation",
|
||||||
|
"$tgNavUrls",
|
||||||
"$appTitle"
|
"$appTitle"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle) ->
|
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @navUrls, @appTitle) ->
|
||||||
@scope.project = {}
|
@scope.project = {}
|
||||||
|
|
||||||
promise = @.loadInitialData()
|
promise = @.loadInitialData()
|
||||||
|
@ -55,8 +56,11 @@ class ProjectValuesController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
promise.then () =>
|
promise.then () =>
|
||||||
@appTitle.set("Project values - " + @scope.sectionName + " - " + @scope.project.name)
|
@appTitle.set("Project values - " + @scope.sectionName + " - " + @scope.project.name)
|
||||||
|
|
||||||
promise.then null, ->
|
promise.then null, (xhr) =>
|
||||||
console.log "FAIL" #TODO
|
if xhr and xhr.status == 404
|
||||||
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
|
@location.replace()
|
||||||
|
return @q.reject(xhr)
|
||||||
|
|
||||||
@scope.$on("admin:project-values:move", @.moveValue)
|
@scope.$on("admin:project-values:move", @.moveValue)
|
||||||
|
|
||||||
|
@ -76,10 +80,6 @@ class ProjectValuesController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
@scope.projectId = data.project
|
@scope.projectId = data.project
|
||||||
return data
|
return data
|
||||||
|
|
||||||
promise.then null, =>
|
|
||||||
@location.path("/not-found")
|
|
||||||
@location.replace()
|
|
||||||
|
|
||||||
return promise.then( => @q.all([
|
return promise.then( => @q.all([
|
||||||
@.loadProject(),
|
@.loadProject(),
|
||||||
@.loadValues(),
|
@.loadValues(),
|
||||||
|
|
|
@ -41,10 +41,11 @@ class RolesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fil
|
||||||
"$routeParams",
|
"$routeParams",
|
||||||
"$q",
|
"$q",
|
||||||
"$tgLocation",
|
"$tgLocation",
|
||||||
|
"$tgNavUrls",
|
||||||
"$appTitle"
|
"$appTitle"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle) ->
|
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @navUrls, @appTitle) ->
|
||||||
_.bindAll(@)
|
_.bindAll(@)
|
||||||
|
|
||||||
@scope.sectionName = "Permissions" #i18n
|
@scope.sectionName = "Permissions" #i18n
|
||||||
|
@ -55,8 +56,11 @@ class RolesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fil
|
||||||
promise.then () =>
|
promise.then () =>
|
||||||
@appTitle.set("Roles - " + @scope.project.name)
|
@appTitle.set("Roles - " + @scope.project.name)
|
||||||
|
|
||||||
promise.then null, ->
|
promise.then null, (xhr) =>
|
||||||
console.log "FAIL" #TODO
|
if xhr and xhr.status == 404
|
||||||
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
|
@location.replace()
|
||||||
|
return @q.reject(xhr)
|
||||||
|
|
||||||
loadProject: ->
|
loadProject: ->
|
||||||
return @rs.projects.get(@scope.projectId).then (project) =>
|
return @rs.projects.get(@scope.projectId).then (project) =>
|
||||||
|
@ -75,10 +79,6 @@ class RolesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fil
|
||||||
@scope.projectId = data.project
|
@scope.projectId = data.project
|
||||||
return data
|
return data
|
||||||
|
|
||||||
promise.then null, =>
|
|
||||||
@location.path("/not-found")
|
|
||||||
@location.replace()
|
|
||||||
|
|
||||||
return promise.then(=> @.loadProject())
|
return promise.then(=> @.loadProject())
|
||||||
.then(=> @.loadUsersAndRoles())
|
.then(=> @.loadUsersAndRoles())
|
||||||
.then(=> @.loadRoles())
|
.then(=> @.loadRoles())
|
||||||
|
|
|
@ -214,7 +214,7 @@ module.directive("tgLogin", ["$tgAuth", "$tgConfirm", "$tgLocation", "$routePara
|
||||||
RegisterDirective = ($auth, $confirm, $location, $navUrls, $config) ->
|
RegisterDirective = ($auth, $confirm, $location, $navUrls, $config) ->
|
||||||
link = ($scope, $el, $attrs) ->
|
link = ($scope, $el, $attrs) ->
|
||||||
if not $config.get("publicRegisterEnabled")
|
if not $config.get("publicRegisterEnabled")
|
||||||
$location.path("/not-found")
|
$location.path($navUrls.resolve("not-found"))
|
||||||
$location.replace()
|
$location.replace()
|
||||||
|
|
||||||
$scope.data = {}
|
$scope.data = {}
|
||||||
|
|
|
@ -45,10 +45,12 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
|
||||||
"$q",
|
"$q",
|
||||||
"$tgLocation",
|
"$tgLocation",
|
||||||
"$appTitle",
|
"$appTitle",
|
||||||
|
"$tgNavUrls",
|
||||||
"tgLoader"
|
"tgLoader"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle, tgLoader) ->
|
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle, @navUrls,
|
||||||
|
tgLoader) ->
|
||||||
_.bindAll(@)
|
_.bindAll(@)
|
||||||
|
|
||||||
@scope.sectionName = "Backlog"
|
@scope.sectionName = "Backlog"
|
||||||
|
@ -76,7 +78,7 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
|
||||||
# On Error
|
# On Error
|
||||||
promise.then null, (xhr) =>
|
promise.then null, (xhr) =>
|
||||||
if xhr and xhr.status == 404
|
if xhr and xhr.status == 404
|
||||||
@location.path("/not-found")
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
@location.replace()
|
@location.replace()
|
||||||
return @q.reject(xhr)
|
return @q.reject(xhr)
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,8 @@ module.directive("tgMain", ["$rootScope", "$window", TaigaMainDirective])
|
||||||
urls = {
|
urls = {
|
||||||
"home": "/"
|
"home": "/"
|
||||||
"error": "/error"
|
"error": "/error"
|
||||||
|
"not-found": "/not-found"
|
||||||
|
|
||||||
"login": "/login"
|
"login": "/login"
|
||||||
"forgot-password": "/forgot-password"
|
"forgot-password": "/forgot-password"
|
||||||
"change-password": "/change-password/:token"
|
"change-password": "/change-password/:token"
|
||||||
|
|
|
@ -61,7 +61,7 @@ class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
# On Error
|
# On Error
|
||||||
promise.then null, (xhr) =>
|
promise.then null, (xhr) =>
|
||||||
if xhr and xhr.status == 404
|
if xhr and xhr.status == 404
|
||||||
@location.path("/not-found")
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
@location.replace()
|
@location.replace()
|
||||||
return @q.reject(xhr)
|
return @q.reject(xhr)
|
||||||
|
|
||||||
|
|
|
@ -48,10 +48,12 @@ class IssuesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
||||||
"$q",
|
"$q",
|
||||||
"$tgLocation",
|
"$tgLocation",
|
||||||
"$appTitle",
|
"$appTitle",
|
||||||
|
"$tgNavUrls",
|
||||||
"tgLoader"
|
"tgLoader"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @urls, @params, @q, @location, @appTitle, tgLoader) ->
|
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @urls, @params, @q, @location, @appTitle,
|
||||||
|
@navUrls, tgLoader) ->
|
||||||
@scope.sectionName = "Issues"
|
@scope.sectionName = "Issues"
|
||||||
@scope.filters = {}
|
@scope.filters = {}
|
||||||
|
|
||||||
|
@ -72,7 +74,7 @@ class IssuesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
||||||
# On Error
|
# On Error
|
||||||
promise.then null, (xhr) =>
|
promise.then null, (xhr) =>
|
||||||
if xhr and xhr.status == 404
|
if xhr and xhr.status == 404
|
||||||
@location.path("/not-found")
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
@location.replace()
|
@location.replace()
|
||||||
return @q.reject(xhr)
|
return @q.reject(xhr)
|
||||||
|
|
||||||
|
|
|
@ -58,10 +58,12 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
||||||
"$q",
|
"$q",
|
||||||
"$tgLocation",
|
"$tgLocation",
|
||||||
"$appTitle",
|
"$appTitle",
|
||||||
|
"$tgNavUrls",
|
||||||
"tgLoader"
|
"tgLoader"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle, tgLoader) ->
|
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @appTitle, @navUrls,
|
||||||
|
tgLoader) ->
|
||||||
_.bindAll(@)
|
_.bindAll(@)
|
||||||
@scope.sectionName = "Kanban"
|
@scope.sectionName = "Kanban"
|
||||||
@scope.statusViewModes = {}
|
@scope.statusViewModes = {}
|
||||||
|
@ -73,17 +75,10 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
||||||
@appTitle.set("Kanban - " + @scope.project.name)
|
@appTitle.set("Kanban - " + @scope.project.name)
|
||||||
tgLoader.pageLoaded()
|
tgLoader.pageLoaded()
|
||||||
|
|
||||||
# $(".task-column").mCustomScrollbar({
|
|
||||||
# theme: 'minimal-dark'
|
|
||||||
# scrollInertia: 0
|
|
||||||
# axis: 'y'
|
|
||||||
# });
|
|
||||||
|
|
||||||
|
|
||||||
# On Error
|
# On Error
|
||||||
promise.then null, (xhr) =>
|
promise.then null, (xhr) =>
|
||||||
if xhr and xhr.status == 404
|
if xhr and xhr.status == 404
|
||||||
@location.path("/not-found")
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
@location.replace()
|
@location.replace()
|
||||||
return @q.reject(xhr)
|
return @q.reject(xhr)
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ bindOnce = @.taiga.bindOnce
|
||||||
class ProjectsController extends taiga.Controller
|
class ProjectsController extends taiga.Controller
|
||||||
@.$inject = [
|
@.$inject = [
|
||||||
"$scope",
|
"$scope",
|
||||||
|
"$q",
|
||||||
"$tgResources",
|
"$tgResources",
|
||||||
"$rootScope",
|
"$rootScope",
|
||||||
"$tgNavUrls",
|
"$tgNavUrls",
|
||||||
|
@ -36,20 +37,28 @@ class ProjectsController extends taiga.Controller
|
||||||
"tgLoader"
|
"tgLoader"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @rs, @rootscope, @navurls, @auth, @location, @appTitle, @projectUrl, @tgLoader, @navUrls) ->
|
constructor: (@scope, @q, @rs, @rootscope, @navUrls, @auth, @location, @appTitle, @projectUrl,
|
||||||
|
@tgLoader) ->
|
||||||
@appTitle.set("Projects")
|
@appTitle.set("Projects")
|
||||||
|
|
||||||
if !@auth.isAuthenticated()
|
if !@auth.isAuthenticated()
|
||||||
@location.path(@navurls.resolve("login"))
|
@location.path(@navUrls.resolve("login"))
|
||||||
|
|
||||||
@.user = @auth.getUser()
|
@.user = @auth.getUser()
|
||||||
|
|
||||||
@.projects = []
|
@.projects = []
|
||||||
@.loadInitialData()
|
promise = @.loadInitialData()
|
||||||
.then () =>
|
|
||||||
|
promise.then () =>
|
||||||
@scope.$emit("projects:loaded")
|
@scope.$emit("projects:loaded")
|
||||||
@tgLoader.pageLoaded()
|
@tgLoader.pageLoaded()
|
||||||
|
|
||||||
|
promise.then null, (xhr) =>
|
||||||
|
if xhr and xhr.status == 404
|
||||||
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
|
@location.replace()
|
||||||
|
return @q.reject(xhr)
|
||||||
|
|
||||||
loadInitialData: ->
|
loadInitialData: ->
|
||||||
return @rs.projects.list().then (projects) =>
|
return @rs.projects.list().then (projects) =>
|
||||||
@.projects = {'recents': projects.slice(0, 8), 'all': projects.slice(8)}
|
@.projects = {'recents': projects.slice(0, 8), 'all': projects.slice(8)}
|
||||||
|
@ -57,12 +66,14 @@ class ProjectsController extends taiga.Controller
|
||||||
for project in projects
|
for project in projects
|
||||||
project.url = @projectUrl.get(project)
|
project.url = @projectUrl.get(project)
|
||||||
|
|
||||||
|
return projects
|
||||||
|
|
||||||
newProject: ->
|
newProject: ->
|
||||||
@rootscope.$broadcast("projects:create")
|
@rootscope.$broadcast("projects:create")
|
||||||
|
|
||||||
logout: ->
|
logout: ->
|
||||||
@auth.logout()
|
@auth.logout()
|
||||||
@location.path(@navurls.resolve("login"))
|
@location.path(@navUrls.resolve("login"))
|
||||||
|
|
||||||
module.controller("ProjectsController", ProjectsController)
|
module.controller("ProjectsController", ProjectsController)
|
||||||
|
|
||||||
|
@ -76,26 +87,29 @@ class ProjectController extends taiga.Controller
|
||||||
"$q",
|
"$q",
|
||||||
"$rootScope",
|
"$rootScope",
|
||||||
"$appTitle",
|
"$appTitle",
|
||||||
"$tgLocation"
|
"$tgLocation",
|
||||||
|
"$tgNavUrls"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @rs, @repo, @params, @q, @rootscope, @appTitle, @location) ->
|
constructor: (@scope, @rs, @repo, @params, @q, @rootscope, @appTitle, @location, @navUrls) ->
|
||||||
@.loadInitialData()
|
promise = @.loadInitialData()
|
||||||
.then () =>
|
|
||||||
|
promise.then () =>
|
||||||
@appTitle.set(@scope.project.name)
|
@appTitle.set(@scope.project.name)
|
||||||
|
|
||||||
|
promise.then null, (xhr) =>
|
||||||
|
if xhr and xhr.status == 404
|
||||||
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
|
@location.replace()
|
||||||
|
return @q.reject(xhr)
|
||||||
|
|
||||||
loadInitialData: ->
|
loadInitialData: ->
|
||||||
# Resolve project slug
|
# Resolve project slug
|
||||||
promise = @repo.resolve({pslug: @params.pslug}).then (data) =>
|
promise = @repo.resolve({pslug: @params.pslug}).then (data) =>
|
||||||
@scope.projectId = data.project
|
@scope.projectId = data.project
|
||||||
return data
|
return data
|
||||||
|
|
||||||
promise.then null, =>
|
return promise.then(=> @.loadPageData())
|
||||||
@location.path("/not-found")
|
|
||||||
@location.replace()
|
|
||||||
|
|
||||||
return promise
|
|
||||||
.then(=> @.loadPageData())
|
|
||||||
.then(=> @scope.$emit("project:loaded", @scope.project))
|
.then(=> @scope.$emit("project:loaded", @scope.project))
|
||||||
|
|
||||||
loadPageData: ->
|
loadPageData: ->
|
||||||
|
|
|
@ -43,10 +43,11 @@ class SearchController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
"$q",
|
"$q",
|
||||||
"$tgLocation",
|
"$tgLocation",
|
||||||
"$appTitle",
|
"$appTitle",
|
||||||
|
"$tgNavUrls",
|
||||||
"tgLoader"
|
"tgLoader"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @repo, @rs, @params, @q, @location, @appTitle, @tgLoader) ->
|
constructor: (@scope, @repo, @rs, @params, @q, @location, @appTitle, @navUrls, @tgLoader) ->
|
||||||
@scope.sectionName = "Search"
|
@scope.sectionName = "Search"
|
||||||
|
|
||||||
promise = @.loadInitialData()
|
promise = @.loadInitialData()
|
||||||
|
@ -54,8 +55,11 @@ class SearchController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
promise.then () =>
|
promise.then () =>
|
||||||
@appTitle.set("Search")
|
@appTitle.set("Search")
|
||||||
|
|
||||||
promise.then null, ->
|
promise.then null, (xhr) =>
|
||||||
console.log "FAIL" #TODO
|
if xhr and xhr.status == 404
|
||||||
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
|
@location.replace()
|
||||||
|
return @q.reject(xhr)
|
||||||
|
|
||||||
# Search input watcher
|
# Search input watcher
|
||||||
@scope.searchTerm = ""
|
@scope.searchTerm = ""
|
||||||
|
@ -97,10 +101,6 @@ class SearchController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
@scope.projectId = data.project
|
@scope.projectId = data.project
|
||||||
return data
|
return data
|
||||||
|
|
||||||
promise.then null, =>
|
|
||||||
@location.path("/not-found")
|
|
||||||
@location.replace()
|
|
||||||
|
|
||||||
return promise.then(=> @.loadProject())
|
return promise.then(=> @.loadProject())
|
||||||
.then(=> @.loadUsersAndRoles())
|
.then(=> @.loadUsersAndRoles())
|
||||||
|
|
||||||
|
|
|
@ -45,10 +45,12 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
"$q",
|
"$q",
|
||||||
"$appTitle",
|
"$appTitle",
|
||||||
"$tgLocation",
|
"$tgLocation",
|
||||||
|
"$tgNavUrls"
|
||||||
"tgLoader"
|
"tgLoader"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @appTitle, @location, tgLoader) ->
|
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @appTitle, @location, @navUrls,
|
||||||
|
tgLoader) ->
|
||||||
_.bindAll(@)
|
_.bindAll(@)
|
||||||
|
|
||||||
@scope.sectionName = "Taskboard"
|
@scope.sectionName = "Taskboard"
|
||||||
|
@ -63,7 +65,7 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
# On Error
|
# On Error
|
||||||
promise.then null, (xhr) =>
|
promise.then null, (xhr) =>
|
||||||
if xhr and xhr.status == 404
|
if xhr and xhr.status == 404
|
||||||
@location.path("/not-found")
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
@location.replace()
|
@location.replace()
|
||||||
return @q.reject(xhr)
|
return @q.reject(xhr)
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,8 @@ class TaskDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
"tgLoader"
|
"tgLoader"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @log, @appTitle, @navUrls, tgLoader) ->
|
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @log, @appTitle, @navUrls,
|
||||||
|
tgLoader) ->
|
||||||
@scope.taskRef = @params.taskref
|
@scope.taskRef = @params.taskref
|
||||||
@scope.sectionName = "Task Details"
|
@scope.sectionName = "Task Details"
|
||||||
|
|
||||||
|
@ -56,8 +57,11 @@ class TaskDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
@appTitle.set(@scope.task.subject + " - " + @scope.project.name)
|
@appTitle.set(@scope.task.subject + " - " + @scope.project.name)
|
||||||
tgLoader.pageLoaded()
|
tgLoader.pageLoaded()
|
||||||
|
|
||||||
promise.then null, ->
|
promise.then null, (xhr) =>
|
||||||
console.log "FAIL" #TODO
|
if xhr and xhr.status == 404
|
||||||
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
|
@location.replace()
|
||||||
|
return @q.reject(xhr)
|
||||||
|
|
||||||
|
|
||||||
@scope.$on("attachment:create", => @rootscope.$broadcast("history:reload"))
|
@scope.$on("attachment:create", => @rootscope.$broadcast("history:reload"))
|
||||||
|
@ -111,10 +115,6 @@ class TaskDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
@scope.taskId = data.task
|
@scope.taskId = data.task
|
||||||
return data
|
return data
|
||||||
|
|
||||||
promise.then null, =>
|
|
||||||
@location.path("/not-found")
|
|
||||||
@location.replace()
|
|
||||||
|
|
||||||
return promise.then(=> @.loadProject())
|
return promise.then(=> @.loadProject())
|
||||||
.then(=> @.loadUsersAndRoles())
|
.then(=> @.loadUsersAndRoles())
|
||||||
.then(=> @.loadTask())
|
.then(=> @.loadTask())
|
||||||
|
|
|
@ -40,17 +40,22 @@ class UserChangePasswordController extends mixOf(taiga.Controller, taiga.PageMix
|
||||||
"$routeParams",
|
"$routeParams",
|
||||||
"$q",
|
"$q",
|
||||||
"$tgLocation",
|
"$tgLocation",
|
||||||
|
"$tgNavUrls",
|
||||||
"$tgAuth"
|
"$tgAuth"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @auth) ->
|
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @navUrls, @auth) ->
|
||||||
@scope.sectionName = "Change Password" #i18n
|
@scope.sectionName = "Change Password" #i18n
|
||||||
@scope.project = {}
|
@scope.project = {}
|
||||||
@scope.user = @auth.getUser()
|
@scope.user = @auth.getUser()
|
||||||
|
|
||||||
promise = @.loadInitialData()
|
promise = @.loadInitialData()
|
||||||
promise.then null, ->
|
|
||||||
console.log "FAIL" #TODO
|
promise.then null, (xhr) =>
|
||||||
|
if xhr and xhr.status == 404
|
||||||
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
|
@location.replace()
|
||||||
|
return @q.reject(xhr)
|
||||||
|
|
||||||
loadProject: ->
|
loadProject: ->
|
||||||
return @rs.projects.get(@scope.projectId).then (project) =>
|
return @rs.projects.get(@scope.projectId).then (project) =>
|
||||||
|
@ -63,10 +68,6 @@ class UserChangePasswordController extends mixOf(taiga.Controller, taiga.PageMix
|
||||||
@scope.projectId = data.project
|
@scope.projectId = data.project
|
||||||
return data
|
return data
|
||||||
|
|
||||||
promise.then null, =>
|
|
||||||
@location.path("/not-found")
|
|
||||||
@location.replace()
|
|
||||||
|
|
||||||
return promise.then(=> @.loadProject())
|
return promise.then(=> @.loadProject())
|
||||||
|
|
||||||
save: ->
|
save: ->
|
||||||
|
|
|
@ -38,17 +38,22 @@ class UserSettingsController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
"$routeParams",
|
"$routeParams",
|
||||||
"$q",
|
"$q",
|
||||||
"$tgLocation",
|
"$tgLocation",
|
||||||
|
"$tgNavUrls",
|
||||||
"$tgAuth"
|
"$tgAuth"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @auth) ->
|
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @navUrls, @auth) ->
|
||||||
@scope.sectionName = "User Profile" #i18n
|
@scope.sectionName = "User Profile" #i18n
|
||||||
@scope.project = {}
|
@scope.project = {}
|
||||||
@scope.user = @auth.getUser()
|
@scope.user = @auth.getUser()
|
||||||
|
|
||||||
promise = @.loadInitialData()
|
promise = @.loadInitialData()
|
||||||
promise.then null, ->
|
|
||||||
console.log "FAIL" #TODO
|
promise.then null, (xhr) =>
|
||||||
|
if xhr and xhr.status == 404
|
||||||
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
|
@location.replace()
|
||||||
|
return @q.reject(xhr)
|
||||||
|
|
||||||
loadProject: ->
|
loadProject: ->
|
||||||
return @rs.projects.get(@scope.projectId).then (project) =>
|
return @rs.projects.get(@scope.projectId).then (project) =>
|
||||||
|
@ -61,10 +66,6 @@ class UserSettingsController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
@scope.projectId = data.project
|
@scope.projectId = data.project
|
||||||
return data
|
return data
|
||||||
|
|
||||||
promise.then null, =>
|
|
||||||
@location.path("/not-found")
|
|
||||||
@location.replace()
|
|
||||||
|
|
||||||
return promise.then(=> @.loadProject())
|
return promise.then(=> @.loadProject())
|
||||||
|
|
||||||
saveUserProfile: ->
|
saveUserProfile: ->
|
||||||
|
|
|
@ -40,17 +40,22 @@ class UserNotificationsController extends mixOf(taiga.Controller, taiga.PageMixi
|
||||||
"$routeParams",
|
"$routeParams",
|
||||||
"$q",
|
"$q",
|
||||||
"$tgLocation",
|
"$tgLocation",
|
||||||
|
"$tgNavUrls",
|
||||||
"$tgAuth"
|
"$tgAuth"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @auth) ->
|
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @navUrls, @auth) ->
|
||||||
@scope.sectionName = "Email Notifications" #i18n
|
@scope.sectionName = "Email Notifications" #i18n
|
||||||
@scope.project = {}
|
@scope.project = {}
|
||||||
@scope.user = @auth.getUser()
|
@scope.user = @auth.getUser()
|
||||||
|
|
||||||
promise = @.loadInitialData()
|
promise = @.loadInitialData()
|
||||||
promise.then null, ->
|
|
||||||
console.log "FAIL" #TODO
|
promise.then null, (xhr) =>
|
||||||
|
if xhr and xhr.status == 404
|
||||||
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
|
@location.replace()
|
||||||
|
return @q.reject(xhr)
|
||||||
|
|
||||||
loadProject: ->
|
loadProject: ->
|
||||||
return @rs.projects.get(@scope.projectId).then (project) =>
|
return @rs.projects.get(@scope.projectId).then (project) =>
|
||||||
|
@ -68,10 +73,6 @@ class UserNotificationsController extends mixOf(taiga.Controller, taiga.PageMixi
|
||||||
@scope.projectId = data.project
|
@scope.projectId = data.project
|
||||||
return data
|
return data
|
||||||
|
|
||||||
promise.then null, =>
|
|
||||||
@location.path("/not-found")
|
|
||||||
@location.replace()
|
|
||||||
|
|
||||||
return promise.then(=> @.loadProject())
|
return promise.then(=> @.loadProject())
|
||||||
.then(=> @.loadNotifyPolicies())
|
.then(=> @.loadNotifyPolicies())
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
# On Error
|
# On Error
|
||||||
promise.then null, (xhr) =>
|
promise.then null, (xhr) =>
|
||||||
if xhr and xhr.status == 404
|
if xhr and xhr.status == 404
|
||||||
@location.path("/not-found")
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
@location.replace()
|
@location.replace()
|
||||||
return @q.reject(xhr)
|
return @q.reject(xhr)
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
# On Error
|
# On Error
|
||||||
promise.then null, (xhr) =>
|
promise.then null, (xhr) =>
|
||||||
if xhr and xhr.status == 404
|
if xhr and xhr.status == 404
|
||||||
@location.path("/not-found")
|
@location.path(@navUrls.resolve("not-found"))
|
||||||
@location.replace()
|
@location.replace()
|
||||||
return @q.reject(xhr)
|
return @q.reject(xhr)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue