Module:Clan: Difference between revisions
From PC Gaming Shelter
No edit summary |
No edit summary |
||
| Line 45: | Line 45: | ||
end | end | ||
html:tag('div | html:tag('div'):wikitext(string.format('[[%s]]', community)) | ||
html:tag('div'):wikitext(string.format('%s %s', roles, note)) | html:tag('div'):wikitext(string.format('<span class="text-secondary small">%s</span> %s', roles, note)) | ||
end | end | ||
Latest revision as of 18:24, 25 March 2026
Documentation for this module may be created at Module:Clan/doc
local utils = require( 'Module:Utils' )
local p = {}
local function propertiesPlan()
-- ['Form field name'] = { 'Semantic property', 'delimiter' }
local propMap = {
['Member of'] = {'Member of' },
['Has role'] = {'Has role', ',' },
['Has note'] = {'Has note' }
}
return propMap
end
function p.main(frame)
local args = frame:getParent().args
local propMap = propertiesPlan()
local props = utils.setProperties(propMap, args) or {}
mw.smw.subobject(props)
local community = args['Member of'] or nil
local html = mw.html.create()
if community then
local escalateLink = {
['Member of'] = args['Member of']
}
mw.smw.set(escalateLink)
local roles = args['Has role'] or nil
if roles then
roles = string.format(' (%s)', roles )
else
roles = ''
end
local note = args['Has note'] or nil
if note then
note = frame:callParserFunction(
'#info', note
)
else
note = ''
end
html:tag('div'):wikitext(string.format('[[%s]]', community))
html:tag('div'):wikitext(string.format('<span class="text-secondary small">%s</span> %s', roles, note))
end
return html
end
return p
