Deltarune Wiki
m (Update broken image link)
mNo edit summary
Line 34: Line 34:
 
table.insert(str, ' ')
 
table.insert(str, ' ')
 
if groupdata.icon then
 
if groupdata.icon then
table.insert(str, 'https://raw.githubusercontent.com/Wikia/design-system/master/dist/svg/wds-avatar-badges-')
+
table.insert(str, 'File:wds-avatar-badge-')
 
table.insert(str, groupdata.icon)
 
table.insert(str, groupdata.icon)
table.insert(str, '.svg#.png')
+
table.insert(str, '.svg')
 
else
 
else
 
table.insert(str, '*')
 
table.insert(str, '*')

Revision as of 12:25, 30 May 2019

Lua error in Dev:Docbunto at line 944: documentation markup for Docbunto not found in Module:Staff.


-- <nowiki>
local p = {}

local title = mw.title.getCurrentTitle()
local data = mw.loadData('Module:Staff/data')

function p.main()
    if title.namespace ~= 2 then
        return
    end
    local group = data.users[title.text]
    if not group then
        return
    end
    local groupdata = data.appearance[group]
    local str = {}
    table.insert(str, '<span title="This user is ')
    local first = mw.ustring.lower(mw.ustring.sub(groupdata.name, 0, 1))
    if first == 'a' or first == 'e' or first == 'i' or first == 'o' or first == 'u' then
        table.insert(str, 'an')
    else
        table.insert(str, 'a')
    end
    table.insert(str, ' ')
    table.insert(str, groupdata.name)
    table.insert(str, ' of the ')
    table.insert(str, mw.site.siteName)
    table.insert(str, '." class="plainlinks staff')
    if not groupdata.icon then
        table.insert(str, ' noicon')
    end
    table.insert(str, '">[')
    table.insert(str, tostring(mw.uri.fullUrl('Category:' .. groupdata.category)))
    table.insert(str, ' ')
    if groupdata.icon then
        table.insert(str, 'File:wds-avatar-badge-')
        table.insert(str, groupdata.icon)
        table.insert(str, '.svg')
    else
        table.insert(str, '*')
    end
    table.insert(str, ']</span>[[Category:')
    table.insert(str, groupdata.category)
    table.insert(str, ']]')
    return table.concat(str)
end

return p