FANDOM


local Bar = {}
local SB = require('Module:Sidebar')
local S = require('Module:Sidebar/WP')
local HF = require('Module:HF')
local L = require('Module:List')
local getArgs = require('Module:Arguments').getArgs
local Icon = require('Module:Icon').main
 
local data = mw.loadData( 'Module:HF/data' )
local Episodes = data.Episodes
local MainCharacters = data.MainCharacters
local Cast = data.Cast
local SC = data.StoryCategories
local SN = data.StoryNames
local SG = data.StoryLogos
 
local function makeInvokeFunc(funcName)
	return function (frame)
		local args = getArgs(frame)
		return Bar[funcName](args)
	end
end
 
-- Implements {{GuestStars}} (deprecated in favor of [[Template:Episode/GuestStars]])
Bar.gueststars = makeInvokeFunc('_gueststars')
-- Implements {{Production}}
Bar.production = makeInvokeFunc('_production')
-- Implements {{Editing}}
Bar.editing = makeInvokeFunc('_editing')
-- Implements {{Sidebar/Story}}
Bar.Story = makeInvokeFunc('_Story')
 
function Bar._gueststars( args )
	local SBargs = { 
	  list1title = "Special Guest Stars", list2title = "Supporting Cast",
	  list3title = "Featured Cast", list4title = "Guest Cast",
	  navbar = "none", title = "Guest Stars", style = "width: 250px;" }
	if not HF.isempty( args['special'] ) then 
	  SBargs.list1 = L.makeList('unbulleted', HF.explode( ";", args['special'] ) ) end
	if not HF.isempty( args['supporting'] ) then
	  SBargs.list2 = L.makeList('unbulleted', HF.explode( ";", args['supporting'] ) ) end
	if not HF.isempty( args['featured'] ) then 
	  SBargs.list3 = L.makeList('unbulleted', HF.explode( ";", args['featured'] ) )end
	if not HF.isempty( args['guests'] ) then
	  SBargs.list4 = L.makeList('unbulleted', HF.explode( ";", args['guests'] ) ) end
	if not HF.isempty( args[1] ) then 
	  SBargs.list4 = SBargs.list4 .. L.makeList('unbulleted', HF.explode( ";", args[1] ) ) end
	return SB.collapsible( SBargs ) 
end
 
-- implements {{Production}}
function Bar._production( args )
	local SBargs = { 
	  title = '[[American Horror Story]]', style = 'width: 250px;', navbar = 'none',
	  list1title = 'Topics', list1name = 'topics', list2name = 'production',
	  list2title = '[[American Horror Story/Production|Production]]', 
	  expanded = 'topics production', class = 'hlist hwrap infobox navbox'
	  }
	local topics = "[[American Horror Story/Cultural references|Cultural references]];[[American Horror Story/Soundtrack|Soundtrack]];[[American Horror Story/Timeline|Timeline]];[[American Horror Story/Tropes|Tropes]];[[American Horror Story/Connections|Connections]];[[American Horror Story Wiki:ParentPage|Parents' Guide]]"
	local production = HF.explode( ';', '[[American Horror Story/Clothing|Clothing]];[[:Category:Opening credits and title sequence|Titles]];[[:Category:Making Of (videos)|Making Of]];[[wikipedia:Ryan Murphy (writer)|Ryan Murphy]];[[:Category:Murder House (story)/Production|Murder House]];[[:Category:Asylum (story)/Production|Asylum]];[[:Category:Coven (story)/Production|Coven]];[[:Category:Freak Show (story)/Production|Freak Show]];[[:Category:Hotel (story)/Production|Hotel]];[[:Category:Roanoke (story)/Production|Roanoke]];[[:Category:Cult (story)/Production|Cult]]')
	table.insert(production, Icon{ common = 'wikipedia', size = '15px', link='wikipedia:American Horror Story'})
	table.insert(production, Icon{ common = 'imdb', size = '15px', link='imdb:tt1844624'})
	table.insert(production, Icon{ common = 'facebook', size = '15px', link='https://www.facebook.com/americanhorrorstory'})
	table.insert(production, Icon{ common = 'youtube', size = '15px', link='https://www.youtube.com/user/americanhorrorstory'})
	local footer = { 
	    Icon{ story = 'Murder House' },
	    Icon{ story = 'Asylum' },
	    Icon{ story = 'Coven' },
	    Icon{ story = 'Freak Show' },
	    Icon{ story = 'Hotel' },
	    Icon{ story = 'Roanoke' },
	    Icon{ story = 'Cult' },
	    Icon{ common = 'characters',
	        link=HF.LinkToCategory('Characters') },
	    Icon{ common = 'episodes',
	        link=[[:Category:Episodes]] },
	    Icon{ common = 'cast',
	        link=[[:Category:Cast]] }
	}
	SBargs.list1 = L.makeList('horizontal', HF.explode( ';', topics ) )
	SBargs.list2 = L.makeList('horizontal', production )
	SBargs.below = L.makeList('horizontal', footer )
	return SB.collapsible( SBargs ) 
