Line 64: |
Line 64: |
| _sandbox_notice = [=[<div style="width:90%; border:2px solid #aa5; background:#ffc; text-align:center; margin:15px auto 20px; padding:5px;">This is a testing ship page, it does not correspond to an actual ship.</div> | | _sandbox_notice = [=[<div style="width:90%; border:2px solid #aa5; background:#ffc; text-align:center; margin:15px auto 20px; padding:5px;">This is a testing ship page, it does not correspond to an actual ship.</div> |
| ]=], | | ]=], |
| + | |
| + | _gallery_tabber = [[{{#tag:tabber| |
| + | {{!}}-{{!}}Normal={{ShipGraphicKai|${name}/${suffix}|link=nil|size=300px}} |
| + | {{!}}-{{!}}Damaged={{ShipGraphicKai|${name}/${suffix}|link=nil|damaged=true|size=300px}} |
| + | }}]], |
| | | |
| } | | } |
Line 151: |
Line 156: |
| return class or "Unknown Class" | | return class or "Unknown Class" |
| end | | end |
| + | end |
| + | |
| + | -- [[Category:Todo]]: |
| + | -- Ignore forms with same base and/or damaged CG (requires updating for data modules) |
| + | -- Seasonal forms |
| + | function ShipPage.GalleryTabber(frame, args) |
| + | args = args or Utils.getTemplateArgs(frame) |
| + | local ship_name = args.explicit.ship or args.implicit.pagename or "" |
| + | local forms = ship_remodel_forms(ship_name) |
| + | local result = { "<tabber>" } |
| + | for _, form in ipairs(forms) do |
| + | local name, suffix = Ship:process_ship_key(form) |
| + | table.insert(result, suffix == "" and "|-|Base=" or ("|-|" .. suffix .. "=")) |
| + | table.insert(result, format{ ShipPage._gallery_tabber, name = name, suffix = suffix }) |
| + | end |
| + | table.insert(result, "</tabber>") |
| + | return table.concat(result, "\n") |
| + | end |
| + | |
| + | function ShipPage.FooterSections(frame, args) |
| + | local links = ShipPage.FooterLinks(frame, args) |
| + | local gallery = ShipPage.GalleryTabber(frame, args) |
| + | return "==CG==\n" .. gallery .. "\n==See Also==\n" .. links |
| end | | end |
| | | |