More actions
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 4: | Line 4: | ||
function p.main(frame) | function p.main(frame) | ||
local args = frame:getParent().args | |||
local headerStyle | |||
if args.headerstyle and args.headerstyle ~= '' then | |||
headerStyle = string.format("background-color: %s;", args.headerstyle) | |||
else | |||
headerStyle = "background-color: grey;" | |||
end | |||
local retval = capiunto.create({ | |||
title = args.title, | |||
headerStyle = headerStyle, | |||
captionStyle = "text-align: center;", | |||
imageStyle = "text-align: center;", | |||
}) | |||
retval:addImage("[[File:" .. args.image .. "|300px]]", args.caption_image) | |||
if args.alias then retval:addRow("Aliases", args.alias) end | |||
if args.sex then retval:addRow("Sex", args.sex) end | |||
if args.nationality then retval:addRow("Nation from", args.nationality) end | |||
if args.breed then retval:addRow("Breed", args.breed) end | |||
if args.coat then retval:addRow("Coat", args.coat) end | |||
if args.born then retval:addRow("Born", args.born) end | |||
if args.abandoned then retval:addRow("Abandoned", args.abandoned) end | |||
if args.rescued then retval:addRow("Rescued", args.rescued) end | |||
if args.died then retval:addRow("Died", args.died) end | |||
if args.death_cause then retval:addRow("Cause of death", args.death_cause) end | |||
if args.rest then retval:addRow("Resting place", args.rest) end | |||
if args.occupation then retval:addRow("Occupation", args.occupation) end | |||
if args.mate then retval:addRow("Mate", args.mate) end | |||
if args.weight then retval:addRow("Weight", args.weight) end | |||
if args.height then retval:addRow("Height", args.height) end | |||
if args.owner then retval:addRow("Owner", args.owner) end | |||
if args.known_for then retval:addRow("Known for", args.known_for) end | |||
if args.sound then retval:addRow("Sound", args.sound) end | |||
if args.social_media then retval:addRow("Social media", args.social_media) end | |||
return retval | |||
end | end | ||
return p | return p |