User talk:CRwikiCA/Archive 2

Cup winners and league tables
Hi, I have been editing sandbox for Premier League table and I have a solution for cupwinner as a parameter and then the layout decides tjhe rows. It is currently only done for position 10 (team=SKE) but I took it step by step. You can see my diff what I did, I removed noqr (as for know during testing, will re-add in sandbox later), I also reomved rowspan and after that (the two rows) I coded the qualification. The issue with England is two cups which makes them unique (with France) so it looks more complicated then it actually is, in other league tables it would look better. The sandbox I edited is 2014–15 Premier League table/layoutsandbox and parameters is added to 2014–15 Premier League table/sandbox and results can be seen at 2014–15 Premier League table/testcases. What do you think? Currently only team SKE works, but I took one team at the time. QED237&#160;(talk) 22:10, 7 September 2014 (UTC)
 * This solution seems to be working and might be very useful. The coding is quite involved with a switch statement around if-statements, is there no alternative within the wiki-html markup? (The code is also impossible to really read, because you can't work with linebreaks and tabs. Another reason that switching to Lua in the long run is probably the way to go.) My brain is cooked from the weekend, so I will give it another think through if I get a fresh brain during the week... CRwikiCA  talk 23:31, 7 September 2014 (UTC)
 * Now it should be working for position 1 to 17 (I have not yet tried for 18-20 with relegation and qualification collision (will look at wigan from previous years as example). And yes the code got quite complicated, mainly because of two cups in England, perhaps there is a better solution (I will try find it). It will be easier for other leagues with only one cup, now for every row we have to check both league cup and fa cup and a lot of different scenarios if both won by same team, top five teams and so on. Also as a extra twist team5 is already qual for group stage so they can have two teams to same competition which makes it more complicated. When england is done I can test eredivisie to see how complicated that is. QED237&#160;(talk)</b></i> 00:04, 8 September 2014 (UTC)
 * I am not to sure what you mean with wiki-html markup and if that can be used? <i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 00:06, 8 September 2014 (UTC)
 * About the possibilty to read I believe we can make breaks in the code? For example a new row for a new case in the switch? Perhaps that improves read-ability? <i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 00:10, 8 September 2014 (UTC)
 * Not sure how to do with last three teams (or I know how but it is complicated. Look at how it was solved in 2012–13 Premier League, they did not use the template for that row (position 10) but something that looks like the template code. <i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 09:29, 8 September 2014 (UTC)
 * That 2012–13 example is a real extreme case, but it is a real possibility... I would almost say for implementation of that instead of breaking it into two lines have the team scored etc in red, the quali/rel in blue and list both entry into Europa League and relegation on one line (maybe more abbreviated than normal, because you would probably put a note anyway). Line-breaking does improve readability but some line breaks would show up in the table, so it cannot be as clear and easy to understand as one might want. Adding all these possibilities definitely creates a monster of a code. I'll take a closer look at it again later when I have some more time.  CRwikiCA  <i style="color:navy">talk</i> 14:54, 8 September 2014 (UTC)
 * There doesn't seem to be an option of logical operators (and or or) that would make the code easier to understand and cut down on the number of statements. The implementation seems alright to me, but I cannot see anyone that would have no previous involvement in these table making sense out of the code. I will try and do something in Lua, but I cannot estimate how long it would take and whether it would be a success in the end or not. CRwikiCA  <i style="color:navy">talk</i> 18:33, 8 September 2014 (UTC)
 * I believe the code in the sandbox is currently working now, the noqr works on the correct subtemplates and the bolding, colors and qualification row all seems to work (for teams 1-17). I have a few questions.
 * I tried adding comments in the noqr and it seems to work without errors, do you want more comments in rest of template were possible?
 * How to you think I should do with teams 18,19 and 20. Same coding as for 2012-13 season or some other solution? I does not feel like we can leave those without qualification as it may happen.
 * Should we perhaps add even more parameters to avoid people editing the layout and cover future round changes in CL and EL? As example we could have parameters for all possible notes so instead of editors going to layout to add "nt=1" we could have "fa_note" and "lc_note" for those cups as the often require note. Should we have parameters for deduction of points as that can be added to the team template? Maybe in a few years cup winner qualify for an other round as nations change ranking so should we have a parameter for cup winner round and competition? Currently the template used, "fb cl2 qr", can not remove season numbers so should we change that template to fb cl3 qr and pass wikilink as a parameter?
 * I have removed the rowspans as they are very complicated to calculate length of rowspan for every team/row, van we ignore the rowspan?
 * I may have forgotten a few things but after we solve 18,19, 20 maybe the solution is ready to be copied/implemented to the real layout. <i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 21:54, 8 September 2014 (UTC)
 * I'll reply in order:
 * I understand the code now, the real question is whether someone that never saw this would understand it relatively quick. I don't know how to really go about it because of the complexity.
 * I would suggest to keep it on one line if possible, having it take two line doesn't look good in my opinion. I would suggest to keep the position/club/w/l/f/gf/ga/gd red in those circumstances and then have the qualification bar blue for the cup win. Then add a note to it that they are both relegated and qualified for European football.
 * I do not know how much you want to include in the template, especially if we/I can get a Lua version going, it might be better to include all the options in there and not include things that are probably not going to be needed this year. If you have the time, and feel like implementing all possible results, feel free do to that. I do not think that template coding give you the flexibility to foresee and prepare all options.
 * I would indeed suggest to ignore the rowspan for now, there is no way to properly hard code that. The only feasible way to include that would be to code it dynamically which might only happen in Lua.

You're doing a good job, and after finetuning the 18,19,20 options it would be fine to bring to the live template in my opinion (also update the documentation to list the new parameters). CRwikiCA <i style="color:navy">talk</i> 22:33, 8 September 2014 (UTC)


 * Just as an example I tried it out for that specific table to see how it works without switch statements etc:

Something like that would probably do the trick, possibly with some changes in wording. Or would you not think that would work? CRwikiCA <i style="color:navy">talk</i> 14:36, 9 September 2014 (UTC)
 * Thank you for the example, I am a bit torn myself what is best and I believe it is best to take it to the football project for input and consensus. Also perhaps open a new discussion regarding the other rows if we should show "relegaion to", "qualification to" and "promoted to" and also if we should display season or not. If we are not to show season for the CL we have to either change a lot of fb round2-templates or use fb cl3 with wikilinks everywhere and risk for mistakes in linking instead of fb cl2 with templates. But with "qualification to" the row gets to long with the seasons and we get a linebreak, whoch may be why it is currently not shown on all articles. We need consensus as we always currently show season in all tables with qualification to EL and CL. Also regarding your solution I am not sure that instering text in "competition"-parameter was not intention of that parameter. <i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 22:27, 9 September 2014 (UTC)
 * I change the table to use the qual/rel parameters and try what we said in earlier discussions. <i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 22:38, 9 September 2014 (UTC)

After going deeper into the league table the last several weeks, I am wondering whether a lot of current practice just evolved without discussion (not that that is per se a bad thing). There was consensus to remove team name templates and as such their use is being depreciated. As such would the fb round2 templates not face a similar fate if discussed, because the arguments would be exactly the same. I do personally think that for a new table system in Lua we should consider everything from scratch and avoid hardcoding content such as "qualification to" and "relegated to" in there – the text |relegation=y has almost the same length and a lot less user options (and that doesn't include the headaches if it is not documented properly). I appreciate your drive to find consensus. For me, the big question at this point is how we would merge the display of international team football tables with league tables, because the style is different between the league tables and e.g. UEFA Euro 2016 qualifying Group A. I do not think it would be good form to include both options, as is, in a master Lua module. CRwikiCA <i style="color:navy">talk</i> 18:43, 10 September 2014 (UTC)
 * Yes I believe you are right a lot has developed without consensus (both good and bad) and I believe now we should try and find consensus. The LUA will most6 likely be very hard to form as many things are different from league to league, with number of teams, number of teams relegated and so on. I think it would be best to only have the league tables in LUA at least as a start and not try and incorporate other tables as well. I will go to footy now to seek consensus both for the situation with both qualification/relegation and the situation regarding the text in qualification/relagation column. As the example above not all text fits in one row (for third round) so perhaps we should find consensus to increase width of that column in the header template. <i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 20:05, 10 September 2014 (UTC)
 * My intention would be to first see whether I can get a bare-bones table making Module and then build it from there based on what would be needed. When the time comes, we can discuss the various issues more broadly in WT:FOOTY. CRwikiCA  <i style="color:navy">talk</i> 23:58, 10 September 2014 (UTC)
 * Sounds good. By the way I can mentioned I opened discussion at FOOTY regarding pos 18,19,20 and the wording in tables.<i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 00:16, 11 September 2014 (UTC)

Does not seem like we will get more comments at FOOTY so what should I do next? If I interpret discussion correctly everyone agrees to remove the fb cl2 gr-template that depends on the fb round2 template so I will fix that. Also the issue with both qualification and relegation seems like everyone agrees it should be on one row, so I fix that to. If you have a good wording for that row please let me know.

But how about the width of qualification-column? Should we put a number in the template with the chance it gets to narrow and we will have a linebreak (not looking to good) or maybe risk it and the column can get wide? We can always test how wide it can get as the longest (when second/third qualifying round).

And should we list season or not? One editor gave a good reason because some leagues dont have fall/spring seasons over two years ie 2014-15, but they have spring/fall ie sweden with 2014 Allsvenskan. Then it is not clear if it is qual to 2014-15 CL, 2015-15 CL or 2015-16 CL to the reader. Also it was said that qualification to and relegation to might not be needed. <i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 11:44, 12 September 2014 (UTC)
 * Yes, I think there won't be more comments at WT:FOOTY. And I see the same consensus in the results of the discussion. For the column width, it will automatically get smaller (with line break) when the browser window is narrower than the table. For that reason I think we can do without a fixed width. With regard to the wording, it is also a given that it would be the UEFA CL, so it might be an option to drop UEFA from the wording and add the year instead. Another comment was to remove the text "qualification to" and "relegation to" altogether, which would also reduce the amount of text (and remove the redundancy with the column header). CRwikiCA  <i style="color:navy">talk</i> 14:26, 12 September 2014 (UTC)

I re-add table again to see if we can agree on that or if something should change (for example wording).

What do you think? I am 50/50 about UEFA or not, if spreading over wikipedia UEFA may be good if table used on other continents. <i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 15:00, 12 September 2014 (UTC)

Just to other options for text so we can see how it compares: I think the second of these two is way too condensed and impossible to make sense off. I think I do agree with you to include UEFA, because it is the full name of the competition. In turn omitting "qualification to" and "relegation to" reduces the width a bit. It is also redundant with both the column header and the boldface R, Q and TQ that are used as well. Let me know what you think. CRwikiCA <i style="color:navy">talk</i> 16:19, 12 September 2014 (UTC)

Yes I can agree with you. The second of your alternatives are too condensed and not my favourite. UEFA is full name so yes including it would also be good. I am torn about the relegation text as it is informative but it gets long and as you say we already have the boldfaces so I can agree it is redundant. The question know is why we use "relegation" for case with both qual and rel, should that be tournament as well? Putting up the two final(?) alternatives.

or what do you say? I can live with both. Even if the boldface Q is not shown after season has ended (the R however does) the "qualification to" may be redundant. <i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 16:37, 12 September 2014 (UTC)


 * Thinking about it I might like my last/second alternative best even if there is a linebreak because it is the most informative (if you dont have "qualification to" and "relegation to" of course) <i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 16:43, 12 September 2014 (UTC)


 * I have to say I dislike the linebreak, because it makes the whole table look out of whack. I understand your point about relegation maybe not be the right word. Because of it's rarity and because some elements are repeat from other lines (e.g.) I would see:

as an option, because it limits the width of the line, and eliminates repeating the year, UEFA, and Football Leauge for this particular line (all details can be included in the footnote). CRwikiCA <i style="color:navy">talk</i> 17:14, 12 September 2014 (UTC)
 * }

For the sub-table with last five teams UEFA will never be shown/repeated and it is not that long to add four letters extra but otherwise I can agree with what you are saying. I will start implement tomorrow and think about if we should have UEFA or not. <i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 22:11, 12 September 2014 (UTC)


 * Good point, just include UEFA in there for that reason. (It will be rare anyway that it would be used). CRwikiCA  <i style="color:navy">talk</i> 22:32, 12 September 2014 (UTC)

Editing the sandbox I realize there are for every row two large/long wikilinks if team is FaCupWinner or LeagueCupWinner and next season all those would have to be changed, at least year but possibly also round. Would it not be easier to have a parameter for those wikilinks like "FaWinnerCompetition" and "LeagueCupWinnerCompetition"? Then making new table next season is so much easier for unexperienced editors. Thinking about doing the same for the other qualifications/relegations as well. <i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 23:07, 12 September 2014 (UTC)
 * I would always support separating the lay-out and content, in this case the competition is content, so implementing what you suggests sounds fine to me. CRwikiCA  <i style="color:navy">talk</i> 17:52, 14 September 2014 (UTC)

Hi again, time for a new update. I have updated 2014–15 Premier League table/layoutsandbox and the table can be updated at 2014–15 Premier League table/sandbox and all cases watched at 2014–15 Premier League table/testcases (press update/refresh on top of page after changing sandbox). What I have done is that all cases of facupwinner and leaguecupwinner should work now as well as the bolding. I also moved out the wikilinks to qualification as parameters to hlep updating for next season. The layout code got very complicated and large, mostly because the english league system has two leagues instead of one (which gives more than double work, for a second competiton, i estimate about 150% extra code).

I would appreciate if you could have a quick look that all works as expected before implementation. Also I would like to say that the relegation and qualification issue did not be as good as expected, this because when having wikilinks as parameters sent in I can not pipe the as I want so it is "all or nothing" in showing the wikilinks and a linebreak had to be used.

Next step is to further use parameters to avoid editors editing the layout but I want to run my ideas with you first. Here are things I think about:
 * 1) Notes, we must have parameters in table template for notes, that most likely will be needed, so that editors dont try go to layout to add notes. I am thinking ntqrXX (XX=1,2,3,4,5,18,19,20) and ntqrfa, ntqrlc for notes in the qualification/relegation column that may be needed, and also ntpointXX (XX=1,2,...20) for notes on points if point deduction, that may also be needed.
 * 2) Qualification/relegation color. As I have wikilinks for the tournament the colors should also be able to change if 5th placed team maybe go to playoff instead of group stage next season. Parameters could be bcXX (XX=1,2,...20)
 * 3) Parameter for point deduction dpXX (XX=1,2,...20) as teams may have points deducted.
 * 4) Parameter for the letters next to team name such as Q, TQ, R and so on. Here I have two solutions
 * One parameter qrXX (XX=1,2,3,4,5,18,19,20) and qrfa, qrlc that can be set to R,TQ,C,Q,RQ (relegated and qualified)... to cover all possible alternatives and then in layout we will have switch:qrXX, if (R or RQ) then relegated=y and so on. Positive is that it is few parameter, but as negative it has a lot of possibilities and may be hard for editors to know how to use it.
 * Several parameters relegatedXX (XX=18,19,20), champion, qualifiedXX and so on. The positive is that it is like old template and may be easier to understand but the downside is that it may be many parameters.

