Permalink
Browse files

Merged development to master

  • Loading branch information...
2 parents 7cf6de3 + b0585d4 commit 383fb9fe1d48743fb85bcc83d080b5a1e2d99444 Erik Töyrä committed May 25, 2012
Showing with 559 additions and 178 deletions.
  1. +1 −1 app.js
  2. +10 −3 app/controller/MainPanel.js
  3. +60 −13 app/controller/ResultsPage.js
  4. +17 −17 app/model/Match.js
  5. +37 −0 app/view/Footer.js
  6. +2 −2 app/view/LastUpdated.js
  7. +1 −1 app/view/Main.js
  8. +7 −4 app/view/MatchList.js
  9. +22 −0 app/view/Message.js
  10. +1 −0 app/view/ResultsPage.js
  11. +15 −1 app/view/StandingsPage.js
  12. +29 −0 app/view/Top4.js
  13. +28 −0 app/view/TopScorer.js
  14. +1 −0 archive/app.js/9c708a00251642a131ec0e2858e5c405be85abba
  15. +1 −0 archive/app.js/d5f2803e351b0876ca9db146a6e8114418948615
  16. +1 −0 archive/resources/css/app.css/17353f35284ff4632aa09bbe69af2cd0051baa5c
  17. +1 −0 archive/resources/css/app.css/65d5c603db8e10f12a44f2ebb8bff948d7ad3eb2
  18. +1 −1 build/production/app.js
  19. +1 −1 build/production/app.json
  20. +1 −0 build/production/deltas/app.js/235629a7d4195448771ae4c8a611ab4fbe418e0d.json
  21. +1 −1 build/production/deltas/app.js/41fb27e481c5efe55c00f2acd106d34b7c1bbe21.json
  22. +1 −1 build/production/deltas/app.js/55cde9d33ecfb079a7336abc4c1d2e37a594bf23.json
  23. +1 −1 build/production/deltas/app.js/56af98d87cafe4c6b0d42894990cce1143747ab5.json
  24. +1 −1 build/production/deltas/app.js/60dd188e6f91429b4090a8279014339962e9aa97.json
  25. +1 −1 build/production/deltas/app.js/6bed1eec4ff0898cbb62983b51fbbd63d1e79646.json
  26. +1 −1 build/production/deltas/app.js/83fd3b3febdd9c31735ca7ae7446751332805b56.json
  27. +1 −1 build/production/deltas/app.js/ba531e1e8fce05ef00751463ff7d44925d025dca.json
  28. +1 −0 build/production/deltas/app.js/d5f2803e351b0876ca9db146a6e8114418948615.json
  29. +1 −1 build/production/deltas/app.js/f41c3fe0dd1dbbd50fd8dfd8e107285e3686c8eb.json
  30. +1 −1 build/production/deltas/app.js/f928414411530d49d35e34a2ceda04a0da87efab.json
  31. +1 −0 build/production/deltas/resources/css/app.css/17353f35284ff4632aa09bbe69af2cd0051baa5c.json
  32. +1 −0 build/production/deltas/resources/css/app.css/664a8fcc45433018e311254ccbada2f9012cdb4e.json
  33. +1 −1 build/production/deltas/resources/css/app.css/921df86ea5c7bff8cbac9babc3bf92e339cdd16f.json
  34. +1 −1 build/production/deltas/resources/css/app.css/eb185ba02cf26869d7a9ea2fc8d9b34a56034cef.json
  35. +1 −1 build/production/resources/css/app.css
  36. BIN build/production/resources/images/arrow-down.png
  37. BIN build/production/resources/images/audit-status-and-compliance-mockup.png
  38. BIN build/production/resources/images/close.png
  39. BIN build/production/resources/images/lock-icons.png
  40. BIN resources/.DS_Store
  41. +206 −112 resources/css/app.css
  42. BIN resources/images/clock.png
  43. BIN resources/images/close.png
  44. BIN resources/sass/.sass-cache/1aed40c38b571ed0ab259a118a2c9ba471282b50/app.scssc
  45. +101 −10 resources/sass/app.scss
