Content deleted Content added
add table anchor and wording for future events per talk page |
fix text color in dark mode; this generally works but may cause problems, in which case revert or try specifying a different CSS value |
||
(11 intermediate revisions by 4 users not shown) | |||
Line 36:
-- Edit links if requested
local baselink = frame:getParent():getTitle()
if
if mw.title.getCurrentTitle().fullText == baselink then baselink = '' end
local template_name = (baselink ~= '' and (':' .. baselink .. (table_anchor ~= '' and '#' .. table_anchor or '')))
or ''
Line 73 ⟶ 74:
local full_table = true
local hide_results = yesno(Args['hide_results'] or 'no')
local hide_footer = yesno(Args['hide_footer'] or 'no')
local pld_pts_val = string.lower(Args['only_pld_pts'] or 'no')
local show_class_rules = yesno(Args['show_class_rules'] or 'yes') and true or false
Line 195 ⟶ 197:
-- Add empty column header
t_return.count = t_return.count+1
table.insert(t_return.tab_text,'! scope="row" class="unsortable" style="background-color:white;color:black;border-top:white;border-bottom:white;line-width:3pt;"| \n')
-- Add rest of header
Line 270 ⟶ 272:
local result_local = Args[respre..'result'..ii] or nil
local bg_col = nil
-- Get local background colour
if result_local then
bg_col = result_col[Args[respre..'col_'..result_local]] or Args[respre..'col_'..result_local] or 'inherit'
else
end▼
▲ end
end
if not bg_col then bg_col = 'background-color:transparent; color: inherit;' end -- Becomes default if undefined
-- Bold this line or not
Line 416 ⟶ 422:
-- Get background colour
bg_col = nil
if Args[respre..'result'..ii] then
bg_col = result_col[Args[respre..'col_'..result_local]] or Args[respre..'col_'..result_local] or 'inherit'
if bg_col == '
else
bg_col = 'background-color:'..bg_col..';color:black;' -- Full style tag
end▼
end
if not bg_col then bg_col = 'background-color:transparent; color: inherit;' end -- Becomes default if undefined
-- Check for notes
local note_res_string, note_ref, note_text = '', '', ''
Line 484 ⟶ 494:
local legs = tonumber(Args['legs']) or 1
-- Add empty cell
table.insert(t,'| style="background-color:white;color:black;border-top:white;border-bottom:white;"| \n')
-- Now include note to match results if needed
Line 553 ⟶ 563:
-- Date updating
local matches_text = Args['matches_text'] or 'match(es)'
if string.lower(update)=='complete' or hide_footer then
-- Do nothing
elseif update=='' then
Line 560 ⟶ 570:
elseif string.lower(update)=='future' then
-- Future start date
▲ table.insert(t_footer,'First '..matches_text..' will be played in '..start_date..'. ')
▲ end
else
table.insert(t_footer,'Updated to '..matches_text..' played on '..update..'. ')
Line 575 ⟶ 581:
local stack_string = '<br>'
if footer_break and (not (string.lower(update)=='complete')) and not hide_footer then table.insert(t_footer,stack_string) end
if source ~= '' and not hide_footer then
table.insert(t_footer,'Source: '..source)
end
if class_rules and full_table and show_class_rules and not hide_footer then
if (#t_footer > 0) then table.insert(t_footer,'<br>') end
table.insert(t_footer,'Rules for classification: '..class_rules)
Line 604 ⟶ 610:
end
-- Now if it contains entries the '; ' needs to be removed
if status_exist and not hide_footer then
if (#t_footer > 0) then table.insert(t_footer,'<br>') end
status_string = mw.ustring.sub(status_string,1,mw.ustring.len(status_string)-2)
|