Content deleted Content added
Add new systemFormat option, and change default to make documentation for Template:Video game reviews. |
Update for "update link style" and "don't show system if only one review" |
||
Line 14:
local systemId = nil;
local systemFormat = "colon";
local updateLinkStyle = nil;
-- Translation table for converting numeric-IDs to shorthand aliases.
Line 278 ⟶ 279:
if(iSf ~= nil and iSf ~= "") then
systemFormat = string.lower(iSf);
end;
end;
function p.setUpdateLinkStyle(iStyle)
if(iStyle ~= nil and iStyle ~= "") then
updateLinkStyle = string.lower(iStyle);
end;
end;
Line 332 ⟶ 339:
end;
function p.getUpdateLink(
if(
return "[[File:Blue pencil.svg|frameless|text-top|10px|alt=Edit this on Wikidata|link=https://www.wikidata.org/wiki/"..entity['id'].."?uselang="..mw.language.getContentLanguage().code.."#P444|Edit this on Wikidata]]";
elseif(updateLinkStyle == "noSub") then
return '[[d:'..entity['id']..'#P444|[±]]]';
end;
Line 418 ⟶ 427:
end;
end;
end;
-- Sort the array by platform label.
table.sort(reviewsToPrint, sortByPlatform);
-- If a system was not specified, showSystem has defaulted to true. If this title only has one platform and one review, we will turn it off.
-- Note: If the title has zero or more platforms defined, we leave showSystem on. We are unable to determine if this is a single-platform game.
--if((system == nil or system == "") and #reviewsToPrint == 1 and entity['claims']['P400'] ~= nil and #entity['claims']['P400'] == 1) then
-- Simplifying this based on discussion at [Template:Video game reviews]. If there's only one review, don't display system unless explicitly requested.
if((system == nil or system == "") and #reviewsToPrint == 1) then
showSystem = false;
end;
-- Print the reviews
|