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

@@ -98,7 +98,7 @@
@media (min-width: 70em) @media (min-width: 70em)
.site-header .site-header
width: 70% width: 70%
// this is a wrapper for avatars in the header // this is a wrapper for avatars in the header
// inside this is the actual `herobox` module // inside this is the actual `herobox` module
@@ -125,7 +125,7 @@
hrpg-label-color-mixin(darken($color-herobox, 16.18%)) hrpg-label-color-mixin(darken($color-herobox, 16.18%))
width: 2.618em width: 2.618em
text-align:center text-align:center
margin-right: 0.618em margin-right: 0.618em
.meter .meter
position: relative position: relative
overflow: hidden overflow: hidden
@@ -161,7 +161,7 @@
white-space: nowrap white-space: nowrap
&.value &.value
right: 0.382em right: 0.382em
// boss.jade only // boss.jade only
[class^="quest_"] + & [class^="quest_"] + &
min-width: 220px min-width: 220px
@@ -172,4 +172,6 @@
header .hero-stats 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()