load project in the routerProvider resolve
parent
4a2ee578b4
commit
b2860e8a53
|
@ -57,6 +57,19 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
|
||||||
|
|
||||||
$translate().then () -> deferred.resolve()
|
$translate().then () -> deferred.resolve()
|
||||||
|
|
||||||
|
return deferred.promise
|
||||||
|
],
|
||||||
|
projectLoaded: ["$q", "tgProjectService", "$route", ($q, projectService, $route) ->
|
||||||
|
deferred = $q.defer()
|
||||||
|
|
||||||
|
projectService.setSection($route.current.$$route.section)
|
||||||
|
|
||||||
|
if $route.current.params.pslug
|
||||||
|
projectService.setProjectBySlug($route.current.params.pslug).then(deferred.resolve)
|
||||||
|
else
|
||||||
|
projectService.cleanProject()
|
||||||
|
deferred.resolve()
|
||||||
|
|
||||||
return deferred.promise
|
return deferred.promise
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
@ -659,7 +672,7 @@ i18nInit = (lang, $translate) ->
|
||||||
checksley.updateMessages('default', messages)
|
checksley.updateMessages('default', messages)
|
||||||
|
|
||||||
|
|
||||||
init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $navUrls, appMetaService, projectService, loaderService, navigationBarService, errorHandlingService) ->
|
init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $navUrls, appMetaService, loaderService, navigationBarService, errorHandlingService) ->
|
||||||
$log.debug("Initialize application")
|
$log.debug("Initialize application")
|
||||||
|
|
||||||
$rootscope.$on '$translatePartialLoaderStructureChanged', () ->
|
$rootscope.$on '$translatePartialLoaderStructureChanged', () ->
|
||||||
|
@ -722,13 +735,6 @@ init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $na
|
||||||
if !$auth.isAuthenticated()
|
if !$auth.isAuthenticated()
|
||||||
$location.path($navUrls.resolve("login"))
|
$location.path($navUrls.resolve("login"))
|
||||||
|
|
||||||
projectService.setSection(next.section)
|
|
||||||
|
|
||||||
if next.params.pslug
|
|
||||||
projectService.setProjectBySlug(next.params.pslug)
|
|
||||||
else
|
|
||||||
projectService.cleanProject()
|
|
||||||
|
|
||||||
if next.title or next.description
|
if next.title or next.description
|
||||||
title = $translate.instant(next.title or "")
|
title = $translate.instant(next.title or "")
|
||||||
description = $translate.instant(next.description or "")
|
description = $translate.instant(next.description or "")
|
||||||
|
@ -826,7 +832,6 @@ module.run([
|
||||||
"$tgLocation",
|
"$tgLocation",
|
||||||
"$tgNavUrls",
|
"$tgNavUrls",
|
||||||
"tgAppMetaService",
|
"tgAppMetaService",
|
||||||
"tgProjectService",
|
|
||||||
"tgLoader",
|
"tgLoader",
|
||||||
"tgNavigationBarService",
|
"tgNavigationBarService",
|
||||||
"tgErrorHandlingService",
|
"tgErrorHandlingService",
|
||||||
|
|
Loading…
Reference in New Issue