FANDOM


--[==[ Infobox definition table database for HPW
       by Mfaizsyahmi, 2017
 
    for each table:
        theme: the theme to apply
        tags: a table tree. each table item defines one infobox markup tag:
            type: data/title/image/group
            source: name of argument whose value is to be the data value
            label: the label
            format: function with the arguments passed, returning the text to display
            default: default value (text only)
 
            group tags have the following:
                header: (group only) text or funtion returning text
                tags: more child tags
 
            image tags have the following:
                caption: the caption
                    source
--]==]
 
local p = {}
p.unterganger = {
    theme = 'HPW',
    tags = {
        {
            type = 'title',
            source = 'title',
            default = function(args) 
                return args.channel or args.channelName or args.PAGENAME
            end
        }, {
            type = 'data',
            format = function(args)
                local status = {
                    ["active"] = 'Active',
                    ["dormant"] = 'dormant'
                }
                for _, v in pairs(status) do
                    if args[v]~=nil then return status[v] end
                end
            end
        }, {
            type = 'data',
            format = function(args)
                if args.collab then 
                    return "''This is a collaboration channel.''"
                end
            end
        }, {
            type = 'image',
            source = 'image',
            caption = { source= 'caption' },
        }, {
            type = 'group',
            header = function(args) 
                if args.hidea==nil then 
                    return 'Personal Information'
                end
            end,
            tags = {
                {
                    type = 'data',
                    source = 'name',
                    label = 'Name'
                }, {
                    type = 'data',
                    label = 'Gender',
                    format = function(args)
                        local gender = {
                            ['m'] = 'Male',
                            ['male'] = 'Male',
                            ['f'] = 'Female',
                            ['female'] = 'Female',
                            ['u'] = 'Unspecified / Other '
                        }
                        local g = args.gender or 'u'
                        return gender[g]
                    end
                }, {
                    type = 'data',
                    source = 'born',
                    label = 'Born'
                }, {
                    source = 'nationality',
                    label = 'Nationality',
                }, {
                    source = 'country',
                    label = 'Country',
                }, {
                    source = 'occupation',
                    label = 'Occupation',
                }
            }
        }, {
            type = 'group',
            header = function(args) 
                if args.hideb==nil then 
                    return 'Unterganging Information'
                end
            end,
            tags = {
                {
                    source = 'gen',
                    label = 'Generation',
                    format = function(args) 
                        local label = '<span class="label label-info">'..args.gen..'</span> '
                        local genMap = {
                            ['0'] = '[[First Untergangers]]',
                            ['1'] = '[[First-generation Untergangers]]',
                            ['2'] = '[[Second-generation Untergangers]]',
                            ['3'] = '[[Third-generation Untergangers]]',
                            ['4'] = '[[Fourth-generation Untergangers]]',
                            ['5'] = '[[Fifth-generation Untergangers]]'
                        }
                        return label .. genMap[args.gen]
                    end
                }, {
                    source = 'debut',
                    label = 'Debuted'
                }, {
                    source = 'last',
                    label = 'Last activity'
                }, {
                    source = 'known',
                    label = 'Known for'
                }, {
                    source = 'Style',
                    label = '[[Unterganging Styles|Style(s)]]'
                }, {
                    source = 'influence',
                    label = 'Influence(s)'
                }, {
                    source = 'collabmembers',
                    label = 'Members'
                }, {
                    source = 'language',
                    label = 'Language of parodies'
                }, {
                    source = 'genre',
                    label = 'Parody genres'
                }, {
                    source = 'other names',
                    label = 'Other names'
                }, {
                    label = 'YouTube Channel',
                    format = function(args) 
                        if args.suicide or args.terminated or args["no yt"] then return end
                        --WIP spaghetti code here
                    end
                }, {
                    label = 'Statistics',
                    format = function(args)
                        if args.suicide or args.terminated or args["no yt"] then return end
                        --WIP
                    end
                }, {
                    source = 'wikia name',
                    label = 'Fandom',
                    format = [=[
                        [[User:%s|%s]] [&nbsp;[[User talk:%s|talk]]&nbsp;-&nbsp;[[User blog:%s|blogs]]&nbsp;-&nbsp;[[Special:Contributions/%s|contribs]]&nbsp;]
                    ]=]
                }
            }
        }, {
            type = 'group',
            header = 'Awards',
            tags = {
                {
                    source = 'uotm',
                    format = [=[
<div class="award award-uotm">
;[[File:UotM medal.png|20px|link=Unterganger of the Month]] [[Unterganger of the Month]]
:%s
</div>]=]
                }, {
                    source = 'uoty',
                    format = [=[
<div class="award award-uoty">
;[[File:UotY medal.png|20px|link=Unterganger of the Year]] [[Unterganger of the Year]]
:%s
</div>]=]
                }, {
                    source = 'potm month',
                    format = function(args)
                        return mw.ustring.format([=[
<div class="award award-potm">
;[[File:UotY medal.png|20px|link=Parody of The Month]] [[Parody of The Month]]
:%s
</div>]=], args['potm month'])
                    end,
                }
            }
        }
    }, extra = function(args) 
        if args["no categ"] then return end
 
        local s = {}
        table.insert(s, '[[Category:Untergangers]]')
        if args.gender == 'f' or args.gender == 'female' then 
            table.insert(s, '[[Category:Untergangerins]]') end
        local genMap = {
            ['0'] = '[[Category:First Untergangers]]',
            ['1'] = '[[Category:First-generation Untergangers]]',
            ['2'] = '[[Category:Second-generation Untergangers]]',
            ['3'] = '[[Category:Third-generation Untergangers]]',
            ['4'] = '[[Category:Fourth-generation Untergangers]]',
            ['5'] = '[[Category:Fifth-generation Untergangers]]'
        }
        table.insert(s, genMap(args.gen) or nil)
        local argMap = { --add if key exists
            ['active'] = '[[Category:Active Untergangers]]',
            ['hiatus'] = '[[Category:Untergangers-in-Hiatus]]',
            ['dormant'] = '[[Category:Dormant Untergangers]]',
            ['retired'] = '[[Category:Retired Untergangers]]',
            ['suicide'] = '[[Category:Retired Untergangers]]',
            ['terminated'] = '[[Category:Terminated Untergangers]]',
            ['collab'] = '[[Category:Collaboration Channels]]',
            ['uotm'] = '[[Category:Unterganger of the Month Recipients]]',
            ['potm month'] = '[[Category:Parody of the Month Recipients]]',
            ['uoty'] = '[[Category:Unterganger of the Year]]',
            ['poty year'] = '[[Category:Parody of the Year Recipients]]',
            ['unterganger awards'] = '[[Category:Unterganger Awards Recipients]]',
            ['best new'] = '[[Category:Best New or Unknown Unterganger Award Recipients]]',
            ['bua'] = '[[Category:Best Unterganger Award Recipients]]',
            ['hall of fame'] = '[[Category:Unterganger Hall of Fame Inductees]]',
            ['ulaa'] = '[[Category:Unterganger Lifetime Achievement Award Recipients]]'
        }
        for k, v in pairs(argMap) do
            if args[k] ~= nil then 
                table.insert(s,v)
            end
        end
        return table.concat(s, ' ')
    end
}
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.