Module talk:Team bracket
![]() | This module was considered for deletion on 10 February 2021. The result of the discussion was "no consensus". |
Use for tennis?
Could this module be used for tennis templates, such as {{8TeamBracket-Tennis3}}? There are 3 score cells and teams can be one line for singles or two lines for doubles. See Template:8TeamBracket-Tennis3/testcases for examples. —PC-XT+ 18:39, 5 March 2015 (UTC)
- @PC-XT: I did make Module:TeamBracket-Compact-Tennis but ran into objections from one user upon deployment. So I gave up. See Template talk:16TeamBracket-Compact-Tennis3#Convert to lua version. --SocietyBox (talk) 13:14, 6 March 2015 (UTC)
- Thanks. I'll see if I can get some discussion at WT:TENNIS#What do you think of Lua modules? before I try a conversion. —PC-XT+ 20:10, 6 March 2015 (UTC)
Suggestions
Maybe some colors can be added? For example, to implement this template. --Edgars2007 (talk/contribs) 18:15, 5 April 2015 (UTC)
- @SocietyBox: and what about 3rd place? For example, for this one. If it helps, RoundN module has 3rd place option (ctrl+F:
By default, |3rdplace= is set to 'yes' when
) --Edgars2007 (talk/contribs) 08:16, 15 May 2015 (UTC)
Modifying numbers
Presently the 4 round variants (and above) allow for the modification of the seeds to show the higher seeded team on the top of each pairing. Is it possible to do the same on the 2 and 3 round versions. –Z.I. Barbour (talk) 04:01, 17 December 2017 (UTC)
Feature request: more matches per round and third place match
Looking at the sea of templates at Category:8-Team bracket templates, it seems the reason for the mass creations of essentially forks, is that some brackets need 2 features: more matches per round and an option to add a third place match. If this will be added to the module, it will allow converting dozens of other templates. Is this something that can be added to this? --Gonnym (talk) 11:03, 13 June 2019 (UTC)
- Gonnym, Module:TeamBracket-Tennis has both of these features. my hope is to merge these modules into one, or at the very least, port some of the features from Module:TeamBracket-Tennis to this module. Frietjes (talk) 16:30, 13 June 2019 (UTC)
- Ah, now I see that some of those templates are calling that module (the template doc didn't say that and didn't check the code before). It totally makes sense for those two modules to be merged. --Gonnym (talk) 16:49, 13 June 2019 (UTC)
- Gonnym, I will work on merging them. the only differences are (1) the width of the lines dividing the score and team names, (2) automatic generation of the seeds for the first round, (3) the default number of sets/legs. I plan to (1) make the width of the dividing lines an option, (2) make the automatic seed generation an option, (3) make the default number of sets/legs an option. as a transition, I can probably make the tennis module a frontend for this module that just sets these two parameters and calls this module. Frietjes (talk) 16:55, 13 June 2019 (UTC)
- That's a great plan. I haven't researched this fully yet, but from my experience with the wiki, I would guess that anything related to widths are just subjective personal tastes of a few editors and then copy/paste from everyone else. These, like other merges, would be much better served with a consistent look and feel. Regarding the number of sets/legs, those can be handled either through generalized templates or just adding manually that code. Not sure I can see the value in leaving the Tennis one, as it has various layouts itself which at least some aren't unique to it - but we will be smarter once a merge is done, so no need to jump the gun on that. Unrelated, but a related thing to look into, and I'm not sure how best to deal with, the boxes aren't really accessibility compliant as there aren't any headers for the cells. A simple solution would just add that to each box, but that would duplicate it visually and would probably draw complains from editors. No idea how to do it otherwise. --Gonnym (talk) 17:20, 13 June 2019 (UTC)
- I have switched this template over to use new backend code as part of the code merger with the Tennis template, and for supporting legs/byes/etc. there should be no significant changes in appearance/functionality. please let me know if you see any problems so I can fix any bugs. thank you. Frietjes (talk) 17:28, 9 February 2021 (UTC)
- That's a great plan. I haven't researched this fully yet, but from my experience with the wiki, I would guess that anything related to widths are just subjective personal tastes of a few editors and then copy/paste from everyone else. These, like other merges, would be much better served with a consistent look and feel. Regarding the number of sets/legs, those can be handled either through generalized templates or just adding manually that code. Not sure I can see the value in leaving the Tennis one, as it has various layouts itself which at least some aren't unique to it - but we will be smarter once a merge is done, so no need to jump the gun on that. Unrelated, but a related thing to look into, and I'm not sure how best to deal with, the boxes aren't really accessibility compliant as there aren't any headers for the cells. A simple solution would just add that to each box, but that would duplicate it visually and would probably draw complains from editors. No idea how to do it otherwise. --Gonnym (talk) 17:20, 13 June 2019 (UTC)
- Gonnym, I will work on merging them. the only differences are (1) the width of the lines dividing the score and team names, (2) automatic generation of the seeds for the first round, (3) the default number of sets/legs. I plan to (1) make the width of the dividing lines an option, (2) make the automatic seed generation an option, (3) make the default number of sets/legs an option. as a transition, I can probably make the tennis module a frontend for this module that just sets these two parameters and calls this module. Frietjes (talk) 16:55, 13 June 2019 (UTC)
- Ah, now I see that some of those templates are calling that module (the template doc didn't say that and didn't check the code before). It totally makes sense for those two modules to be merged. --Gonnym (talk) 16:49, 13 June 2019 (UTC)
3TeamBracket
Frietjes, great work with this module. I converted Template:3TeamBracket to use it and it is generally working great, but there is more padding between the headings and the tree than there was in the pre-lua version. Would it be possible to have the module detect when these rows are blank and eliminate them? Thanks! Plastikspork ―Œ(talk) 19:01, 13 February 2021 (UTC)
- possible, but will probably require two passes, which is painful. I will work on it. Frietjes (talk) 17:40, 16 February 2021 (UTC)
- Plastikspork, okay, now implemented. it was a fairly extensive change, so hopefully nothing broke. I tested the main features in the testscases. Frietjes (talk) 16:24, 10 April 2021 (UTC)
- Thanks! Looks great! Plastikspork ―Œ(talk) 17:39, 10 April 2021 (UTC)
script errors
@ Frietjes: A recent change is causing script errors. See 2009 SaskTel Tankard, 2012 Alberta Scotties Tournament of Hearts, 2015 PEI Tankard, 2019 Newfoundland and Labrador Tankard for examples.
—Trappist the monk (talk) 20:45, 10 April 2021 (UTC)
- The problem appears in function renderThird(count) where, in the for loop,
row = rows[k]
can be nil. By the way,function getSeeds()
should havelocal
. Johnuniq (talk) 02:21, 11 April 2021 (UTC)- yes, thank you, was using the wrong formula for compute the rows for third. Frietjes (talk) 14:34, 11 April 2021 (UTC)
@Frietjes: 2009–10 HockeyAllsvenskan season is showing Lua error: bad argument #1 to 'gsub' (string expected, got boolean) in function scoreCompare. That is due to the following code in Module:Team bracket.
if agg and aggregate ~= '' and score1 == nil and hassum then
score1 = (aggregate == 'score') and sumscore
or (aggregate == 'legs' or aggregate == 'sets' and wins)
or nil
end
The error occurs when aggregate
is 'legs' which makes aggregate == 'legs'
evaluate as true and that is the value assigned to score1
. Line 369 has the form (a or b and c)
which means (a or (b and c))
so if a
is true, that is the result of the expression. I was investigating in the hope of finding a simple way for the error message to show which entry in the table is causing the problem. I've seen similar messages a few times and the fix was simple, but finding the mistake in the article wikitext was difficult. Maybe you can better work out what the logic should be so score1
is never a boolean. Johnuniq (talk) 09:38, 23 April 2021 (UTC)
- Johnuniq, should be fixed now, I forgot the () as you indicated. thank you. Frietjes (talk) 22:26, 23 April 2021 (UTC)
Groups with compact
@Frietjes: Would it be possible to enable groups with compact? I imagine we probably can't fit them in for Round 1, but it looks like there is room for Round 2 and higher. This would help tighten Template:10TeamBracketReSeed. Thanks! Plastikspork ―Œ(talk) 14:36, 7 May 2021 (UTC)
- Plastikspork, this should basically work now. at some point I would like to add round 1 when half the pair is omitted, and make the groups have a wider colspan when possible, but I think it looks okay for now. Frietjes (talk) 16:20, 7 May 2021 (UTC)
boldwinner doesn't work on PK scores
When boldwinner = yes
, the templates do not bold the winner of a match that goes to penalty kicks (e.g. score = 2 (5)
). The game is presumed a tie. For an example of where this fails, see 2002 FIFA World Cup qualification (CONCACAF). This feature works in Module:RoundN. –Aidan721 (talk) 00:27, 11 May 2021 (UTC)
- Aidan721, should work now. Frietjes (talk) 15:48, 1 June 2021 (UTC)
boldwinner change
![]() | This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
In case of boldwinner = high
and aggregate = legs
, highlight winner only if wins > (legs/2)
. Applies to otherwins too. Deancarmeli (talk) 09:00, 1 June 2021 (UTC)
- okay, now changed. Frietjes (talk) 15:41, 1 June 2021 (UTC)
- @Frietjes: The team name is still highlighted when the series isn't yet settled. Deancarmeli (talk) 19:50, 1 June 2021 (UTC)
- Deancarmeli, you need to provide a link to an example. Frietjes (talk) 20:15, 1 June 2021 (UTC)
- @Frietjes: The example. Deancarmeli (talk) 20:58, 1 June 2021 (UTC)
- Deancarmeli, looks fine, may have been a caching issue. Frietjes (talk) 20:59, 1 June 2021 (UTC)
- @Frietjes: The example. Deancarmeli (talk) 20:58, 1 June 2021 (UTC)
- Deancarmeli, you need to provide a link to an example. Frietjes (talk) 20:15, 1 June 2021 (UTC)
- @Frietjes: The team name is still highlighted when the series isn't yet settled. Deancarmeli (talk) 19:50, 1 June 2021 (UTC)
Weird width bug on hideomitted scores
Please see 2021 PDC World Cup of Darts#Draw. When Hideomittedscores is activated, the round 2 first scores display with a larger width than the rest. @Frietjes: any ideas? DLManiac (talk) 06:51, 13 September 2021 (UTC)
- DLManiac, do you see the same thing when you make your browser window large enough that the bracket isn't touching the right edge of the page? the column spacing is set by a blank row between the top headings and the bracket. for this particular example, the code for that spacer row looks like this:
<tr><td style="width:1px"></td>
<td style="width:20px"> </td><td style="width:170px"> </td><td style="width:25px"> </td><td style="width:5px"></td><td style="width:5px"></td>
<td style="width:20px"> </td><td style="width:170px"> </td><td style="width:25px"> </td><td style="width:25px"> </td><td style="width:25px"> </td><td style="width:25px"> </td><td style="width:5px"></td><td style="width:5px"></td>
<td style="width:20px"> </td><td style="width:170px"> </td><td style="width:25px"> </td><td style="width:25px"> </td><td style="width:25px"> </td><td style="width:25px"> </td><td style="width:5px"></td><td style="width:5px"></td>
<td style="width:20px"> </td><td style="width:170px"> </td><td style="width:25px"> </td><td style="width:25px"> </td><td style="width:25px"> </td><td style="width:25px"> </td><td style="width:5px"></td><td style="width:5px"></td>
<td style="width:20px"> </td><td style="width:170px"> </td><td style="width:25px"> </td><td style="width:25px"> </td><td style="width:25px"> </td><td style="width:25px"> </td><td style="width:25px"> </td><td style="width:25px"> </td><td style="width:1px"></td>
</tr>
- The first 1px column is the left edge of the bracket. this column is followed by a 20px column for the 1st round seed, 170px column for the 1st round teams, and a 25px columns for the first round scores. The next two 5px columns are for the lines that connect the first round to the second round. this pattern then repeats for the second, third, fourth rounds. so, the score columns are all set to be 25px wide. if your browser window isn't large enough to fit the table (i.e., 1px + 20px + 170px + 25px + 5px + 5px + ... + 25px + 25px + 1px = 1467px) then your web browser has to decide what to do. in many cases, the browser uses an algorithm to reduce the widths of these columns to try to make the bracket fit in the browser window. the algorithm frequently generates uneven columns as a result (i.e., not all the 25px columns are reduced by the same amount). I could add a width to the outer table, which would probably prevent your browser from trying to compress the table, but you would then have scroll bars to see the part of the table that doesn't fit in the window. Frietjes (talk) 14:40, 13 September 2021 (UTC)
- Yes, they all display full width if I zoom out. I guess I was just thinking that somehow the "auto resize to fit" feature should be applied equally across all the score columns. DLManiac (talk) 18:22, 13 September 2021 (UTC)
- Additionally, setting "score-width=auto" makes that extra column very strange. This feels more like a bug...DLManiac (talk) 18:28, 13 September 2021 (UTC)
- Final update - I set score-width=1.5% and this seemed to be a good fix across all window sizesDLManiac (talk) 18:38, 13 September 2021 (UTC)
Again on Boldwinner
Hello, I imported the module as is on it.wp, but it doesn't show the winner in bold always when there are more than two legs involved: see it:Coppa dei Campioni 1963-1964 and it:Federal Hockey League 2013-2014 for example. What can be the problem here? Sannita - not just another it.wiki sysop 21:37, 2 November 2021 (UTC)
Both of those examples are rendering properly in my browser.DLManiac (talk) 22:02, 2 November 2021 (UTC)- I'm not referring to the scores, those work. I'm referring to the teams: see Jeunesse Esch or Górnik Zabrze in the first round in "Coppa dei Campioni 1963-1964". They should be bold, but they're not. Sannita - not just another it.wiki sysop 22:10, 2 November 2021 (UTC)
- Sorry - did not see that DLManiac (talk) 01:01, 3 November 2021 (UTC)
- Sannita, looks like a bug checking the example in the documentation. I will fix it in a moment. Frietjes (talk) 15:06, 3 November 2021 (UTC)
- Sorry - did not see that DLManiac (talk) 01:01, 3 November 2021 (UTC)
- I'm not referring to the scores, those work. I'm referring to the teams: see Jeunesse Esch or Górnik Zabrze in the first round in "Coppa dei Campioni 1963-1964". They should be bold, but they're not. Sannita - not just another it.wiki sysop 22:10, 2 November 2021 (UTC)