end
 
-- implements {{Editing}}
function Bar._editing( args )
	local SBargs = { 
	  title = 'American Horror Story Wiki', style = 'width: 250px;', navbar = 'none',
	  list1title = '[[AHS:About|Policies]]',
	  list2title = '[[AHS:Manual of Style|Guidelines]]',
	  list3title = '[[AHS:How to help|How to Help]]', 
	  image = '[[File:LogoIcon.png|50px|American Horror Story Wiki Logo|link=]]',
	  class = 'hlist hwrap infobox navbox'
	}
	local policies = '[[AHS:About|Content]];[[AHS:Infraction|Infraction]];[[AHS:Administrators|Admins]];[[AHS:Alderman|Alderpersons]]'
	local guidelines = '[[AHS:Manual of Style|Manual of Style]];[[AHS:Character Pages|Characters]];[[AHS:Episode Pages|Episodes]];[[AHS:Media Files|Media]];[[AHS:Citation|Citation]]'
	local hth = '[[AHS:Community Portal|Community Portal]];[[AHS:Templates|Templates]];[[AHS:Feature Goals|Feature Goals]];[[AHS:American English clarifications|American English usage]];[[AHS:Tao of AHS Wiki|Philosophy]]'
	SBargs.list1 = L.makeList('horizontal', HF.explode( ';', policies ) )
	SBargs.list2 = L.makeList('horizontal', HF.explode( ';', guidelines ) )
	SBargs.list3 = L.makeList('horizontal', HF.explode( ';', hth ) )
	return SB.collapsible( SBargs ) 
end
 
function Bar._Story( args )
    _SN = SN[args[1]]
    _SC = SC[_SN]
    _SG = SG[_SN] or 'File:LogoIcon.png'
    local SBargs = {
        name = 'Template:Sidebar/'.._SN ,
        navbar = 'none',
        pretitle = '[[American Horror Story]]:',
        title = '[[:'.._SC..'|'.._SN..']]',
        class = 'hlist hwrap navbox',
        width = '270px',
        pretitleclass = 'pi-title',
        titleclass = 'pi-title',
        aboveclass = 'pi-secondary-background',
        headingclass = 'pi-secondary-background',
        listtitleclass = 'pi-secondary-background',
        belowclass = 'pi-navigation',
        showtext = '+',
        hidetext = '-',
        image = '[['.._SG..'|200px|AHS: '.._SN..' on American Horror Story Wiki]]',
        heading1 = 'Navigation',
        list1title = '[[:'.._SC..'/Episodes|Episodes]]',
        list1 = L.makeList( 'horizontal' , HF.explode( ';', Episodes[_SN] ) ),
        list2title = '[[:'.._SC..'/Characters|Characters]]',
        list2 = L.makeList( 'horizontal' , HF.explode( ';', MainCharacters[_SN] ) ),
        list3title = '[[:'.._SC..'/Cast|Cast]]',
        list3 = L.makeList( 'horizontal' , HF.explode( ';', Cast[_SN] ) ),
        list4title = '[[:'.._SC..'/Locations|Locations]]',
        list4 = L.makeList( 'horizontal' ,HF.explode( ';', args[2] or ';' ) ),
        heading5 = '[[:'.._SC..'/Production|Production]]',
        content5 = L.makeList( 'horizontal' ,
            {
                '[[:'.._SC..'/Teasers|Teasers]]',
                '[[:'.._SC..'/Media|Media]]',
                '[['.._SN..' (story)/Timeline|Timeline]]',
                '[[Topic:'.._SN..' (story)|Discussions]]'
            })
    }
    return S.collapsible( SBargs )
end
 
return Bar

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.