Changeset 1977603
- Timestamp:
- 11/20/2018 06:24:32 PM (7 years ago)
- Location:
- amilia-store/trunk/shortcodes
- Files:
-
- 2 edited
-
amilia-store-standings.js (modified) (1 diff)
-
amilia-store-standings.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
amilia-store/trunk/shortcodes/amilia-store-standings.js
r1974987 r1977603 186 186 187 187 storeUrl.onchange = function() { 188 Amilia.validateStoreUrlAndFetchProgramAndTags();188 validateStoreUrlAndFetchProgramAndTags(); 189 189 }; 190 190 -
amilia-store/trunk/shortcodes/amilia-store-standings.php
r1974987 r1977603 25 25 $errorWhenNojQuery = __("Amilia calendar requires jQuery. It cannot be shown.", 'amilia-store'); 26 26 $errorNoProgram = __("No programs found.", 'amilia-store'); 27 $legend = __("GP = Games played, W = Win, T = Tie, L = Lost, F = Goals for, A = Goals against, GD = Goal differential, Pts = Points", 'amilia-store'); 27 $legend = $sport == 'football' ? 28 __("GP = Games played, W = Win, T = Tie, L = Lost, % = Percentage, PDiff = Point difference, Pts = Points", 'amilia-store') : 29 __("GP = Games played, W = Win, T = Tie, L = Lost, F = Goals for, A = Goals against, GD = Goal differential, Pts = Points", 'amilia-store'); 28 30 $label_Team = __("Team", 'amilia-store'); 29 31 $label_Home = __("Home", 'amilia-store'); … … 36 38 $label_A = __("A", 'amilia-store'); 37 39 $label_GD = __("GD", 'amilia-store'); 40 $label_Perc = __("%", 'amilia-store'); 41 $label_PDiff = __("PDiff", 'amilia-store'); 38 42 $label_Pts = __("Pts", 'amilia-store'); 39 43 $label_Location = __("Location", 'amilia-store'); … … 157 161 GP: 0, 158 162 W: 0, 163 L: 0, 159 164 T: 0, 160 L: 0, 165 GD: 0, 166 Pts: 0, 167 // Soccer 161 168 F: 0, 162 169 A: 0, 163 GD: 0,164 P ts: 0170 // Football 171 Perc: 0 165 172 }; 166 173 id2team[id] = team; … … 226 233 var team = id2team[ids[i]]; 227 234 team.GD = team.F - team.A; 235 team.Perc = (team.W + team.T/2) / (team.W + team.T + team.L); 236 if (isNaN(team.Perc)) team.Perc = 0; 228 237 teams.push(team); 229 238 } … … 248 257 '<td>' + team.W + '</td>' + 249 258 '<td>' + team.L + '</td>' + 250 '<td>' + team.T + '</td>' + 251 '<td>' + team.F + '</td>' + 252 '<td>' + team.A + '</td>' + 253 '<td>' + team.GD + '</td>' + 254 '<td>' + team.Pts + '</td>' + 259 '<td>' + team.T + '</td>'; 260 if (sport == 'football') { 261 html += '<td>' + (team.Perc ? Math.round(1000*team.Perc)/1000 : '-') + '</td>'; 262 } else { 263 html += '<td>' + team.F + '</td>' + 264 '<td>' + team.A + '</td>'; 265 } 266 html += '<td>' + team.GD + '</td>' + 267 '<td>' + team.Pts + '</td>' + 255 268 '</tr>'; 256 269 addToCalendarTooltipHtml += … … 403 416 <th>$label_L</th> 404 417 <th>$label_T</th> 418 EOD; 419 if ($sport == 'football') { 420 $html .= <<<EOD 421 <th>$label_Perc</th> 422 <th>$label_PDiff</th> 423 EOD; 424 } else { 425 $html .= <<<EOD 405 426 <th>$label_F</th> 406 427 <th>$label_A</th> 407 428 <th>$label_GD</th> 429 EOD; 430 } 431 $html .= <<<EOD 408 432 <th>$label_Pts</th> 409 433 </tr>
Note: See TracChangeset
for help on using the changeset viewer.