All these possible parameters would help that editors dont edit layout. Of cource documentation will be updated. What do you think? <i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 22:32, 16 September 2014 (UTC)


 * The only issue I see is that when 5 and 6 are both EL group stage and when the table displays the top 5, that rows should be 1 instead of 2 for EL group stage (see current testcase version). It is a worthwhile enterprise to try to foresee all possible options, but it might not be ideal to try to solve all issues in one master template. If you have the time, and want to spend the effort, feel free to add these additions to the template. The Lua implementation went quicker so far than expected, so we might just want to address all that in there (coding would be easier, because it iterates over the teams rather than explicitly naming each parameter). CRwikiCA  <i style="color:navy">talk</i> 23:16, 16 September 2014 (UTC)

I dont see any problem in the current testcases? For what team is there and error? Perhaps it is a browser thing. And I realize this got way to complicated and can not be done for every league it will be way to hard work if I would to this to spain, germany and so on. LUA seems much better. If you want any help with the LUA let me know and I will do my best to help. Never done LUA before but for example C (directly on low level processors), C++ (various projects and games), Java (some database and realtime coding) and Scheme (programming language) and I get the majority of the code so I may be able to help if needed. I will look at the to do-list as well if anything needs adding. The thing I dont understand currently is how the .. orks and when to use it as well as the doubled teamlist and how it is indexed with team on index position and then postition on index team? But this discussion should be under our LUA topic. <i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 23:43, 16 September 2014 (UTC)
 * I have now corrected the issue (I think). It was an error that was not to be seen in Chrome, but I could see it in explorer and firefox. Did you mean that the rows were not "closed" with a line on bottom when team was 2nd placed swansea or third placed team? If so then it is corrected. <i style="font-family:Verdana"><b style="color:blue">QED</b><b style="color:red">237</b>&#160;<b style="color:green">(talk)</b></i> 11:12, 17 September 2014 (UTC)
 * Yes, that was what I meant. I'll reply to the Lua comments on your page. CRwikiCA  <i style="color:navy">talk</i> 14:21, 17 September 2014 (UTC)