Module:Sandbox/User:Artoire/1: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
mNo edit summary
mNo edit summary
Line 23: Line 23:
assert(persistant.in_table, '{{LocLine}} when not in a location table (Missing {{LocTableHead}}?)')
assert(persistant.in_table, '{{LocLine}} when not in a location table (Missing {{LocTableHead}}?)')
local args = frame.args
local args = frame.args
local loc = args.loc
local qty = args.quantity
local qty = args.quantity
qty = tonumber(qty or '')
qty = tonumber(qty or '')
Line 32: Line 33:
persistant.counter = persistant.counter + 1
persistant.counter = persistant.counter + 1
local id = 'LOC_' .. persistant.counter
local id = 'LOC_' .. persistant.counter

tbl:tag('tr')
:attr{ id = id }
:tag('td'):wikitext(loc_link):done()
:tag('td'):wikitext(parse.episode_func(episode)):done()
:tag('td'):wikitext(qty or edit):done()
:done()


mw.smw.subobject({
mw.smw.subobject({
Line 45: Line 39:
['Location quantity'] = qty or 'Unknown'
['Location quantity'] = qty or 'Unknown'
}, id)
}, id)

return mw.html.create('tr')
:attr{ id = id }
:tag('td'):wikitext(loc_link):done()
:tag('td'):wikitext(parse.episode_func(episode)):done()
:tag('td'):wikitext(qty or edit):done()
:done()
end
end