Skip to content

Commit

Permalink
Merge pull request #289 from warcraftlfg/bmagic
Browse files Browse the repository at this point in the history
Bmagic
  • Loading branch information
bmagic committed Feb 8, 2016
2 parents d96dc42 + 5ad8da2 commit 24f6d43
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
angular
.module('blocks.wlfgTimezoneOffset')
.filter('wlfgTimezoneOffset', wlfgTimezoneOffset);

function wlfgTimezoneOffset() {

return function (input) {
var zone = moment.tz.zone(input);
if (zone) {
var offset = zone.parse(Date.UTC()) / 60;
if (offset >= 0) {
return "+" + offset;
} else {
return offset;
}
}
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(function() {
'use strict';

angular.module('blocks.wlfgTimezoneOffset', []);
})();
2 changes: 1 addition & 1 deletion client/app/character/character-update.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ <h1><span class="icon-medium faction-{{character.bnet.faction}}"></span><span cl
<label>{{"CHARACTER_CREATE_TIMEZONE"|translate}}</label>
<div class="css3-metro-dropdown css3-metro-dropdown-inverse">
<select ng-model="character.ad.timezone" class="form-control">
<option ng-repeat="timezone in timezones" value="{{timezone}}">{{"TIMEZONE_"+timezone|uppercase|translate}}</option>
<option ng-repeat="timezone in timezones" value="{{timezone}}">{{"TIMEZONE_"+timezone|uppercase|translate}} (GMT{{timezone | wlfgTimezoneOffset}})</option>
</select>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function wlfgCharacterMenu() {
return directive;

function link($scope, element, attrs) {
$scope.menuContentShowed = false;
$scope.menuContentShowed = true;
}

}
2 changes: 1 addition & 1 deletion client/app/core/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
angular
.module('app.core')
.constant("LANGUAGES",["en","de","fr","es","ru","bg","zh","hr","cs","da","nl","et","fi","el","he","hu","it","ja","ko","lv","lt","no","pl","pt","ro","sl","sv","tw","tr"])
.constant("TIMEZONES", ["America/Chicago","America/Los_Angeles","America/New_York","America/Denver","America/Sao_Paulo","Australia/Melbourne","Asia/Seoul","Asia/Taipei","Europe/London","Europe/Paris","Europe/Berlin","Europe/Madrid","Europe/Lisbon","Europe/Moscow"]);
.constant("TIMEZONES", ["Australia/Melbourne","Asia/Seoul","Asia/Taipei","Europe/Moscow","Europe/Paris","Europe/Berlin","Europe/Madrid","Europe/London","Europe/Lisbon","America/Sao_Paulo","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","US/Hawaii"]);
})();
2 changes: 1 addition & 1 deletion client/app/core/core.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/*
* Our reusable cross app code modules
*/
'blocks.socket', 'blocks.wlfgConfirm', 'blocks.wlfgAppTitle', 'blocks.wlfgWCL',
'blocks.socket', 'blocks.wlfgConfirm', 'blocks.wlfgAppTitle', 'blocks.wlfgWCL','blocks.wlfgTimezoneOffset',
//'blocks.exception', 'blocks.logger', 'blocks.router',
/*
* 3rd Party modules
Expand Down
2 changes: 1 addition & 1 deletion client/app/filter/time/filter.day.directive.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="col-md-12 p-l-5">
<div class="css3-metro-dropdown">
<select ng-model="timezone" class="form-control">
<option ng-repeat="timezone in timezones" value="{{timezone}}">{{"TIMEZONE_"+timezone|uppercase|translate}}</option>
<option ng-repeat="timezone in timezones" value="{{timezone}}">{{"TIMEZONE_"+timezone|uppercase|translate}} (GMT{{timezone | wlfgTimezoneOffset}})</option>
</select>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/app/guild/directive/menu/guild.menu.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function wlfgGuildMenu() {
return directive;

function link($scope, element, attrs) {
$scope.menuContentShowed = false;
$scope.menuContentShowed = true;
}

}
2 changes: 1 addition & 1 deletion client/app/guild/guild-update.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h2>{{ guild.name }}</h2>
<label>{{"CHARACTER_CREATE_TIMEZONE"|translate}}</label>
<div class="css3-metro-dropdown css3-metro-dropdown-inverse">
<select ng-model="guild.ad.timezone" class="form-control">
<option ng-repeat="timezone in timezones" value="{{timezone}}">{{"TIMEZONE_"+timezone|uppercase|translate}}</option>
<option ng-repeat="timezone in timezones" value="{{timezone}}">{{"TIMEZONE_"+timezone|uppercase|translate}} (GMT{{timezone | wlfgTimezoneOffset}})</option>
</select>
</div>
</div>
Expand Down
10 changes: 7 additions & 3 deletions client/app/guild/guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,16 @@
name: $stateParams.name
}, function (data) {

if(data && data.rank && guild && guild.perms && guild.perms.ad && guild.perms.ad.edit){
if(guild.perms.ad.edit.indexOf(data.rank)!=-1){
if(guild && !guild.perms){
//No perms set everyone can edit.
$scope.userCanEdit = true;
}
if(data && guild && guild.perms && guild.perms.ad && guild.perms.ad.edit){
if(guild.perms.ad.edit.indexOf(data.rank)>=0){
$scope.userCanEdit = true;
console.log('ici');
}
}

$scope.$parent.loading = false;
});
}
Expand Down
1 change: 1 addition & 0 deletions client/assets/locales/locale-en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
"TIMEZONE_EUROPE/MADRID": "Europe/Madrid",
"TIMEZONE_EUROPE/LISBON": "Europe/Lisbon",
"TIMEZONE_EUROPE/MOSCOW": "Europe/Moscow",
"TIMEZONE_US/HAWAII": "US/Hawaii",
"BNET_API_CHARACTER_NOT_FOUND": "Unable to find this player on Battle.net.",
"BNET_API_GUILD_NOT_FOUND": "Unable to find this guild on Battle.net.",
"BNET_API_ERROR_DENY": "Authentication error with Battle.net. Please try later or check your security settings on Battle.net",
Expand Down
3 changes: 3 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@
<script src="/app/blocks/wlfgConfirm/warcraft-lfg.confirm.controller.js"></script>
<script src="/app/blocks/wlfgWCL/warcraft-lfg.warcraft-logs.module.js"></script>
<script src="/app/blocks/wlfgWCL/warcraft-lfg.warcraft-logs.filter.js"></script>
<script src="/app/blocks/wlfgTimezoneOffset/warcraft-lfg.timezone-offset.module.js"></script>
<script src="/app/blocks/wlfgTimezoneOffset/warcraft-lfg.timezone-offset.filter.js"></script>

<script src="/app/blocks/select.convert-to-number.directive.js"></script>


Expand Down
2 changes: 1 addition & 1 deletion server/app/config/db/characterAdSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"timezone": {
"type": "string",
"default": "Europe/London",
"enum": ["America/Chicago","America/Los_Angeles","America/New_York","America/Denver","America/Sao_Paulo","Australia/Melbourne","Asia/Seoul","Asia/Taipei","Europe/London","Europe/Paris","Europe/Berlin","Europe/Madrid","Europe/Lisbon","Europe/Moscow"]
"enum": ["America/Chicago","America/Los_Angeles","America/New_York","America/Denver","America/Sao_Paulo","Australia/Melbourne","Asia/Seoul","Asia/Taipei","Europe/London","Europe/Paris","Europe/Berlin","Europe/Madrid","Europe/Lisbon","Europe/Moscow","US/Hawaii"]
},
"play_time": {
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion server/app/config/db/guildAdSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"timezone": {
"type": "string",
"default": "Europe/London",
"enum": ["America/Chicago","America/Los_Angeles","America/New_York","America/Denver","America/Sao_Paulo","Australia/Melbourne","Asia/Seoul","Asia/Taipei","Europe/London","Europe/Paris","Europe/Berlin","Europe/Madrid","Europe/Lisbon","Europe/Moscow"]
"enum": ["America/Chicago","America/Los_Angeles","America/New_York","America/Denver","America/Sao_Paulo","Australia/Melbourne","Asia/Seoul","Asia/Taipei","Europe/London","Europe/Paris","Europe/Berlin","Europe/Madrid","Europe/Lisbon","Europe/Moscow","US/Hawaii"]
},
"play_time": {
"type": "object",
Expand Down

0 comments on commit 24f6d43

Please sign in to comment.