Module:Harvc: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 15:
function is_set( var )
return not (var == nil or var == '');
end
 
 
-- if all items in list are set, return true, else false
function are_all_set(...)
local list = {...};
for _, var in pairs(list) do
if not is_set( var ) then
return false;
end
end
return true;
end
 
Line 61 ⟶ 49:
end
 
-- if is_set (args.last4) and is_set (args.last3) and is_set (args.last2) and is_set (args.last1) then
if are_all_set ({args.last4, args.last3, args.last2, args.last1}) then
contributors = args.last1 .. args.first .. ' et al.';
elseif not is_set (args.last4) and is_set (args.last3) and is_set (args.last2) and is_set (args.last1) then
contributors = args.last1 .. args.first .. ', ' .. args.last2 .. ' & ' .. args.last3;
elseif not is_set (args.last4) and not is_set (args.last3) and is_set (args.last2) and is_set (args.last1) then
contributors = args.last1 .. args.first .. ' & ' .. args.last2;
elseif not is_set (args.last4) and not is_set (args.last3) and not is_set (args.last2) and is_set (args.last1) then
contributors = args.last1 .. args.first;
else