Module:VG titles:修订间差异
外观
删除的内容 添加的内容
无编辑摘要 |
小 strict |
||
(未显示3个用户的37个中间版本) | |||
第1行: | 第1行: | ||
require(' |
require('strict') |
||
local getArgs = require('Module:Arguments').getArgs |
local getArgs = require('Module:Arguments').getArgs |
||
local yesno = require('Module:Yesno') |
local yesno = require('Module:Yesno') |
||
第8行: | 第8行: | ||
local function article(args) |
local function article(args) |
||
local core |
|||
⚫ | |||
⚫ | |||
core = string.format('[[%s|%s]]', args.article, args.title or args.article) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
return string.format('<div class="fn" style="margin-bottom: 10pt;">%s</div>', core) |
|||
end |
end |
||
第31行: | 第25行: | ||
if yesno(args.series) then |
if yesno(args.series) then |
||
return (args.date or '') .. (args.refs or '') |
|||
⚫ | |||
⚫ | |||
status, date = args.datetype, args.date |
|||
elseif yesno(args.futuregame) then |
elseif yesno(args.futuregame) then |
||
status, date = '预定发行日期', args.date |
status, date = '预定发行日期', args.date |
||
elseif args.canceled then |
elseif args.canceled then |
||
status, date = '原定发行日期', args. |
if args.date then |
||
status, date = '原定发行日期', args.date |
|||
⚫ | |||
status, date = '取消日期', args.canceled |
|||
⚫ | |||
else |
else |
||
status = ' |
status = '首发日期' |
||
date = args.date or '<span class="error">未填写<code>date =</code>参数</span>' |
date = args.date or '<span class="error">未填写<code>date =</code>参数</span>' |
||
end |
end |
||
⚫ | |||
return string.format('<div><b>%s</b>%s:<br />%s', status, args.refs or '', date) |
return string.format('<div><b>%s</b>%s:<br />%s</div>', status, args.refs or '', date) |
||
end |
end |
||
return string.format(' |
return string.format('\n| scope="row" style="%s" rowspan="%s" | %s', |
||
⚫ | |||
args.anchor or args.title or '', |
|||
⚫ | |||
rowspan, |
rowspan, |
||
article(args) .. release(args) |
article(args) .. release(args) |
||
第53行: | 第55行: | ||
local function right1(args) |
local function right1(args) |
||
⚫ | |||
local status |
local status |
||
第65行: | 第65行: | ||
end |
end |
||
return |
return '\n| td valign="top" class="plainlist" | <b>' .. status .. '</b>:\n' ..args.release |
||
end |
end |
||
local function right2(args) |
local function right2(args) |
||
return |
return '\n| valign="top" | <b>备注</b>:\n' .. (args.notes or '') |
||
end |
end |
||
function p. |
function p.item(frame) |
||
local args = getArgs(frame, { |
local args = getArgs(frame, {frameOnly = true}) |
||
-- Main module code goes here. |
|||
⚫ | |||
local ret |
|||
return left(args, '1') .. right2(args) .. '\n|-' |
|||
end |
|||
ret = |
|||
'<table cellspacing="0" cellpadding="4" border="1" class="wikitable" width="100%" align="center" style="border-collapse: collapse">\n' .. |
|||
'<tr>\n' .. |
|||
'<th scope="col">作品</th>\n' .. |
|||
'<th scope="col">信息</th>\n' .. |
|||
'</tr>\n' .. |
|||
(args[1] or '') .. '\n' .. |
|||
'</table>' |
|||
⚫ | |||
return ret |
|||
return left(args, '1') .. right1(args) ..'\n|-' |
|||
⚫ | |||
function p.item(frame) |
|||
local args = getArgs(frame, { |
|||
frameOnly = true, |
|||
} ) |
|||
local rowspan = args.release and '2' or '1' |
|||
⚫ | |||
return string.format('<tr>%s%s</tr><tr>%s</tr>', left(args, rowspan), right1(args), right2(args)) |
|||
end |
end |
||
return |
return left(args, '2') .. right1(args) .. '\n|-' .. right2(args) .. '\n|-' |
||
end |
end |
2024年7月11日 (四) 03:08的最新版本
require('strict')
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local p = {}
local function left(args, rowspan)
local function article(args)
return string.format('<div class="fn" style="margin-bottom: 4pt;">%s</div>', args.title or '<span class="error">未填写<code>title =</code>参数</span>')
end
local function release(args)
local status, date
if args.platform then
return string.format('<div>%s - %s%s</div>',
args.date or '<span class="error">未填写<code>date =</code>参数</span>',
args.platform,
args.refs or ''
)
end
if yesno(args.series) then
return (args.date or '') .. (args.refs or '')
end
if args.datetype then
status, date = args.datetype, args.date
elseif yesno(args.futuregame) then
status, date = '预定发行日期', args.date
elseif args.canceled then
if args.date then
status, date = '原定发行日期', args.date
else
status, date = '取消日期', args.canceled
end
else
status = '首发日期'
date = args.date or '<span class="error">未填写<code>date =</code>参数</span>'
end
return string.format('<div><b>%s</b>%s:<br />%s</div>', status, args.refs or '', date)
end
return string.format('\n| scope="row" style="%s" rowspan="%s" | %s',
'vertical-align: middle; width: 24em; text-align: center; background-color:transparent;',
rowspan,
article(args) .. release(args)
)
end
local function right1(args)
local status
if yesno(args.futuregame) then
status = '预定平台与发行年份'
elseif args.canceled then
status = '原定平台与发行年份'
else
status = '各平台发行年份'
end
return '\n| td valign="top" class="plainlist" | <b>' .. status .. '</b>:\n' ..args.release
end
local function right2(args)
return '\n| valign="top" | <b>备注</b>:\n' .. (args.notes or '')
end
function p.item(frame)
local args = getArgs(frame, {frameOnly = true})
if args.release == nil then
return left(args, '1') .. right2(args) .. '\n|-'
end
if args.notes == nil then
return left(args, '1') .. right1(args) ..'\n|-'
end
return left(args, '2') .. right1(args) .. '\n|-' .. right2(args) .. '\n|-'
end
return p