Module:File license: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
no edit summary
No edit summary
No edit summary
Line 82: Line 82:
licenseMachinedata = '<span class="licensetpl"><span class="licensetpl_short">' .. licenseData[license][4] .. '</span><span class="licensetpl_long">' .. licenseData[license][5] .. '</span><span class="licensetpl_link">' .. frame:preprocess("<nowiki>" .. licenseData[license][6] .. "</nowiki>") .. '</span><span class="licensetpl_link_req">' .. tostring(licenseData[license][7]) .. '</span><span class="licensetpl_attr_req">' .. tostring(licenseData[license][8]) .. '</span><span class="licensetpl_attr">' .. attributionText .. '</span><span class="licensetpl_nonfree">' .. tostring(licenseData[license][9]) .. '</span></span>'
licenseMachinedata = '<span class="licensetpl"><span class="licensetpl_short">' .. licenseData[license][4] .. '</span><span class="licensetpl_long">' .. licenseData[license][5] .. '</span><span class="licensetpl_link">' .. frame:preprocess("<nowiki>" .. licenseData[license][6] .. "</nowiki>") .. '</span><span class="licensetpl_link_req">' .. tostring(licenseData[license][7]) .. '</span><span class="licensetpl_attr_req">' .. tostring(licenseData[license][8]) .. '</span><span class="licensetpl_attr">' .. attributionText .. '</span><span class="licensetpl_nonfree">' .. tostring(licenseData[license][9]) .. '</span></span>'
end
end
local extraLicenses = ""
local done = false
local i = 2
while not done do
if args["license" + tostring(i)] and args["license" + tostring(i)] ~= "" and licenseData[args["license" + tostring(i)]] then
extraLicenses = extraLicenses + licenseData[args["license" + tostring(i)]][5]
licenseMachinedata = licenseMachinedata + '<span class="licensetpl"><span class="licensetpl_short">' .. licenseData[args["license" + tostring(i)]][4] .. '</span><span class="licensetpl_long">' .. licenseData[args["license" + tostring(i)]][5] .. '</span><span class="licensetpl_link">' .. frame:preprocess("<nowiki>" .. licenseData[args["license" + tostring(i)]][6] .. "</nowiki>") .. '</span><span class="licensetpl_link_req">' .. tostring(licenseData[args["license" + tostring(i)]][7]) .. '</span><span class="licensetpl_attr_req">' .. tostring(licenseData[args["license" + tostring(i)]][8]) .. '</span><span class="licensetpl_attr">' .. attributionText .. '</span><span class="licensetpl_nonfree">' .. tostring(licenseData[args["license" + tostring(i)]][9]) .. '</span></span>'
i = i + 1
else
done = true
end
end
if extraLicenses ~= "" then
if ownWork then
extraLicensesText = "<br/>I also make this file available under the following additional license"
if i > 3 then
extraLicensesText = extraLicensesText + "s"
end
extraLicensesText = extraLicensesText + extraLicenses
else
extraLicensesText = "<br/>This file is also available under the following additional license"
if i > 3 then
extraLicensesText = extraLicensesText + "s"
end
extraLicensesText = extraLicensesText + extraLicenses
end
licenseText = licenseText + extraLicensesText
licenseMachinedata = '<span class="licensetpl_wrapper">' + licenseMachinedata + '</span>'
end
local infoMachinedata = '<span class="fileinfotpl"><span class="fileinfotpl_desc">' .. string.sub(typeOfFileArticle, 1, 1):upper() .. string.sub(typeOfFileArticle, 2, -1) .. ' ' .. typeOfFile .. sourceText .. '.</span><span class="fileinfotpl_src">' .. source .. '</span><span class="fileinfotpl_aut">' .. copyrightHolderText .. '</span></span>'
local infoMachinedata = '<span class="fileinfotpl"><span class="fileinfotpl_desc">' .. string.sub(typeOfFileArticle, 1, 1):upper() .. string.sub(typeOfFileArticle, 2, -1) .. ' ' .. typeOfFile .. sourceText .. '.</span><span class="fileinfotpl_src">' .. source .. '</span><span class="fileinfotpl_aut">' .. copyrightHolderText .. '</span></span>'
Line 138: Line 169:
end
end
local finalLicense = '<div id="license">' .. imageCode .. "This file is " .. typeOfFileArticle .. " '''" .. typeOfFile .. "'''" .. sourceText .. ". " .. copyrightOwnedByText .. extraCopyrightText .. endorsementNotice .. "<hr/>" .. licenseText .. trademarkText .. attributionNotice .. '<span style="display:none;>" ' .. licenseMachinedata .. infoMachinedata .. "</span></div>"
local finalLicense = '<div id="license fileinfotpl_perm">' .. imageCode .. "This file is " .. typeOfFileArticle .. " '''" .. typeOfFile .. "'''" .. sourceText .. ". " .. copyrightOwnedByText .. extraCopyrightText .. endorsementNotice .. "<hr/>" .. licenseText .. trademarkText .. attributionNotice .. '<span style="display:none;>" ' .. licenseMachinedata .. infoMachinedata .. "</span></div>"


return finalLicense
return finalLicense
Cookies help us deliver our services. By using our services, you agree to our use of cookies.