Content added Content deleted
mNo edit summary |
mNo edit summary |
||
Line 11: | Line 11: | ||
local location = args[1] |
local location = args[1] |
||
local hasAreaItems = false |
|||
for _, val in ipairs(args) do |
|||
if val == 'area items' then |
|||
hasAreaItems = true |
|||
end |
|||
end |
|||
if location == nil or location == '' then |
if location == nil or location == '' then |
||
Line 18: | Line 26: | ||
builder |
builder |
||
:addTab(location, "Overview") |
:addTab(location, "Overview") |
||
⚫ | |||
:addTab(location .. "/Area Conversations", "Area Convos") |
:addTab(location .. "/Area Conversations", "Area Convos") |
||
if hasAreaItems then |
|||
⚫ | |||
end |
|||
return builder:tostring() |
return builder:tostring() |
Latest revision as of 09:16, 16 December 2023
Documentation for this module may be created at Module:Location tabs/doc
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local TabsBuilder = require('Module:TabsBuilder')
local p = {}
function p.main(frame)
local args = getArgs(frame)
local builder = TabsBuilder.new()
local location = args[1]
local hasAreaItems = false
for _, val in ipairs(args) do
if val == 'area items' then
hasAreaItems = true
end
end
if location == nil or location == '' then
error('Location must be set.')
end
builder
:addTab(location, "Overview")
:addTab(location .. "/Area Conversations", "Area Convos")
if hasAreaItems then
builder:addTab(location .. "/Area Items", "Area Items")
end
return builder:tostring()
end
return p