mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
challenges: move options/challenges to options/social/challenges
This commit is contained in:
@@ -59,36 +59,36 @@ window.habitrpg = angular.module('habitrpg',
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Options > Groups
|
// Options > Groups
|
||||||
.state('options.groups', {
|
.state('options.social', {
|
||||||
url: "/groups",
|
url: "/groups",
|
||||||
templateUrl: "partials/options.groups.html"
|
templateUrl: "partials/options.social.html"
|
||||||
})
|
})
|
||||||
.state('options.groups.tavern', {
|
.state('options.social.tavern', {
|
||||||
url: "/tavern",
|
url: "/tavern",
|
||||||
templateUrl: "partials/options.groups.tavern.html",
|
templateUrl: "partials/options.social.tavern.html",
|
||||||
controller: 'TavernCtrl'
|
controller: 'TavernCtrl'
|
||||||
})
|
})
|
||||||
.state('options.groups.party', {
|
.state('options.social.party', {
|
||||||
url: '/party',
|
url: '/party',
|
||||||
templateUrl: "partials/options.groups.party.html",
|
templateUrl: "partials/options.social.party.html",
|
||||||
controller: 'PartyCtrl'
|
controller: 'PartyCtrl'
|
||||||
})
|
})
|
||||||
.state('options.groups.guilds', {
|
.state('options.social.guilds', {
|
||||||
url: '/guilds',
|
url: '/guilds',
|
||||||
templateUrl: "partials/options.groups.guilds.html",
|
templateUrl: "partials/options.social.guilds.html",
|
||||||
controller: 'GuildsCtrl'
|
controller: 'GuildsCtrl'
|
||||||
})
|
})
|
||||||
.state('options.groups.guilds.public', {
|
.state('options.social.guilds.public', {
|
||||||
url: '/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',
|
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',
|
url: '/:gid',
|
||||||
templateUrl: 'partials/options.groups.guilds.detail.html',
|
templateUrl: 'partials/options.social.guilds.detail.html',
|
||||||
controller: ['$scope', 'Groups', '$stateParams', function($scope, Groups, $stateParams){
|
controller: ['$scope', 'Groups', '$stateParams', function($scope, Groups, $stateParams){
|
||||||
$scope.group = Groups.Group.get({gid:$stateParams.gid});
|
$scope.group = Groups.Group.get({gid:$stateParams.gid});
|
||||||
}]
|
}]
|
||||||
@@ -109,14 +109,14 @@ window.habitrpg = angular.module('habitrpg',
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Options > Challenges
|
// Options > Challenges
|
||||||
.state('options.challenges', {
|
.state('options.social.challenges', {
|
||||||
url: "/challenges",
|
url: "/challenges",
|
||||||
controller: 'ChallengesCtrl',
|
controller: 'ChallengesCtrl',
|
||||||
templateUrl: "partials/options.challenges.html"
|
templateUrl: "partials/options.social.challenges.html"
|
||||||
})
|
})
|
||||||
.state('options.challenges.detail', {
|
.state('options.social.challenges.detail', {
|
||||||
url: '/:cid',
|
url: '/:cid',
|
||||||
templateUrl: 'partials/options.challenges.detail.html',
|
templateUrl: 'partials/options.social.challenges.detail.html',
|
||||||
controller: ['$scope', 'Challenges', '$stateParams',
|
controller: ['$scope', 'Challenges', '$stateParams',
|
||||||
function($scope, Challenges, $stateParams){
|
function($scope, Challenges, $stateParams){
|
||||||
$scope.obj = $scope.challenge = Challenges.Challenge.get({cid:$stateParams.cid}, function(){
|
$scope.obj = $scope.challenge = Challenges.Challenge.get({cid:$stateParams.cid}, function(){
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ habitrpg.controller("ChallengesCtrl", ['$scope', 'User', 'Challenges', 'Notifica
|
|||||||
*/
|
*/
|
||||||
function backToChallenges(){
|
function backToChallenges(){
|
||||||
$scope.popoverEl.popover('destroy');
|
$scope.popoverEl.popover('destroy');
|
||||||
$state.go('options.challenges');
|
$state.go('options.social.challenges');
|
||||||
$scope.challenges = Challenges.Challenge.query();
|
$scope.challenges = Challenges.Challenge.query();
|
||||||
User.log({});
|
User.log({});
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ habitrpg.controller("ChallengesCtrl", ['$scope', 'User', 'Challenges', 'Notifica
|
|||||||
$scope.close = function(challenge, $event) {
|
$scope.close = function(challenge, $event) {
|
||||||
$scope.closingChal = challenge;
|
$scope.closingChal = challenge;
|
||||||
$scope.popoverEl = $($event.target);
|
$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({
|
$scope.popoverEl.popover('destroy').popover({
|
||||||
html: true,
|
html: true,
|
||||||
placement: 'right',
|
placement: 'right',
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
include ./profile
|
include ./profile
|
||||||
include ./groups/index
|
include ./social/index
|
||||||
include ./challenges
|
|
||||||
include ./inventory/index
|
include ./inventory/index
|
||||||
include ./settings
|
include ./settings
|
||||||
|
|
||||||
@@ -15,18 +14,14 @@ script(id='partials/options.html', type="text/ng-template")
|
|||||||
a(ui-sref='options.profile')
|
a(ui-sref='options.profile')
|
||||||
i.icon-user
|
i.icon-user
|
||||||
| Profile
|
| Profile
|
||||||
li(ng-class="{ active: $state.includes('options.groups') }")
|
li(ng-class="{ active: $state.includes('options.social') }")
|
||||||
a(ui-sref='options.groups')
|
a(ui-sref='options.social')
|
||||||
i.icon-heart
|
i.icon-heart
|
||||||
| Groups
|
| Social
|
||||||
li(ng-class="{ active: $state.includes('options.inventory') }", ng-if='user.flags.dropsEnabled')
|
li(ng-class="{ active: $state.includes('options.inventory') }", ng-if='user.flags.dropsEnabled')
|
||||||
a(ui-sref='options.inventory')
|
a(ui-sref='options.inventory')
|
||||||
i.icon-gift
|
i.icon-gift
|
||||||
| Inventory
|
| 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') }")
|
li(ng-class="{ active: $state.includes('options.settings') }")
|
||||||
a(ui-sref='options.settings')
|
a(ui-sref='options.settings')
|
||||||
i.icon-wrench
|
i.icon-wrench
|
||||||
|
|||||||
@@ -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
|
a.btn.btn-small.btn-danger(ng-click="delete(closingChal)") Delete
|
||||||
h5 - Or -
|
h5 - Or -
|
||||||
small Select a winner and close the challenge:
|
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
|
small.pull-right
|
||||||
a(ng-click='cancelClosing(closingChal)') cancel
|
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
|
// Edit button
|
||||||
ul.unstyled
|
ul.unstyled
|
||||||
li(ng-show='challenge.leader==user._id', ng-hide='challenge._locked==false')
|
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}}
|
h4 {{member.profile.name}}
|
||||||
habitrpg-tasks(main=false)
|
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
|
.row-fluid
|
||||||
.span2.well
|
.span2.well
|
||||||
h4 Groups
|
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)')
|
a.btn.btn-small.btn-success(ng-hide='challenge._isMember', ng-click='join(challenge)')
|
||||||
i.icon-ok
|
i.icon-ok
|
||||||
| Join
|
| 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-body(ng-class='{collapse: !$stateParams.cid == challenge._id}')
|
||||||
.accordion-inner(ng-if='$stateParams.cid == challenge._id')
|
.accordion-inner(ng-if='$stateParams.cid == challenge._id')
|
||||||
div(ui-view)
|
div(ui-view)
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
// FIXME note, due to https://github.com/angular-ui/bootstrap/issues/783 we can't use nested angular-bootstrap tabs
|
// 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
|
// 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
|
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')
|
div(ng-show='group._id')
|
||||||
include ./group
|
include ./group
|
||||||
div(ng-hide='group._id')
|
div(ng-hide='group._id')
|
||||||
@@ -23,7 +25,7 @@ script(type='text/ng-template', id='partials/options.groups.party.html')
|
|||||||
{{user.id}}
|
{{user.id}}
|
||||||
include ./create-group
|
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')
|
div(ng-repeat='invitation in user.invitations.guilds')
|
||||||
h3 You're Invited To {{invitation.name}}
|
h3 You're Invited To {{invitation.name}}
|
||||||
a.btn.btn-success(data-type='guild', ng-click='join(invitation)') Accept
|
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}}
|
h4 {{group.name}}
|
||||||
p {{group.description}}
|
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
|
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
|
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
|
ul.nav.nav-tabs
|
||||||
li(ng-class="{ active: $state.includes('options.groups.guilds.public') }")
|
li(ng-class="{ active: $state.includes('options.social.guilds.public') }")
|
||||||
a(ui-sref='options.groups.guilds.public')
|
a(ui-sref='options.social.guilds.public')
|
||||||
| Public Guilds
|
| Public Guilds
|
||||||
li(ng-class="{ active: $stateParams.gid == group._id }", ng-repeat='group in groups.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}}
|
| {{group.name}}
|
||||||
li(ng-class="{ active: $state.includes('options.groups.guilds.create') }")
|
li(ng-class="{ active: $state.includes('options.social.guilds.create') }")
|
||||||
a(ui-sref='options.groups.guilds.create')
|
a(ui-sref='options.social.guilds.create')
|
||||||
| Create Guild
|
| Create Guild
|
||||||
|
|
||||||
.tab-content
|
.tab-content
|
||||||
.tab-pane.active
|
.tab-pane.active
|
||||||
div(ui-view)
|
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
|
ul.nav.nav-tabs
|
||||||
li(ng-class="{ active: $state.includes('options.groups.tavern') }")
|
li(ng-class="{ active: $state.includes('options.social.tavern') }")
|
||||||
a(ui-sref='options.groups.tavern')
|
a(ui-sref='options.social.tavern')
|
||||||
i.icon-eye-close
|
i.icon-eye-close
|
||||||
| Tavern
|
| Tavern
|
||||||
li(ng-class="{ active: $state.includes('options.groups.party') }")
|
li(ng-class="{ active: $state.includes('options.social.party') }")
|
||||||
a(ui-sref='options.groups.party')
|
a(ui-sref='options.social.party')
|
||||||
| Party
|
| Party
|
||||||
li(ng-class="{ active: $state.includes('options.groups.guilds') }")
|
li(ng-class="{ active: $state.includes('options.social.guilds') }")
|
||||||
a(ui-sref='options.groups.guilds')
|
a(ui-sref='options.social.guilds')
|
||||||
| Guilds
|
| Guilds
|
||||||
|
li(ng-class="{ active: $state.includes('options.social.challenges') }")
|
||||||
|
a(ui-sref='options.social.challenges')
|
||||||
|
i.icon-bullhorn
|
||||||
|
| Challenges
|
||||||
|
|
||||||
.tab-content
|
.tab-content
|
||||||
.tab-pane.active
|
.tab-pane.active
|
||||||
Reference in New Issue
Block a user