Added start party option, locales, and plus button

This commit is contained in:
TheHollidayInn
2015-05-11 20:18:35 -05:00
parent 5513061d80
commit e3f5c22fe8
4 changed files with 26 additions and 8 deletions

View File

@@ -117,5 +117,7 @@
"sendGiftPurchase": "Purchase", "sendGiftPurchase": "Purchase",
"sendGiftMessagePlaceholder": "Personal message (optional)", "sendGiftMessagePlaceholder": "Personal message (optional)",
"sendGiftSubscription": "<%= months %> Month(s): $<%= price %>", "sendGiftSubscription": "<%= months %> Month(s): $<%= price %>",
"inviteFriends": "Invite Friends" "inviteFriends": "Invite Friends",
"startAParty": "Start a Party",
"addToParty": "Add someone to your party"
} }

View File

@@ -173,3 +173,5 @@ header .hero-stats
background-color: darken($color-herobox, 4%) background-color: darken($color-herobox, 4%)
border-right: 1px solid darken($color-herobox, 12%) border-right: 1px solid darken($color-herobox, 12%)
button.party-invite
margin-top: 55px;

View File

@@ -1,7 +1,7 @@
"use strict"; "use strict";
habitrpg.controller("HeaderCtrl", ['$scope', 'Groups', 'User', habitrpg.controller("HeaderCtrl", ['$scope', 'Groups', 'User', '$location', '$rootScope',
function($scope, Groups, User) { function($scope, Groups, User, $location, $rootScope) {
$scope.Math = window.Math; $scope.Math = window.Math;
$scope.user = User.user; $scope.user = User.user;
@@ -16,6 +16,17 @@ habitrpg.controller("HeaderCtrl", ['$scope', 'Groups', 'User',
$scope.$watch('user.party.orderAscending', triggerResort); $scope.$watch('user.party.orderAscending', triggerResort);
}); });
$scope.inviteOrStartParty = function(group) {
if (group.type === "party") {
$rootScope.openModal('invite-friends', {controller:'InviteToGroupCtrl', resolve:
{injectedGroup: function(){
return group;
}}});
} else {
$location.path("/options/groups/party");
}
}
function resortParty() { function resortParty() {
var result = _.sortBy( var result = _.sortBy(
_.filter($scope.party.members, function(member){ _.filter($scope.party.members, function(member){

View File

@@ -32,6 +32,9 @@
// party // party
span(ng-controller='PartyCtrl') span(ng-controller='PartyCtrl')
button.pull-right.btn.btn-primary(ng-click="openInviteModal(group)", ng-if="(party.members.length === 1) && user.preferences.displayInviteToPartyWhenPartyIs1")=env.t("inviteFriends") button.party-invite.pull-right.btn.btn-primary(ng-click="inviteOrStartParty(group)", ng-if="(!party.members) && user.preferences.displayInviteToPartyWhenPartyIs1", popover=env.t("startAParty"), popover-placement="top", popover-trigger="mouseenter")
span.glyphicon.glyphicon-plus
button.party-invite.pull-right.btn.btn-primary(ng-click="inviteOrStartParty(group)", ng-if="(party.members.length === 1) && user.preferences.displayInviteToPartyWhenPartyIs1", popover=env.t("addToParty"), popover-placement="top", popover-trigger="mouseenter")
span.glyphicon.glyphicon-plus
.herobox-wrap(ng-repeat='profile in partyMinusSelf') .herobox-wrap(ng-repeat='profile in partyMinusSelf')
+herobox() +herobox()