Updating user settings urls
parent
1a75748763
commit
61d5f47157
|
@ -125,11 +125,11 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
|
|||
{templateUrl: "contrib/main.html"})
|
||||
|
||||
# User settings
|
||||
$routeProvider.when("/project/:pslug/user-settings/user-profile",
|
||||
$routeProvider.when("/user-settings/user-profile",
|
||||
{templateUrl: "user/user-profile.html"})
|
||||
$routeProvider.when("/project/:pslug/user-settings/user-change-password",
|
||||
$routeProvider.when("/user-settings/user-change-password",
|
||||
{templateUrl: "user/user-change-password.html"})
|
||||
$routeProvider.when("/project/:pslug/user-settings/mail-notifications",
|
||||
$routeProvider.when("/user-settings/mail-notifications",
|
||||
{templateUrl: "user/mail-notifications.html"})
|
||||
$routeProvider.when("/change-email/:email_token",
|
||||
{templateUrl: "user/change-email.html"})
|
||||
|
|
|
@ -103,10 +103,10 @@ urls = {
|
|||
"project-admin-contrib": "/project/:project/admin/contrib/:plugin"
|
||||
|
||||
# User settings
|
||||
"user-settings-user-profile": "/project/:project/user-settings/user-profile"
|
||||
"user-settings-user-change-password": "/project/:project/user-settings/user-change-password"
|
||||
"user-settings-user-avatar": "/project/:project/user-settings/user-avatar"
|
||||
"user-settings-mail-notifications": "/project/:project/user-settings/mail-notifications"
|
||||
"user-settings-user-profile": "/user-settings/user-profile"
|
||||
"user-settings-user-change-password": "/user-settings/user-change-password"
|
||||
"user-settings-user-avatar": "/user-settings/user-avatar"
|
||||
"user-settings-mail-notifications": "/user-settings/mail-notifications"
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -49,23 +49,8 @@ class UserChangePasswordController extends mixOf(taiga.Controller, taiga.PageMix
|
|||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @navUrls,
|
||||
@auth, @translate) ->
|
||||
@scope.sectionName = @translate.instant("CHANGE_PASSWORD.SECTION_NAME")
|
||||
@scope.project = {}
|
||||
@scope.user = @auth.getUser()
|
||||
|
||||
promise = @.loadInitialData()
|
||||
|
||||
promise.then null, @.onInitialDataError.bind(@)
|
||||
|
||||
loadProject: ->
|
||||
return @rs.projects.getBySlug(@params.pslug).then (project) =>
|
||||
@scope.projectId = project.id
|
||||
@scope.project = project
|
||||
@scope.$emit('project:loaded', project)
|
||||
return project
|
||||
|
||||
loadInitialData: ->
|
||||
return @.loadProject()
|
||||
|
||||
module.controller("UserChangePasswordController", UserChangePasswordController)
|
||||
|
||||
|
||||
|
|
|
@ -62,23 +62,11 @@ class UserSettingsController extends mixOf(taiga.Controller, taiga.PageMixin)
|
|||
|
||||
promise.then null, @.onInitialDataError.bind(@)
|
||||
|
||||
loadProject: ->
|
||||
return @rs.projects.getBySlug(@params.pslug).then (project) =>
|
||||
@scope.projectId = project.id
|
||||
@scope.project = project
|
||||
@scope.$emit('project:loaded', project)
|
||||
return project
|
||||
|
||||
loadLocales: ->
|
||||
loadInitialData: ->
|
||||
return @rs.locales.list().then (locales) =>
|
||||
@scope.locales = locales
|
||||
return locales
|
||||
|
||||
loadInitialData: ->
|
||||
promise = @.loadProject()
|
||||
promise.then => @.loadLocales()
|
||||
return promise
|
||||
|
||||
openDeleteLightbox: ->
|
||||
@rootscope.$broadcast("deletelightbox:new", @scope.user)
|
||||
|
||||
|
|
|
@ -46,30 +46,15 @@ class UserNotificationsController extends mixOf(taiga.Controller, taiga.PageMixi
|
|||
|
||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @navUrls, @auth) ->
|
||||
@scope.sectionName = "USER_SETTINGS.NOTIFICATIONS.SECTION_NAME"
|
||||
@scope.project = {}
|
||||
@scope.user = @auth.getUser()
|
||||
|
||||
promise = @.loadInitialData()
|
||||
|
||||
promise.then null, @.onInitialDataError.bind(@)
|
||||
|
||||
loadProject: ->
|
||||
return @rs.projects.getBySlug(@params.pslug).then (project) =>
|
||||
@scope.projectId = project.id
|
||||
@scope.project = project
|
||||
@scope.$emit('project:loaded', project)
|
||||
return project
|
||||
|
||||
loadNotifyPolicies: ->
|
||||
loadInitialData: ->
|
||||
return @rs.notifyPolicies.list().then (notifyPolicies) =>
|
||||
@scope.notifyPolicies = notifyPolicies
|
||||
return notifyPolicies
|
||||
|
||||
loadInitialData: ->
|
||||
promise = @.loadProject()
|
||||
promise.then(=> @.loadNotifyPolicies())
|
||||
return promise
|
||||
|
||||
module.controller("UserNotificationsController", UserNotificationsController)
|
||||
|
||||
|
||||
|
|
|
@ -3,17 +3,16 @@ div.navbar-dropdown.dropdown-user
|
|||
li
|
||||
a(href="#", title="{{ user.fullname }} profile") View Profile
|
||||
li
|
||||
a(href="#", title="Edit your profile") Edit Profile
|
||||
a(href="#", tg-nav="user-settings-user-profile", title="Edit your profile") Edit Profile
|
||||
li
|
||||
a(href="#", title="Edit your organizations") Edit Organizations
|
||||
li
|
||||
a(href="#", title="Edit your settings") Settings
|
||||
li
|
||||
a(href="#", title="Edit your notifications") Notifications
|
||||
a(href="#", tg-nav="user-settings-mail-notifications", title="Edit your notifications") Notifications
|
||||
li
|
||||
a(href="#", title="Send feedback") Feedback
|
||||
li
|
||||
a(href="#", title="Go to support") Help
|
||||
li
|
||||
a(href="#", title="Logout") Logout
|
||||
|
||||
|
|
|
@ -5,14 +5,14 @@ section.admin-menu
|
|||
nav
|
||||
ul
|
||||
li#usersettingsmenu-user-profile
|
||||
a(href="", tg-nav="user-settings-user-profile:project=project.slug")
|
||||
a(href="", tg-nav="user-settings-user-profile")
|
||||
span.title(translate="USER_SETTINGS.MENU.USER_PROFILE")
|
||||
span.icon.icon-arrow-right
|
||||
li#usersettingsmenu-change-password
|
||||
a(href="" tg-nav="user-settings-user-change-password:project=project.slug")
|
||||
a(href="" tg-nav="user-settings-user-change-password")
|
||||
span.title(translate="USER_SETTINGS.MENU.CHANGE_PASSWORD")
|
||||
span.icon.icon-arrow-right
|
||||
li#usersettingsmenu-mail-notifications
|
||||
a(href="", tg-nav="user-settings-mail-notifications:project=project.slug")
|
||||
a(href="", tg-nav="user-settings-mail-notifications")
|
||||
span.title(translate="USER_SETTINGS.MENU.EMAIL_NOTIFICATIONS")
|
||||
span.icon.icon-arrow-right
|
||||
|
|
Loading…
Reference in New Issue