Module:Infobox ET: Difference between revisions

Distinguish set categories from topic categories for edonois
Fredg999 (talk | contribs)
Make zeta properties display opt-in, but always include zeta categories nonetheless
 
Line 91: Line 91:
local zeta_switch
local zeta_switch
if value_provided(zeta_override) then
if value_provided(zeta_override) then
zeta_switch = not zeta_override:match("^[Nn][Oo]$")
zeta_switch = zeta_override:match("^[Yy][Ee][Ss]$") and ET.is_zeta(et)
else
else
zeta_switch = rat.eq(et.equave, 2) and ET.is_zeta(et)
zeta_switch = false
end
end


Line 216: Line 216:


-- special properties
-- special properties
if ET.is_highly_composite(et) or zeta_switch then
if ET.is_highly_composite(et) or ET.is_zeta(et) then
local text = ""
local text = ""
if ET.is_highly_composite(et) then
if ET.is_highly_composite(et) then
Line 227: Line 227:
end
end
end
end
if zeta_switch then
if ET.is_zeta(et) and rat.eq(et.equave, 2) then
if #text > 0 then
categories = categories
text = text .. "<br>"
.. "[[Category:Zeta record EDOs|"
end
.. string.rep("#", string.len(et.size))
if not value_provided(zeta_override) then
.. "]]"
if zeta_switch then
if #text > 0 then
text = text .. "<br>"
end
text = text .. ET.why_zeta(et)
text = text .. ET.why_zeta(et)
else
text = text .. zeta_override
end
if rat.eq(et.equave, 2) then
categories = categories
.. "[[Category:Zeta record EDOs|"
.. string.rep("#", string.len(et.size))
.. "]]"
end
end
end
if #text >0 then
table.insert(infobox_data, {
"Special properties",
"<div style=\"max-width: 300px;\">" .. text .. "</div>",
})
end
end
table.insert(infobox_data, {
"Special properties",
"<div style=\"max-width: 300px;\">" .. text .. "</div>",
})
end
end