跳转到内容

Module:VG titles:修订间差异

维基百科,自由的百科全书
删除的内容 添加的内容
風中的刀劍留言 | 贡献
无编辑摘要
Uzume留言 | 贡献
strict
 
(未显示3个用户的37个中间版本)
第1行: 第1行:
require('Module:No globals')
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
return string.format('<div class="fn" style="margin-bottom: 4pt;">%s</div>', args.title or '<span class="error">未填写<code>title =</code>参数</span>')
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
end
第31行: 第25行:


if yesno(args.series) then
if yesno(args.series) then
status, date = '', args.date
return (args.date or '') .. (args.refs or '')
end

if args.datetype then
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.canceled
if args.date then
status, date = '原定发行日期', args.date
else
status, date = '取消日期', args.canceled
end
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('<td scope="row" id="%s" style="%s" rowspan="%s">%s</td>',
return string.format('\n| scope="row" style="%s" rowspan="%s" | %s',
'vertical-align: middle; width: 24em; text-align: center; background-color:transparent;',
args.anchor or args.title or '',
'vertical-align: middle; width: 256px; text-align: center; background-color:transparent;',
rowspan,
rowspan,
article(args) .. release(args)
article(args) .. release(args)
第53行: 第55行:


local function right1(args)
local function right1(args)
if args.release == nil then return '' end
local status
local status
第65行: 第65行:
end
end
return string.format('<td valign="top"><b>%s</b>:\n%s</td>', status, args.release)
return '\n| td valign="top" class="plainlist" | <b>' .. status .. '</b>:\n' ..args.release
end
end
local function right2(args)
local function right2(args)
return string.format('<td valign="top"><b>备注</b>:\n%s</td>', args.notes or '')
return '\n| valign="top" | <b>备注</b>:\n' .. (args.notes or '')
end
end


function p.main(frame)
function p.item(frame)
local args = getArgs(frame, { frameOnly = true } )
local args = getArgs(frame, {frameOnly = true})
-- Main module code goes here.
if args.release == nil then
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>'
if args.notes == nil then
return ret
return left(args, '1') .. right1(args) ..'\n|-'
end

function p.item(frame)
local args = getArgs(frame, {
frameOnly = true,
} )
local rowspan = args.release and '2' or '1'

if rowspan == '2' then
return string.format('<tr>%s%s</tr><tr>%s</tr>', left(args, rowspan), right1(args), right2(args))
end
end
return string.format('<tr>%s%s</tr>', left(args, rowspan), right2(args))
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