Module:VG titles:修订间差异
外观
删除的内容 添加的内容
(Wikiplus) |
无编辑摘要 |
||
第51行: | 第51行: | ||
end |
end |
||
local function right(args) |
|||
local function right1(args) |
|||
if args.release == nil then return end |
|||
local status |
|||
if yesno(args.futuregame) then |
|||
status = '预定平台与发行年份' |
|||
elseif args.canceled then |
|||
status = '原定平台与发行年份' |
|||
else |
|||
status = '各平台发行年份' |
|||
end |
|||
return string.format('<td><b>%s</b>:\n%s</td>', status, args.release) |
|||
end |
|||
local function right2(args) |
|||
local temp = string.format('<td><b>备注</b>:\n%s</td>', args.notes) |
|||
if right1(args) == nil then |
|||
return temp |
|||
end |
|||
return '<tr>' .. temp .. '</tr>' |
|||
end |
|||
end |
|||
function p.main(frame) |
function p.main(frame) |
||
第81行: | 第111行: | ||
} ) |
} ) |
||
return left(args) |
return left(args) .. right(args) |
||
end |
end |
2015年12月5日 (六) 03:29的版本
require('Module:No globals')
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local p = {}
local function left(args)
local function article(args)
local core
if args.article then
core = string.format('[[%s|%s]]', args.article, args.title or args.article)
else
core = args.title or '<span class="error">未填写<code>title =</code>参数</span>'
end
return string.format('<div class="fn" style="margin-bottom: 10pt;">%s</div>', core)
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
status, date = '', args.date
elseif yesno(args.futuregame) then
status, date = '预定发行日期', args.date
elseif args.canceled then
status, date = '原定发行日期', args.canceled
else
status = '各地首发日期'
date = args.date or '<span class="error">未填写<code>date =</code>参数</span>'
end
return string.format('<div><b>%s</b>%s:<br />%s', status, args.refs or '', date)
end
return string.format('<td scope="row" id="%s" style="%s" rowspan="%s">%s</td>',
args.anchor or args.title or '',
'vertical-align: middle; width: 256px; text-align: center; background-color:transparent;',
args.release and '2' or '1',
article(args) .. release(args)
)
end
local function right(args)
local function right1(args)
if args.release == nil then return end
local status
if yesno(args.futuregame) then
status = '预定平台与发行年份'
elseif args.canceled then
status = '原定平台与发行年份'
else
status = '各平台发行年份'
end
return string.format('<td><b>%s</b>:\n%s</td>', status, args.release)
end
local function right2(args)
local temp = string.format('<td><b>备注</b>:\n%s</td>', args.notes)
if right1(args) == nil then
return temp
end
return '<tr>' .. temp .. '</tr>'
end
end
function p.main(frame)
local args = getArgs(frame, { frameOnly = true } )
-- Main module code goes here.
local ret
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] .. '\n' ..
'</table>'
return ret
end
function p.item(frame)
local args = getArgs(frame, {
frameOnly = true,
valueFunc = function (key, value)
if key == 'notes' and string.sub( value, -1, -1 ) == '\n' then
value = string.sub( value, 1, -2 )
end
return value
end,
} )
return left(args) .. right(args)
end
return p