Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Commit

Permalink
feat(social): port guilds
Browse files Browse the repository at this point in the history
  • Loading branch information
paglias committed Aug 17, 2014
1 parent 506ab8b commit 06a4a64
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 63 deletions.
66 changes: 13 additions & 53 deletions scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,65 +256,25 @@ var habitrpg = angular.module('habitrpg', ['ionic', 'userServices', 'authService
controller: 'ChatCtrl'
})

.state('app.chat', {
url:'/chat',
abstract: true,
views: {
menuContent: {
templateUrl:'views/app.chat.html',
controller: 'ChatCtrl'
}
}
})
.state('app.chat.tavern', {
url: '/tavern',
templateUrl: 'views/app.chat.list.html',
data: {gid: 'habitrpg'},
controller: ['$scope', function($scope){
$scope.query();
}]
.state('app.social.guilds', {
url: '/guilds',
templateUrl: 'views/app.social.guilds.html',
data: {sync: true},
controller: 'GuildCtrl'
})
.state('app.chat.party', {
url: '/party',

.state('app.social.guild-chat', {
url: '/guild-chat/:gid',
data: {sync: false},
templateUrl: 'views/app.chat.list.html',
data: {gid: 'party'},
controller: ['$scope', function($scope){
$scope.query();
}]
data: {gid: null},
controller: 'ChatCtrl'
})

.state('app.guilds', {
url:'/guilds',
abstract: true,
views: {
menuContent: {
templateUrl:'views/app.guilds.html',
controller: 'GuildCtrl'
}
}
})
.state('app.guilds.list', {
url: '/list',
data: {sync: true},
templateUrl: 'views/app.guilds.list.html',
controller: ['$scope', function($scope){
$scope.syncGuilds();
}]
})
.state('app.guilds.public', {
.state('app.social.public-guilds', {
url: '/public',
data: {sync: true},
templateUrl: 'views/app.guilds.public.html',
controller: 'GuildPublicCtrl'
})
.state('app.chat.guild', {
url: '/guild/:gid',
data: {sync: false},
templateUrl: 'views/app.chat.list.html',
data: {gid: null},
controller: ['$scope', function($scope){
$scope.query();
}]
})

})
}])
4 changes: 3 additions & 1 deletion scripts/controllers/guildCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ habitrpg.controller('GuildCtrl',
};

$scope.viewGuild = function(guild, e) {
$state.go('app.chat.guild', {gid:guild._id});
$state.go('app.social.guild-chat', {gid:guild._id});
}

$scope.syncGuilds();
}
]);

Expand Down
23 changes: 14 additions & 9 deletions views/app/social.jade
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ script(id='views/app.social.html',type='text/ng-template')
a.tab-item(ng-class='{"tab-item-active": $state.is("app.social.party")}', ui-sref='app.social.party') Party
a.tab-item(ng-class='{"tab-item-active": $state.is("app.social.guilds")}', ui-sref='app.social.guilds') Guilds

script(id='views/app.social.html',type='text/ng-template')
+ionContentView('Social', true)
div(ui-view='')
.tabs
a.tab-item(ng-class='{"tab-item-active": $state.is("app.social.tavern")}', ui-sref='app.social.tavern') Tavern
a.tab-item(ng-class='{"tab-item-active": $state.is("app.social.party")}', ui-sref='app.social.party') Party
a.tab-item(ng-class='{"tab-item-active": $state.is("app.social.guilds")}', ui-sref='app.social.guilds') Guilds

script(id='views/app.social.party.html',type='text/ng-template')
.list(ng-if='party._id')
.item.item-divider {{group.name}}
Expand All @@ -25,4 +17,17 @@ script(id='views/app.social.party.html',type='text/ng-template')
i.icon.ion-chevron-right
+boss(false, true)
.padding(ng-if='!group._id')
|Start a party (on habitrpg.com)
|Start a party (on habitrpg.com)

script(id='views/app.social.guilds.html',type='text/ng-template')
ion-list#guildCtrl-list
ion-item.item-divider Your guilds
ion-item.item-icon-right.item-text-wrap(ng-repeat='guild in guilds' ng-click='viewGuild(guild)')
h2 {{guild.name}}
p {{guild.description}}
i.icon.ion-chevron-right
ion-item.item-divider Other guilds
ion-item.item-icon-right.item-text-wrap(ui-sref='app.social.public-guilds')
h2 Public guilds
i.icon.ion-chevron-right

0 comments on commit 06a4a64

Please sign in to comment.