Module:Sidebar/AHSW

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 (deprecated in favor of Template:Episode/GuestStars) Bar.gueststars = makeInvokeFunc('_gueststars') -- Implements Bar.production = makeInvokeFunc('_production') -- Implements Bar.editing = makeInvokeFunc('_editing') -- Implements 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 function Bar._production( args ) local SBargs = { title = 'American Horror Story', style = 'width: 250px;', navbar = 'none', list1title = 'Topics', list1name = 'topics', list2name = 'production', list2title = 'Production', expanded = 'topics production', class = 'hlist hwrap infobox navbox' }	local topics = "Cultural references;Soundtrack;Timeline;Tropes;Connections;Parents' Guide" local production = HF.explode( ';', 'Clothing;Titles;Making Of;Ryan Murphy;Murder House;Asylum;Coven;Freak Show;Hotel') 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{ common = 'characters', link=Category: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 function Bar._editing( args ) local SBargs = { title = 'American Horror Story Wiki', style = 'width: 250px;', navbar = 'none', list1title = 'Policies', list2title = 'Guidelines', list3title = 'How to Help', image = '', class = 'hlist hwrap infobox navbox' }	local policies = 'Content;Infraction;Admins;Alderpersons' local guidelines = 'Manual of Style;Characters;Episodes;Media;Citation' local hth = 'Community Portal;Templates;Feature Goals;American English usage;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 = .._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 = '200px|AHS: '.._SN..' on American Horror Story Wiki', heading1 = 'Navigation', list1title = 'Episodes', list1 = L.makeList( 'horizontal', HF.explode( ';', Episodes[_SN] ) ), list2title = 'Characters', list2 = L.makeList( 'horizontal', HF.explode( ';', MainCharacters[_SN] ) ), list3title = 'Cast', list3 = L.makeList( 'horizontal', HF.explode( ';', Cast[_SN] ) ), list4title = 'Locations', list4 = L.makeList( 'horizontal' ,HF.explode( ';', args[2] ) ), heading5 = 'Production', content5 = L.makeList( 'horizontal',           {                'Teasers',                'Media',                'Timeline',                'Discussions'            }) }   return S.collapsible( SBargs ) end

return Bar