69,780
edits
Tag: Undo |
m (Protected "Module:Game": High traffic page ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))) |
||
(24 intermediate revisions by 2 users not shown) | |||
Line 22: | Line 22: | ||
local function renderCompletion() | local function renderCompletion() | ||
if args.completion then | args.completion = args.completion or "0" | ||
if args.completion == "5" then | |||
link = "[[:Category:Guides at completion stage 5|Featured]]" | |||
else | |||
link = "[[:Category:Guides at completion stage " .. args.completion .. "|Stage " .. args.completion .. "]]" | |||
end | end | ||
newRoot:wikitext(mw.getCurrentFrame():extensionTag( | |||
'indicator', | |||
"[[File:000" .. args.completion | |||
.. ".svg|32px|This guide is at completion stage " .. args.completion | |||
.. ". Click here for more information.|link=:Category:Guides at completion stage " | |||
.. args.completion .. "]] " .. link, | |||
{ name = 'cs' } ) ) | |||
end | end | ||
Line 39: | Line 43: | ||
local seriesCat = mw.title.new( args.seriesDisambig, 14 ) | local seriesCat = mw.title.new( args.seriesDisambig, 14 ) | ||
newRoot | newRoot | ||
:wikitext("''This is the first game in the '''" .. seriesCat.text .. "''' series. For other games in the series see the [[:" .. seriesCat.prefixedText .. "|" .. seriesCat.text .. " category]].''" ) | :wikitext("<p class='noexcerpt'>''This is the first game in the '''" .. seriesCat.text .. "''' series. For other games in the series see the [[:" .. seriesCat.prefixedText .. "|" .. seriesCat.text .. " category]].''</p>" ) | ||
end | end | ||
end | end | ||
Line 96: | Line 100: | ||
local function renderRows() | local function renderRows() | ||
if args.japanese then addRow( {label = 'Japanese title', data = args.japanese} ) end | if args.japanese then addRow( {label = 'Japanese title', data = args.japanese} ) end | ||
if args.designer then addRow( {label = 'Designer(s)', data = args.designer} ) end | if args.designer then addRow( {label = 'Designer(s)', data = args.designer} ) end | ||
addRow( { label = 'Genre(s)', data = args.genre, rowclass = 'mw-row-no-collapse' } ) | addRow( { label = 'Genre(s)', data = args.genre, rowclass = 'mw-row-no-collapse' } ) | ||
if args.players then addRow( {label = 'Players', data = args.players} ) end | if args.players then addRow( {label = 'Players', data = args.players} ) end | ||
Line 112: | Line 112: | ||
addRow( { label = 'Developer(s)', data = args.developer } ) | addRow( { label = 'Developer(s)', data = args.developer } ) | ||
addRow( { label = 'Publisher(s)', data = args.publisher } ) | addRow( { label = 'Publisher(s)', data = args.publisher } ) | ||
if args.year then | if args.year then dataYear = '[[:Category:' .. args.year .. '|' .. args.year .. ']]' else dataYear = "" end | ||
addRow( { label = 'Year released', data = dataYear } ) | |||
addRow( { label = 'System(s)', data = args.systems, rowclass = 'mw-row-no-collapse' } ) | addRow( { label = 'System(s)', data = args.systems, rowclass = 'mw-row-no-collapse' } ) | ||
if args.expansion then addRow( { label = 'Expansion pack(s)', labelstyle = 'white-space: nowrap;', data = args.expansion } ) end | if args.expansion then addRow( { label = 'Expansion pack(s)', labelstyle = 'white-space: nowrap;', data = args.expansion } ) end | ||
Line 150: | Line 149: | ||
local function renderSocialRows() | local function renderSocialRows() | ||
local | local linksData = '' | ||
local pagename = mw.uri.encode( mw.title.getCurrentTitle().text, "PATH" ) | local pagename = mw.uri.encode( mw.title.getCurrentTitle().text, "PATH" ) | ||
linksData = linksData .. mw.getCurrentFrame():preprocess( '{{switcherlink}}' ) | |||
if args.website then | if args.website then | ||
linksData = linksData .. '<span class="img-ib-inline">[[File:Link icon.svg|x20px|link=' .. args.website .. '|' .. 'Official website]]</span>' | |||
end | end | ||
if args.pcgamingwiki then | if args.pcgamingwiki then | ||
linksData = linksData .. '<span class="img-ib-inline">[[File:PCGamingWikiLink.svg|x20px|link=pcgamingwiki:' .. args.pcgamingwiki .. '|' .. mw.title.getCurrentTitle().text .. ' at PCGamingWiki]]</span>' | |||
end | end | ||
if args.twitch then | if args.twitch then | ||
linksData = linksData .. '<span class="img-ib-inline">[[File:Twitch icon.png|x20px|link=https://www.twitch.tv/directory/game/' .. mw.uri.encode( args.twitch, "PATH" ) .. '|' .. args.twitch .. ' Channel]]</span>' | |||
else | else | ||
linksData = linksData .. '<span class="img-ib-inline img-greyscale">[[File:Twitch icon.png|x20px|link=https://www.twitch.tv/directory/game/' .. pagename .. '|' .. mw.title.getCurrentTitle().text .. ' Channel]]</span>' | |||
end | end | ||
if args.twitter then | if args.twitter then | ||
linksData = linksData .. '<span class="img-ib-inline">[[File:Twitter icon.png|x20px|link=https://twitter.com/' .. args.twitter .. '|' .. args.twitter .. ']]</span>' | |||
else | else | ||
linksData = linksData .. '<span class="img-ib-inline img-greyscale">[[File:Twitter icon.png|x20px|link=https://twitter.com/search?f=user&q=' .. pagename .. '|Search]]</span>' | |||
end | end | ||
if args.facebook then | if args.facebook then | ||
linksData = linksData .. '<span class="img-ib-inline">[[File:Facebook icon.png|x20px|link=https://www.facebook.com/' .. args.facebook .. '|' .. args.facebook .. ']]</span>' | |||
else | else | ||
linksData = linksData .. '<span class="img-ib-inline img-greyscale">[[File:Facebook icon.png|x20px|link=https://www.facebook.com/search/pages/?q=' .. pagename .. '|Search]]</span>' | |||
end | end | ||
addRow( { label = 'Links', data = | addRow( { label = 'Links', data = linksData } ) | ||
end | end | ||
Line 202: | Line 200: | ||
end | end | ||
if not args.developer or not args.publisher or not args.genre or not args.systems or | if not args.developer or not args.publisher or not args.genre or not args.systems or not args.year then | ||
root:wikitext( '[[Category:Pages needing an infobox]]' ) | root:wikitext( '[[Category:Pages needing an infobox]]' ) | ||
end | end | ||
Line 217: | Line 215: | ||
if args.series4 then | if args.series4 then | ||
root:wikitext( '[[Category:' .. args.series4 .. ']]' ) | root:wikitext( '[[Category:' .. args.series4 .. ']]' ) | ||
end | end | ||
end | end | ||
Line 259: | Line 253: | ||
:addClass( 'mw-collapsible' ) | :addClass( 'mw-collapsible' ) | ||
:addClass( 'mw-collapsed' ) | :addClass( 'mw-collapsed' ) | ||
renderRelease( num ) | renderRelease( num ) | ||
Line 270: | Line 263: | ||
:addClass( 'infobox' ) | :addClass( 'infobox' ) | ||
:addClass( 'bordered' ) | :addClass( 'bordered' ) | ||
: | :addClass( 'noprint' ) | ||
:css( 'clear', 'right' ) | :css( 'clear', 'right' ) | ||
root | root | ||
:wikitext( mw.getCurrentFrame():preprocess( '<NeoLink />' ) ) | :wikitext( mw.getCurrentFrame():preprocess( '<NeoLink />' ) ) | ||
renderSocialRows() | renderSocialRows() | ||
Line 282: | Line 274: | ||
newRoot:node( root ) | newRoot:node( root ) | ||
return tostring( newRoot ) .. '<div style="clear: left;"></div>' | return tostring( newRoot ) .. mw.getCurrentFrame():expandTemplate{ title = 'WikiList', args = { 'games', args.title } } .. '<div style="clear: left;"></div>' | ||
end | end | ||