Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/Bradv/Case
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} local sub = mw.ustring.sub local find = mw.ustring.find local gmatch = mw.ustring.gmatch local trim = mw.text.trim local prefix = 'Wikipedia:Arbitration/Requests/Case/' local ptalk = 'Wikipedia talk:Arbitration/Requests/Case/' function render ( tbl, count ) local output = '' if (count > 0) then local div = mw.html.create( 'div' ) div :css( 'text-align', 'left' ) :wikitext( '<p>\n' .. table.concat(tbl, '</p><p>\n') .. '</p>\n' ) output = tostring( div ) else output = "''none''" end return output end function p.dates( frame ) local case = frame.args[1] or frame.args.case return p._dates( case ) end function p._dates( case ) local page = prefix .. case local pagecontent = mw.title.new(page):getContent() local result = {} local re = '\n<big>(.-)</big>' for str in gmatch (pagecontent, re) do table.insert(result, trim(str)) end return render( result, 1 ) end function p.decision( frame ) local case = frame.args[1] or frame.args.case return p._decision( case ) end function p._decision( case ) local page = prefix .. case local pagecontent = mw.title.new(page):getContent() local fdstart = find(pagecontent, '\n=%s*Final decision') local fd = sub(pagecontent, fdstart) local result = {} local count = 0 local re = '\n==(.-)==' for str in gmatch(fd, re) do if find(str, '^%s*Enforcement') then --ignore else if find(str, '^=') then s = trim(sub(str, 2)) table.insert(result, ':[[' .. page .. '#' .. s .. '|' .. s .. ']]') else table.insert(result, "'''" .. str .. "'''") end count = count + 1 end end return render ( result, count ) end function p.arca( frame ) local case = frame.args[1] or frame.args.case return p._arca( case ) end function p._arca( case ) local page = ptalk .. case local pagecontent = mw.title.new(page):getContent() local result = {} local count = 0 local re = '\n==(.-)==' for str in gmatch (pagecontent, re) do str = trim(str) if find(str, '^Amendment request') or find(str, '^Clarification request') then table.insert(result, '[[' .. page .. '#' .. str .. '|' .. str .. ']]') count = count + 1 end end return render ( result, count ) end function p.sections( frame ) local case = frame.args[1] or frame.args.case return p._sections( case ) end function p._sections( case ) local page = prefix .. case local talkpage = ptalk .. case local result = {} function add (name) local path = '' if name then path = '/' .. name else name = 'Case' end local title = mw.title.new(page .. path) if (title.exists) then table.insert(result, '[[' .. page .. path .. '|' .. name .. ']]' .. ' (' .. '[[' .. talkpage .. path .. '|' .. 'talk]])' ) end end add() add('Evidence') add('Workshop') add('Proposed decision') return table.concat(result, ' β’ ') end return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Sandbox/Bradv/Case/doc
(
edit
)