challenges: move options/challenges to options/social/challenges

This commit is contained in:
Tyler Renelle
2013-10-31 14:37:04 -07:00
parent 012dabf8b6
commit 39821752fa
10 changed files with 52 additions and 51 deletions

View File

@@ -59,36 +59,36 @@ window.habitrpg = angular.module('habitrpg',
})
// Options > Groups
.state('options.groups', {
.state('options.social', {
url: "/groups",
templateUrl: "partials/options.groups.html"
templateUrl: "partials/options.social.html"
})
.state('options.groups.tavern', {
.state('options.social.tavern', {
url: "/tavern",
templateUrl: "partials/options.groups.tavern.html",
templateUrl: "partials/options.social.tavern.html",
controller: 'TavernCtrl'
})
.state('options.groups.party', {
.state('options.social.party', {
url: '/party',
templateUrl: "partials/options.groups.party.html",
templateUrl: "partials/options.social.party.html",
controller: 'PartyCtrl'
})
.state('options.groups.guilds', {
.state('options.social.guilds', {
url: '/guilds',
templateUrl: "partials/options.groups.guilds.html",
templateUrl: "partials/options.social.guilds.html",
controller: 'GuildsCtrl'
})
.state('options.groups.guilds.public', {
.state('options.social.guilds.public', {
url: '/public',
templateUrl: "partials/options.groups.guilds.public.html"
templateUrl: "partials/options.social.guilds.public.html"
})
.state('options.groups.guilds.create', {
.state('options.social.guilds.create', {
url: '/create',
templateUrl: "partials/options.groups.guilds.create.html"
templateUrl: "partials/options.social.guilds.create.html"
})
.state('options.groups.guilds.detail', {
.state('options.social.guilds.detail', {
url: '/:gid',
templateUrl: 'partials/options.groups.guilds.detail.html',
templateUrl: 'partials/options.social.guilds.detail.html',
controller: ['$scope', 'Groups', '$stateParams', function($scope, Groups, $stateParams){
$scope.group = Groups.Group.get({gid:$stateParams.gid});
}]
@@ -109,14 +109,14 @@ window.habitrpg = angular.module('habitrpg',
})
// Options > Challenges
.state('options.challenges', {
.state('options.social.challenges', {
url: "/challenges",
controller: 'ChallengesCtrl',
templateUrl: "partials/options.challenges.html"
templateUrl: "partials/options.social.challenges.html"
})
.state('options.challenges.detail', {
.state('options.social.challenges.detail', {
url: '/:cid',
templateUrl: 'partials/options.challenges.detail.html',
templateUrl: 'partials/options.social.challenges.detail.html',
controller: ['$scope', 'Challenges', '$stateParams',
function($scope, Challenges, $stateParams){
$scope.obj = $scope.challenge = Challenges.Challenge.get({cid:$stateParams.cid}, function(){

View File

@@ -90,7 +90,7 @@ habitrpg.controller("ChallengesCtrl", ['$scope', 'User', 'Challenges', 'Notifica
*/
function backToChallenges(){
$scope.popoverEl.popover('destroy');
$state.go('options.challenges');
$state.go('options.social.challenges');
$scope.challenges = Challenges.Challenge.query();
User.log({});
}
@@ -116,7 +116,7 @@ habitrpg.controller("ChallengesCtrl", ['$scope', 'User', 'Challenges', 'Notifica
$scope.close = function(challenge, $event) {
$scope.closingChal = challenge;
$scope.popoverEl = $($event.target);
var html = $compile('<div><div ng-include="\'partials/options.challenges.detail.close.html\'" /></div></div>')($scope);
var html = $compile('<div><div ng-include="\'partials/options.social.challenges.detail.close.html\'" /></div></div>')($scope);
$scope.popoverEl.popover('destroy').popover({
html: true,
placement: 'right',

View File

@@ -1,6 +1,5 @@
include ./profile
include ./groups/index
include ./challenges
include ./social/index
include ./inventory/index
include ./settings
@@ -15,18 +14,14 @@ script(id='partials/options.html', type="text/ng-template")
a(ui-sref='options.profile')
i.icon-user
| Profile
li(ng-class="{ active: $state.includes('options.groups') }")
a(ui-sref='options.groups')
li(ng-class="{ active: $state.includes('options.social') }")
a(ui-sref='options.social')
i.icon-heart
| Groups
| Social
li(ng-class="{ active: $state.includes('options.inventory') }", ng-if='user.flags.dropsEnabled')
a(ui-sref='options.inventory')
i.icon-gift
| Inventory
li(ng-class="{ active: $state.includes('options.challenges') }")
a(ui-sref='options.challenges')
i.icon-bullhorn
| Challenges
li(ng-class="{ active: $state.includes('options.settings') }")
a(ui-sref='options.settings')
i.icon-wrench

View File

@@ -1,4 +1,4 @@
script(type='text/ng-template', id='partials/options.challenges.detail.close.html')
script(type='text/ng-template', id='partials/options.social.challenges.detail.close.html')
a.btn.btn-small.btn-danger(ng-click="delete(closingChal)") Delete
h5 - Or -
small Select a winner and close the challenge:
@@ -6,7 +6,7 @@ script(type='text/ng-template', id='partials/options.challenges.detail.close.htm
small.pull-right
a(ng-click='cancelClosing(closingChal)') cancel
script(type='text/ng-template', id='partials/options.challenges.detail.html')
script(type='text/ng-template', id='partials/options.social.challenges.detail.html')
// Edit button
ul.unstyled
li(ng-show='challenge.leader==user._id', ng-hide='challenge._locked==false')
@@ -35,7 +35,7 @@ script(type='text/ng-template', id='partials/options.challenges.detail.html')
h4 {{member.profile.name}}
habitrpg-tasks(main=false)
script(type='text/ng-template', id='partials/options.challenges.html')
script(type='text/ng-template', id='partials/options.social.challenges.html')
.row-fluid
.span2.well
h4 Groups
@@ -95,7 +95,7 @@ script(type='text/ng-template', id='partials/options.challenges.html')
a.btn.btn-small.btn-success(ng-hide='challenge._isMember', ng-click='join(challenge)')
i.icon-ok
| Join
a.accordion-toggle(ui-sref='options.challenges.detail({cid:challenge._id})') {{challenge.name}}
a.accordion-toggle(ui-sref='options.social.challenges.detail({cid:challenge._id})') {{challenge.name}}
.accordion-body(ng-class='{collapse: !$stateParams.cid == challenge._id}')
.accordion-inner(ng-if='$stateParams.cid == challenge._id')
div(ui-view)

View File

@@ -1,10 +1,12 @@
// FIXME note, due to https://github.com/angular-ui/bootstrap/issues/783 we can't use nested angular-bootstrap tabs
// Subscribe to that ticket & change this when they fix
script(type='text/ng-template', id='partials/options.groups.tavern.html')
include ./challenges.jade
script(type='text/ng-template', id='partials/options.social.tavern.html')
include ./tavern
script(type='text/ng-template', id='partials/options.groups.party.html')
script(type='text/ng-template', id='partials/options.social.party.html')
div(ng-show='group._id')
include ./group
div(ng-hide='group._id')
@@ -23,7 +25,7 @@ script(type='text/ng-template', id='partials/options.groups.party.html')
{{user.id}}
include ./create-group
script(type='text/ng-template', id='partials/options.groups.guilds.public.html')
script(type='text/ng-template', id='partials/options.social.guilds.public.html')
div(ng-repeat='invitation in user.invitations.guilds')
h3 You're Invited To {{invitation.name}}
a.btn.btn-success(data-type='guild', ng-click='join(invitation)') Accept
@@ -47,40 +49,44 @@ script(type='text/ng-template', id='partials/options.groups.guilds.public.html')
h4 {{group.name}}
p {{group.description}}
script(type='text/ng-template', id='partials/options.groups.guilds.detail.html')
script(type='text/ng-template', id='partials/options.social.guilds.detail.html')
include ./group
script(type='text/ng-template', id='partials/options.groups.guilds.create.html')
script(type='text/ng-template', id='partials/options.social.guilds.create.html')
include ./create-group
script(type='text/ng-template', id='partials/options.groups.guilds.html')
script(type='text/ng-template', id='partials/options.social.guilds.html')
ul.nav.nav-tabs
li(ng-class="{ active: $state.includes('options.groups.guilds.public') }")
a(ui-sref='options.groups.guilds.public')
li(ng-class="{ active: $state.includes('options.social.guilds.public') }")
a(ui-sref='options.social.guilds.public')
| Public Guilds
li(ng-class="{ active: $stateParams.gid == group._id }", ng-repeat='group in groups.guilds')
a(ui-sref="options.groups.guilds.detail({gid:group._id})")
a(ui-sref="options.social.guilds.detail({gid:group._id})")
| {{group.name}}
li(ng-class="{ active: $state.includes('options.groups.guilds.create') }")
a(ui-sref='options.groups.guilds.create')
li(ng-class="{ active: $state.includes('options.social.guilds.create') }")
a(ui-sref='options.social.guilds.create')
| Create Guild
.tab-content
.tab-pane.active
div(ui-view)
script(type='text/ng-template', id='partials/options.groups.html')
script(type='text/ng-template', id='partials/options.social.html')
ul.nav.nav-tabs
li(ng-class="{ active: $state.includes('options.groups.tavern') }")
a(ui-sref='options.groups.tavern')
li(ng-class="{ active: $state.includes('options.social.tavern') }")
a(ui-sref='options.social.tavern')
i.icon-eye-close
| Tavern
li(ng-class="{ active: $state.includes('options.groups.party') }")
a(ui-sref='options.groups.party')
li(ng-class="{ active: $state.includes('options.social.party') }")
a(ui-sref='options.social.party')
| Party
li(ng-class="{ active: $state.includes('options.groups.guilds') }")
a(ui-sref='options.groups.guilds')
li(ng-class="{ active: $state.includes('options.social.guilds') }")
a(ui-sref='options.social.guilds')
| Guilds
li(ng-class="{ active: $state.includes('options.social.challenges') }")
a(ui-sref='options.social.challenges')
i.icon-bullhorn
| Challenges
.tab-content
.tab-pane.active