mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
challenges: much better implemntation of ui-router for nested groups. No
need to specify fields or populate members at /groups - instead, provide that functionality at /groups/:gid
This commit is contained in:
@@ -16,6 +16,7 @@ window.habitrpg = angular.module('habitrpg',
|
||||
.when('/options', '/options/profile/avatar')
|
||||
.when('/options/profile', '/options/profile/avatar')
|
||||
.when('/options/groups', '/options/groups/tavern')
|
||||
.when('/options/groups/guilds', '/options/groups/guilds/public')
|
||||
.when('/options/inventory', '/options/inventory/inventory')
|
||||
|
||||
// redirect states that don't match
|
||||
@@ -64,12 +65,6 @@ window.habitrpg = angular.module('habitrpg',
|
||||
url: "/tavern",
|
||||
templateUrl: "partials/options.groups.tavern.html",
|
||||
controller: 'TavernCtrl'
|
||||
// TODO this doesn't work, seems ngResource doesn't get the .then() function
|
||||
// resolve: {
|
||||
// group: ['Groups', function(Groups){
|
||||
// //return Groups.fetchTavern();
|
||||
// }]
|
||||
// }
|
||||
})
|
||||
.state('options.groups.party', {
|
||||
url: '/party',
|
||||
@@ -81,6 +76,21 @@ window.habitrpg = angular.module('habitrpg',
|
||||
templateUrl: "partials/options.groups.guilds.html",
|
||||
controller: 'GuildsCtrl'
|
||||
})
|
||||
.state('options.groups.guilds.public', {
|
||||
url: '/public',
|
||||
templateUrl: "partials/options.groups.guilds.public.html"
|
||||
})
|
||||
.state('options.groups.guilds.create', {
|
||||
url: '/create',
|
||||
templateUrl: "partials/options.groups.guilds.create.html"
|
||||
})
|
||||
.state('options.groups.guilds.detail', {
|
||||
url: '/:gid',
|
||||
templateUrl: 'partials/options.groups.guilds.detail.html',
|
||||
controller: ['$scope', 'Groups', '$stateParams', function($scope, Groups, $stateParams){
|
||||
$scope.group = Groups.Group.get({gid:$stateParams.gid});
|
||||
}]
|
||||
})
|
||||
|
||||
// Options > Inventory
|
||||
.state('options.inventory', {
|
||||
|
||||
Reference in New Issue
Block a user