Line 6: |
Line 6: |
| local ShipGraphicKai = require('Module:ShipGraphicKai') | | local ShipGraphicKai = require('Module:ShipGraphicKai') |
| local ShipCardKai = require('Module:ShipCardKai') | | local ShipCardKai = require('Module:ShipCardKai') |
− |
| |
− | -- [[Category:Todo]]: support passing Ship object in those modules, use Ship object, redo and move ship_remodel_forms function
| |
| local ShipMetaKai = require("Module:ShipMetaKai") | | local ShipMetaKai = require("Module:ShipMetaKai") |
| local ShipInfoKai = require("Module:ShipInfoKai") | | local ShipInfoKai = require("Module:ShipInfoKai") |
Line 330: |
Line 328: |
| end | | end |
| | | |
− | -- [[Category:Todo]]:
| |
− | -- Ignore forms with same base and/or damaged CG (requires updating for data modules)
| |
− | -- Order/years for seasonal forms?
| |
− | -- Improve performance by not using frame:preprocess?
| |
| function ShipPage.GalleryTabber(frame, args) | | function ShipPage.GalleryTabber(frame, args) |
| args = args or U.getTemplateArgs(frame) | | args = args or U.getTemplateArgs(frame) |
Line 371: |
Line 365: |
| return table.concat(result, "\n") | | return table.concat(result, "\n") |
| end | | end |
− |
| |
− | function ShipPage.TestGallery(ship)
| |
− | return ShipPage.GalleryTabber(nil, {
| |
− | explicit = { ship = ship },
| |
− | implicit = {},
| |
− | })
| |
− | end
| |
− | -- print(p.TestGallery("Taigei"))
| |
− | -- print(p.TestGallery("Ayanami"))
| |
− | -- print(p.TestGallery("Iowa"))
| |
− | -- print(p.TestGallery("Kasuga Maru"))
| |
− | -- print(p.TestGallery("Murakumo"))
| |
| | | |
| function ShipPage.FooterSections(frame, args) | | function ShipPage.FooterSections(frame, args) |
Line 395: |
Line 377: |
| end | | end |
| | | |
− | local ShipIterator = require('Module:ShipIterator')
| + | function ShipPage.TestGallery(ship) |
| + | return ShipPage.Gallery(nil, { |
| + | explicit = { ship = ship }, |
| + | implicit = {}, |
| + | }) |
| + | end |
| + | |
| + | function ShipPage.TestGalleryTabber(ship) |
| + | return ShipPage.GalleryTabber(nil, { |
| + | explicit = { ship = ship }, |
| + | implicit = {}, |
| + | }) |
| + | end |
| | | |
| function ShipPage.TestGalleryAll(frame) | | function ShipPage.TestGalleryAll(frame) |
| + | local ShipIterator = require('Module:ShipIterator') |
| local result = {} | | local result = {} |
| for _, ship in ShipIterator.base() do | | for _, ship in ShipIterator.base() do |
− | table.insert(result, '===[[' .. ship .. '/Gallery|' .. ship .. ']]===') | + | table.insert(result, '=[[' .. ship .. '/Gallery|' .. ship .. ']]=') |
− | table.insert(result, '<div class="ship-page-gallery" data-name="' .. ship .. '">')
| |
| table.insert(result, ShipPage.TestGallery(ship)) | | table.insert(result, ShipPage.TestGallery(ship)) |
− | table.insert(result, '</div>')
| |
| end | | end |
| return frame:preprocess(table.concat(result, '\n')) | | return frame:preprocess(table.concat(result, '\n')) |
| end | | end |
| | | |
− | --[[
| + | function ShipPage.TestGalleryTabberAll(frame) |
− | ShipPage.t1 = ShipPage.Header(nil, {
| + | local ShipIterator = require('Module:ShipIterator') |
− | explicit = { ship = "Ayanami" },
| + | local result = {} |
− | implicit = {}, | + | for _, ship in ShipIterator.base() do |
− | })
| + | table.insert(result, '===[[' .. ship .. '/Gallery|' .. ship .. ']]===') |
− | -- print(p.t1)
| + | table.insert(result, '<div class="ship-page-gallery" data-name="' .. ship .. '">') |
− | | + | table.insert(result, ShipPage.TestGalleryTabber(ship)) |
− | ShipPage.t2 = ShipPage.Header(nil, {
| + | table.insert(result, '</div>') |
− | explicit = { ship = "Hibiki" }, | |
− | implicit = {}, | |
− | })
| |
− | -- print(p.t2)
| |
− | | |
− | ShipPage.t3 = ShipPage.Header(nil, {
| |
− | explicit = { ship = "Zuikaku" },
| |
− | implicit = {},
| |
− | })
| |
− | -- print(p.t3)
| |
− | | |
− | ShipPage.t4 = ShipPage.Header(nil, {
| |
− | explicit = {},
| |
− | implicit = {},
| |
− | })
| |
− | -- print(p.t4)
| |
− | | |
− | ShipPage.t5 = ShipPage.FooterLinks(nil, {
| |
− | explicit = { ship = "Ayanami" },
| |
− | implicit = {},
| |
− | })
| |
− | -- print(p.t5)
| |
− | | |
− | ShipPage.t6 = ShipPage.ClassTemplate(nil, {
| |
− | explicit = { ship = "Matsukaze" },
| |
− | implicit = {},
| |
− | })
| |
− | -- print(p.t6)
| |
− | ]]--
| |
− | --[[
| |
− | function ShipPage.test()
| |
− | function print_forms(ship_name)
| |
− | for _, v in ipairs(ship_remodel_forms(ship_name)) do | |
− | mw.log(v)
| |
− | end
| |
| end | | end |
− | print_forms("Ayanami") | + | return frame:preprocess(table.concat(result, '\n')) |
− | print_forms("Hibiki")
| |
− | print_forms("Zuikaku")
| |
− | print_forms("Matsukaze")
| |
− | print_forms("Bismarck")
| |
− | print_forms("Taigei")
| |
− | print_forms("U-511")
| |
− | print_forms("Kasuga Maru")
| |
− | print_forms("Gangut")
| |
| end | | end |
− | ]]--
| |
| | | |
| return ShipPage | | return ShipPage |