added some support for practices

This commit is contained in:
didier amyot committed 2021-06-15 16:55:21 -04:00
1 parent 2f7dcdc5d0
commit 548d4c1def
3 files changed
+53 -11

No files matched your search

+4 -4
View File
@@ -7,8 +7,8 @@
away: jaune
gris: ~
jaune: ~
pratique: true
rain: true
practice: true
rain: false
-
date: 2021/07/01 # year/month/day
@@ -17,8 +17,8 @@
away: jaune
gris: ~
jaune: ~
pratique: true
rain: true
practice: true
rain: false
##############################################################
+1 -1
View File
@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<script>
+48 -6
View File
@@ -133,25 +133,67 @@ define(['m', '_', 'util', 'resultParser', 'teams', 'views/topNavBar', 'views/foo
];
};
schedulView._getAwayPracticeTeamTag = function(){
return [
m('i.fa.fa-hand-spock-o', {style: {color: ' #ff1493'}}),
m('span', ' Amis #1')
];
};
schedulView._getHomePracticeTeamTag = function(){
return [
m('i.fa.fa-hand-spock-o', {style: {color: '#acbf60'}}),
m('span', ' Amis #2')
];
};
schedulView._getAwayTeamTag = function(game){
if(game.practice){
return schedulView._getAwayPracticeTeamTag();
}
return schedulView._getTeamTag(game.away);
};
schedulView._getHomeTeamTag = function(game){
if(game.practice){
return schedulView._getHomePracticeTeamTag();
}
return schedulView._getTeamTag(game.home);
};
schedulView._asGamePoints = function(points){
return !_.isNumber(points) ? '-' : points + '';
};
schedulView._gameName = function(game){
if(game.rain){
return [rainSvg('1.5em'), " ", game.time];
schedulView._practiceIcon = function(game){
if(game.practice){
return m('i.fa.fa-handshake-o');
}
return [game.time, " ", m('span', {style: {visibility: 'hidden'}}, rainSvg('1.5em'))];
return m('span', ' ');
};
schedulView._rainIcon = function(game){
if(game.rain){
return m('span', {title: 'pluie, partie annulée.'}, rainSvg('1.5em'));
}
return m('span', {style: {visibility: 'hidden'}}, rainSvg('1.5em'));
};
schedulView._gameName = function(game){
return [schedulView._rainIcon(game),
" ",
game.time];
};
schedulView._gameRow = function(game){
return m('tr',[
m('td', schedulView._gameName(game)),
m('td', schedulView._getTeamTag(game.away)),
m('td', schedulView._getAwayTeamTag(game)),
m('td', schedulView._asGamePoints(game.away_points)),
m('td', 'vs'),
m('td', schedulView._getTeamTag(game.home)),
m('td', schedulView._getHomeTeamTag(game)),
m('td', schedulView._asGamePoints(game.home_points))
]);
};