Skip to content

Commit

Permalink
latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikoehn committed Sep 27, 2016
1 parent 2e6040a commit 2a09c34
Show file tree
Hide file tree
Showing 11 changed files with 570 additions and 509 deletions.
10 changes: 9 additions & 1 deletion app/locales/en/translations.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
export default {
"GameIsPaused" : "Game is paused",
"GameIsAboutToStart" : "Game is about to start",
"GameHasEnded" : "Game has ended",
"accept": "Accept",
"accepted": "Accepted",
"avgTomatoPrice": "Average Tomato Price",
Expand Down Expand Up @@ -39,5 +42,10 @@ export default {
"resourceOverview": "Resource Overview",
"history": "Transaction history",
"title": "Tomato trade"
}
},
"fine": "fine",
"fixedCost": "fixed cost",
"kgOfTomatoes": "kg of tomatoes",
"pricePerKg": "price per kg",
"retailPrice": "retail price"
}
3 changes: 3 additions & 0 deletions app/locales/nl/translations.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
export default {
"GameIsPaused" : "[NL]Game is paused",
"GameIsAboutToStart" : "[NL]Game is about to start",
"GameHasEnded" : "[NL]Game has ended",
"accept": "Accepteren",
"accepted": "Aanvaard",
"avgTomatoPrice": "Gemiddelde Tomaten Prijs",
Expand Down
2 changes: 2 additions & 0 deletions app/mixins/game-config-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ let fn = function(self, tag) {
}

export default Ember.Mixin.create({
i18n: Ember.inject.service(),

gameConfigurationRO: Ember.computed("gameConfiguration", {
get() {
Expand Down Expand Up @@ -84,6 +85,7 @@ export default Ember.Mixin.create({
let tradeType = x.startsWith("w") ? "Weekly trade" : "Daily trade";
let tradingFor = /\d+/.exec(x)[0];
let currentWeek = +tradingFor + (x.startsWith("w") ? -1 : 0);

let roundTitle = `#${round} Week: ${currentWeek}: ${tradeType} for Week ${tradingFor}`;
let playerSettings = allPlayerIds.map( (x)=> { return this.getValueForUserAndRound(cleanLines, x, round); } );
return { round, roundTitle, playerSettings, tradingFor, tradeType};
Expand Down
2 changes: 1 addition & 1 deletion app/models/offer.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default Model.extend({
return (this.get("receiver.id") === undefined) ? "External" : this.get('receiver.id');
}),

idxOfOfferInGame: Ember.computed("game.offers.[]", function() {
idxOfOfferInGame: Ember.computed("", function() {

let gameOffers = this.get("game.offers");
if (gameOffers === undefined || gameOffers.map === undefined) { return ""; }
Expand Down
7 changes: 5 additions & 2 deletions app/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import _ from 'lodash/lodash';


export default Model.extend({
i18n: Ember.inject.service(),

// normal attribtues
name : attr('string'),

Expand Down Expand Up @@ -59,10 +61,11 @@ export default Model.extend({

//Result Seller 1 - Bob
descriptivePlayerIdInGame: Ember.computed("playerPosition", "name", function() {
let prefix = this.get("isSeller") ? "Seller " : "Buyer ";
var prefix = this.get("isSeller") ? "seller" : "buyer";
prefix = this.get('i18n').t(prefix);
let pos = this.get("playerPosition");
let postfix = this.get("name") ? ` - ${this.get("name")}` : '';
return `${prefix}${pos}${postfix}`;
return `${prefix} ${pos}${postfix}`;
}),


Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/player-offer-display.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<li class="list-group-item {{offer.state}}">
Round: {{offer.roundNumber}} Offer: {{offer.idxOfOfferInGame}} [{{offer.state}}]
<b>{{offer.receiverName}}</b>
{{moment-format offer.ts "HH:mm:ss"}} / {{moment-from-now offer.ts hideSuffix=true interval=1000}}
{{moment-format offer.ts "HH:mm:ss"}}
<br>
<b>{{offer.senderName}}</b> --&gt;
<span class="to-tomato"></span> {{digit-group-format offer.tomatoes}}
Expand Down
6 changes: 3 additions & 3 deletions app/templates/components/timer-jumbotron.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
<h4 class="text-center game-title">{{liquid-bind game.currentTitle}}</h4>
<p>
{{#if game.isPaused}}
<p>Game is paused</p>
<p>{{t "GameIsPaused"}}</p>
{{else}}
{{tom-clock timeStartTs=game.timeStartTs timeEndTs=game.timeEndTs}}
{{/if}}
</p>
{{else}}
{{#if game.gameIsAboutToStart}}
<h4 class="text-center game-title">Game is about to start</h4>
<h4 class="text-center game-title">{{t "GameIsAboutToStart"}}</h4>
{{else}}
<h4 class="text-center game-title">Game has ended</h4>
<h4 class="text-center game-title">{{t "GameHasEnded"}}</h4>
{{/if}}
{{/if}}
</div>
Expand Down
6 changes: 3 additions & 3 deletions app/templates/games.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@
<span class="title-container"><h5>Minutes Round: </h5></span> {{input disabled=1 type="number" value=game.minutesPerRound class="form-control" }}
</div>
<div class="form-group">
<span class="title-container"><h5>{{t "seller"}} Fine: </h5></span> {{input disabled=1 type="number" value=game.fine class="form-control" }}
<span class="title-container"><h5>{{capitalize (t 'fine')}}</h5></span> {{input disabled=1 type="number" value=game.fine class="form-control" }}
</div>
<div class="form-group">
<span class="title-container"><h5>{{t "seller"}} FixedCost: </h5></span> {{input disabled=1 type="number" value=game.fixedCost class="form-control" }}
<span class="title-container"><h5>{{capitalize (t 'fixedCost')}}</h5></span> {{input disabled=1 type="number" value=game.fixedCost class="form-control" }}
</div>
<div class="form-group">
<span class="title-container"><h5>{{t "seller"}} RetailPrice: </h5></span> {{input disabled=1 type="number" value=game.retailPrice class="form-control" }}
<span class="title-container"><h5>{{capitalize (t 'retailPrice')}}</h5></span> {{input disabled=1 type="number" value=game.retailPrice class="form-control" }}
</div>
</span>
{{/if}}
Expand Down
2 changes: 1 addition & 1 deletion app/templates/player.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
<li class="list-group-item">
<strong>{{t "previousAcceptedOffers"}}</strong>
</li>
{{#each (filter-by "state" "accepted" (reverse obj.history)) as |offer|}}
{{#each (take 10 (filter-by "state" "accepted" (reverse obj.history))) as |offer|}}
{{player-offer-display offer=offer}}
{{else}}
<li class="list-group-item"><i>{{t "na"}}</i></li>
Expand Down
8 changes: 4 additions & 4 deletions config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ module.exports = function(environment) {
locationType: 'auto',

firebase: {
apiKey: "AIzaSyBxB2yDx0LIwExC-pKDlOlN-gxZK83MkYI",
authDomain: "tomato-37b32.firebaseapp.com",
databaseURL: "https://tomato-37b32.firebaseio.com",
storageBucket: "tomato-37b32.appspot.com",
apiKey: "AIzaSyB62IKGJyM3h6e29cLzNPovStBUH2JZmSc",
authDomain: "tomato2-f1fcb.firebaseapp.com",
databaseURL: "https://tomato2-f1fcb.firebaseio.com",
storageBucket: "",
},

EmberENV: {
Expand Down
Loading

0 comments on commit 2a09c34

Please sign in to comment.