View
2 app.js
@@ -37,7 +37,7 @@ Ext.application({
'RememberMe',
'Rounds',
],
- views: ['Main', 'Viewport', 'TopToolbar', 'LastUpdated', 'LoginForm', 'MainNav', 'MessageAtTop', 'StandingsPage'],
+ views: ['Main', 'Viewport', 'TopToolbar', 'LastUpdated', 'LoginForm', 'MainNav', 'Message', 'MessageAtTop', 'StandingsPage'],
icon: {
57: 'resources/icons/Icon.png',
@@ -13,6 +13,7 @@ Ext.define('EM.controller.MainPanel', {
refs: {
forgotPasswordButton: '#login-form #forgot-password',
loginButton: '#login-form #login',
+ logoutButton: '#logout',
loginForm: '#login-form',
loginFormFields: '#login-form field',
mainPanel: '#main-panel',
@@ -27,6 +28,9 @@ Ext.define('EM.controller.MainPanel', {
loginButton: {
tap: 'doValidateForm'
},
+ logoutButton: {
+ tap: 'doLogout'
+ }
}
},
@@ -105,10 +109,13 @@ Ext.define('EM.controller.MainPanel', {
},
doLogout: function() {
- console.log("logging out");
+ var loginForm = this.getLoginForm();
+ loginForm.reset();
+
EM.app.setUserData({});
this.dirtyRememberMe();
this.getMainPanel().setActiveItem(0);
+ this.showValidationErrorMessage('Du är nu utloggad, glöm inte att omgångarna har ett datum som du senast måste tippa klart dem.');
},
doLoginRequest: function() {
@@ -159,11 +166,11 @@ Ext.define('EM.controller.MainPanel', {
} else {
switch(response.status) {
case 401: // User is not authorized to login
- this.showValidationErrorMessage('Inloggningen misslyckades. Kontrollera dina loginuppgifter.');
+ this.showValidationErrorMessage('Felaktigt användarnamn eller lösenord. Försök igen.');
break;
default: // All other kinds of errors
- this.showValidationErrorMessage('Kunde inte kontakta servern. Försök igen lite senare.');
+ this.showValidationErrorMessage('Ursäkta, det går inte att logga in nu av någon okänd anledning. Försök igen senare.');
}
}
}
@@ -9,10 +9,26 @@ Ext.define('EM.controller.ResultsPage', {
launch: function() {},
config: {
- views: ['MatchList', 'MyStats', 'ResultsPage', 'RoundSelector'],
+ views: ['Footer', 'MatchList', 'MyStats', 'ResultsPage', 'RoundSelector', 'TopScorer', 'Top4'],
refs: {
- lastUpdated: '#last-updated',
+ footer: {
+ selector: 'footer',
+ xtype: 'footer',
+ autoCreate: true
+ },
+ logoutLink: '#logout',
+ lastUpdated: '#matches-last-updated',
+ top4: {
+ selector: 'top-4',
+ xtype: 'top4',
+ autoCreate: true
+ },
+ topScorer: {
+ selector: 'top-scorer',
+ xtype: 'topscorer',
+ autoCreate: true
+ },
matchList: {
selector: 'match-list',
xtype: 'matchlist',
@@ -29,8 +45,11 @@ Ext.define('EM.controller.ResultsPage', {
console.log("Tapped on a list item");
}
},
- '#top-4-and-top-scorer': {
- tap: 'doTop4AndTopScorer'
+ '#top-4-menu-item': {
+ tap: 'doTop4'
+ },
+ '#top-scorer-menu-item': {
+ tap: 'doTopScorer'
},
'#round-5-selector': {
tap: 'doRoundFilter'
@@ -58,8 +77,14 @@ Ext.define('EM.controller.ResultsPage', {
var roundsStore = Ext.create('EM.store.Rounds', {});
var matchStore = Ext.create('EM.store.Matches', {});
var rounds = [{
- id: 'top-4-and-top-scorer',
- text: 'Topp 4 & skyttekung',
+ id: 'top-4-menu-item',
+ text: 'Topp 4',
+ iconAlign: 'right',
+ iconCls: 'round-open',
+ },
+ {
+ id: 'top-scorer-menu-item',
+ text: 'Skyttekung',
iconAlign: 'right',
iconCls: 'round-open',
}];
@@ -110,10 +135,15 @@ Ext.define('EM.controller.ResultsPage', {
});
this.addRoundFilterMenu(rounds);
+ this.getResultsPage().add(this.getTop4());
+ this.getResultsPage().add(this.getTopScorer());
this.getResultsPage().add(this.getMatchList());
+ this.getResultsPage().add(this.getFooter());
this.doUpdateLastUpdated();
this.roundFilterByKey('roundId', activeRoundId); // Filter the matchlist and display the first round of matches.
+
+ //console.log("logoutLink: ", this.getLogoutLink());
}
});
},
@@ -130,11 +160,9 @@ Ext.define('EM.controller.ResultsPage', {
},
});
- //rounds = this.calculateItem(rounds);
-
roundMenu.setItems(rounds);
roundMenu.setAllowDepress(false);
- //roundMenu.setActiveItem(this.calculateActiveItem(rounds));
+
this.getRoundSelector().add(roundMenu);
this.getRoundSelector().show(); // A must to make #round-selector scrollable
},
@@ -159,10 +187,25 @@ Ext.define('EM.controller.ResultsPage', {
},
/**
- * Display the 'Topp 4 & skyttekung' page.
+ * Display the 'Topp 4' page.
+ */
+ doTop4: function(button, event, eventOpts) {
+ this.getFooter().hide();
+ this.getMatchList().hide();
+ this.getTopScorer().hide();
+ this.getTop4().show();
+ this.getFooter().show();
+ },
+
+ /**
+ * Display the 'Skyttekung' page.
*/
- doTop4AndTopScorer: function(button, event, eventOpts) {
- console.log("Tapped on Topp 4 & skyttekung");
+ doTopScorer: function(button, event, eventOpts) {
+ this.getFooter().hide();
+ this.getMatchList().hide();
+ this.getTop4().hide();
+ this.getTopScorer().show();
+ this.getFooter().show();
},
/**
@@ -180,6 +223,10 @@ Ext.define('EM.controller.ResultsPage', {
// ... then apply the selected filter
store.filterBy(function(record, id) {
return record.getRound().get(filterKey) == filterValue
- }, this);
+ }, this);
+
+ this.getTop4().hide();
+ this.getTopScorer().hide();
+ this.getMatchList().show();
}
});
View
@@ -55,8 +55,8 @@ Ext.define('EM.model.Match', {
if (typeof result == 'undefined') {
result = {
- homeTeamScore: 0,
- awayTeamScore: 0
+ homeTeamGoals: 0,
+ awayTeamGoals: 0
};
}
@@ -70,8 +70,8 @@ Ext.define('EM.model.Match', {
if (typeof prediction == 'undefined') {
prediction = {
- homeTeamScore: '',
- awayTeamScore: '',
+ homeTeamGoals: '',
+ awayTeamGoals: '',
}
}
@@ -115,8 +115,8 @@ var matchExt = (function() {
/**
* Verifies the betted result agains the actual result.
*/
- matchExt.correctBettedResults = function(points, result, prediction) {
- if (typeof points == 'undefined' || points == 0) {
+ matchExt.correctBettedResults = function(score, result, prediction) {
+ if (typeof score == 'undefined' || score == 0) {
// No points given for this match, so no need to continue.
return '';
}
@@ -125,15 +125,15 @@ var matchExt = (function() {
return 'correct-result';
}
- if (this.checkFirstTeamWin(result.homeTeamGoals, result.awayTeamGoals, prediction.homeTeamGoals, prediction.awayTeamGoals)) {
+ if (this.checkHomeTeamWin(result.homeTeamGoals, result.awayTeamGoals, prediction.homeTeamGoals, prediction.awayTeamGoals)) {
return 'home-team-win';
}
- if (this.checkSecondTeamWin(result.homeTeamGoals, result.awayTeamGoals, prediction.homeTeamGoals, prediction.awayTeamGoals)) {
+ if (this.checkAwayTeamWin(result.homeTeamGoals, result.awayTeamGoals, prediction.homeTeamGoals, prediction.awayTeamGoals)) {
return 'away-team-win';
}
- if (this.checkDraw(result.homeTeamGoals, result.awayTeamGoals, prediction.homeTeamGoals, prediction.awayTeamGoals)) {
+ if (this.checkDrawedResult(result.homeTeamGoals, result.awayTeamGoals, prediction.homeTeamGoals, prediction.awayTeamGoals)) {
return 'drawed';
}
}
@@ -148,29 +148,29 @@ var matchExt = (function() {
/**
* Returns true if the betted result exactly matches the actual result.
*/
- matchExt.checkForCorrectResultBet = function(homeTeamGoals, awayTeamGoals, homeTeamGoals, awayTeamGoals) {
- return (homeTeamGoals == homeTeamGoals) && (awayTeamGoals == awayTeamGoals);
+ matchExt.checkForCorrectResultBet = function(homeTeamGoals, awayTeamGoals, predictedHomeTeamGoals, predictedAwayTeamGoals) {
+ return (homeTeamGoals == predictedHomeTeamGoals) && (awayTeamGoals == predictedAwayTeamGoals);
}
/**
* Returns true if the betted result had more first team goals than second team goals and the actual result had the same.
*/
- matchExt.checkFirstTeamWin = function(homeTeamGoals, awayTeamGoals, homeTeamGoals, awayTeamGoals) {
- return (homeTeamGoals > awayTeamGoals) && (homeTeamGoals > awayTeamGoals);
+ matchExt.checkHomeTeamWin = function(homeTeamGoals, awayTeamGoals, predictedHomeTeamGoals, predictedAwayTeamGoals) {
+ return (homeTeamGoals > awayTeamGoals) && (predictedHomeTeamGoals > predictedAwayTeamGoals);
}
/**
* Returns true if the betted result had more second team goals than first team goals and the actual result had the same.
*/
- matchExt.checkSecondTeamWin = function(homeTeamGoals, awayTeamGoals, homeTeamGoals, awayTeamGoals) {
- return (homeTeamGoals < awayTeamGoals) && (homeTeamGoals < awayTeamGoals);
+ matchExt.checkAwayTeamWin = function(homeTeamGoals, awayTeamGoals, predictedHomeTeamGoals, predictedAwayTeamGoals) {
+ return (homeTeamGoals < awayTeamGoals) && (predictedHomeTeamGoals < predictedAwayTeamGoals);
}
/**
* Returns true if the betted result were a drawed result and the actual result also was a drawed result.
*/
- matchExt.checkDraw = function(homeTeamGoals, awayTeamGoals, homeTeamGoals, awayTeamGoals) {
- return (homeTeamGoals == awayTeamGoals) && (homeTeamGoals == awayTeamGoals);
+ matchExt.checkDrawedResult = function(homeTeamGoals, awayTeamGoals, predictedHomeTeamGoals, predictedAwayTeamGoals) {
+ return (homeTeamGoals == awayTeamGoals) && (predictedHomeTeamGoals == predictedAwayTeamGoals);
}
/**
View
@@ -0,0 +1,37 @@
+Ext.define('EM.view.Footer', {
+ extend: 'Ext.Toolbar',
+ xtype: 'footer',
+
+ config: {
+ id: 'footer',
+
+ items: [
+ {
+ xtype: 'button',
+ text: 'Regler',
+ handler: function() {
+
+ }
+ },
+ {
+ xtype: 'button',
+ text: 'Bjud in en kompis',
+ handler: function() {
+
+ }
+ },
+ {
+ xtype: 'button',
+ text: 'Byt lösenord',
+ handler: function() {
+
+ }
+ },
+ {
+ xtype: 'button',
+ text: 'Logga ut',
+ id: 'logout',
+ },
+ ],
+ }
+})
View
@@ -3,8 +3,8 @@ Ext.define('EM.view.LastUpdated', {
xtype: 'lastupdated',
config: {
- id: 'last-updated',
data: {},
- tpl: '<img id="clock" src="resources/images/clock.png" />Senast uppdaterad: {lastUpdated}'
+ tpl: '<img id="clock" src="resources/images/clock.png" />Senast uppdaterad: {lastUpdated}',
+ cls: 'last-updated'
}
});
View
@@ -6,6 +6,6 @@ Ext.define('EM.view.Main', {
items: [
{
xtype: 'resultspage'
- }
+ },
]
});
View
@@ -13,6 +13,9 @@ Ext.define('EM.view.MatchList', {
store: 'Matches',
grouped: true,
scrollable: false,
+ showAnimation: Ext.create('Ext.fx.animation.Slide', {
+ direction: 'right'
+ }),
/*plugins: [
{
xclass: 'Ext.plugin.PullRefresh',
@@ -22,13 +25,13 @@ Ext.define('EM.view.MatchList', {
itemTpl: [
'<div class="match-meta-data">',
- '<div class="team-wrapper home-team">{firstTeam} <div class="flag">{firstTeamFlag}</div> <span class="goals-scored">{result.homeTeamScore}</span></div>',
+ '<div class="team-wrapper home-team">{firstTeam} <div class="flag">{firstTeamFlag}</div> <span class="goals-scored">{result.homeTeamGoals}</span></div>',
'<div class="kick-off-time">{kickOffHour}</div>',
- '<div class="team-wrapper away-team"><span class="goals-scored">{result.awayTeamScore}</span> <div class="flag">{secondTeamFlag}</div> {secondTeam}</div>',
+ '<div class="team-wrapper away-team"><span class="goals-scored">{result.awayTeamGoals}</span> <div class="flag">{secondTeamFlag}</div> {secondTeam}</div>',
'<div class="bet-meta-data {bettingOutcome}">',
'<img class="user-icon" src="resources/images/user-22x26.png" />',
- '<div class="home-team goals-bet">{prediction.homeTeamScore}</div>',
- '<div class="away-team goals-bet">{prediction.homeTeamScore}</div>',
+ '<div class="home-team goals-bet">{prediction.homeTeamGoals}</div>',
+ '<div class="away-team goals-bet">{prediction.awayTeamGoals}</div>',
'{pointsEarned}',
'</div>',
'</div>',
View
@@ -0,0 +1,22 @@
+Ext.define('EM.view.Message', {
+ extend: 'Ext.Container',
+ xtype: 'message',
+
+ config: {
+ //id: 'message',
+ cls: 'message',
+ hideAnimation: 'fadeOut',
+ tpl: [
+ '<div>{message}</div>'
+ ],
+ data: {},
+ listeners: {
+ tap: {
+ element: 'element',
+ fn: function() {
+ this.hide();
+ }
+ },
+ }
+ },
+});
View
@@ -14,6 +14,7 @@ Ext.define('EM.view.ResultsPage', {
},
{
xtype: 'lastupdated',
+ id: 'matches-last-updated',
},
/*{
xtype: 'matchlist',
Oops, something went wrong.

0 comments on commit 383fb9f

Please sign in to comment.