Content deleted Content added
. |
. |
||
(14 intermediate revisions by the same user not shown) | |||
Line 5:
local gmatch = mw.ustring.gmatch
local trim = mw.text.trim
--[[function p.list()▼
name = '#categorytree', ▼
}▼
end▼
local prefix = 'Wikipedia:Arbitration/Requests/Case/'
local
function render ( tbl, count )
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 )
Line 31 ⟶ 35:
table.insert(result, trim(str))
end
return
end
Line 41 ⟶ 45:
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
end▼
▲ if find(str, '^=') then
s = trim(sub(str, 2))▼
table.insert(result, ':[[' .. page .. '#' .. s .. '|' .. s .. ']]')▼
else
if find(str, '^=') then
table.insert(result, "'''" .. str .. "'''")▼
▲ s = trim(sub(str, 2))
▲ table.insert(result, ':[[' .. page .. '#' .. s .. '|' .. s .. ']]')
else
▲ table.insert(result, "'''" .. str .. "'''")
end
count = count + 1
end
end
▲ local output = table.concat(result, '\n')
return render ( result, count )
▲ return output
end
Line 66 ⟶ 72:
end
function p._arca( case )
local page =
local pagecontent = mw.title.new(page):getContent()
local result = {}
local count = 0
local re = '\n==(.-)=='
for str in gmatch (pagecontent, re) do
Line 74 ⟶ 81:
if find(str, '^Amendment request')
or find(str, '^Clarification request') then
table.insert(result, '
count = count + 1
end
end
return
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 = {}
local path = ''
if name then
path = '/' .. name
else
▲ 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
|