Module:ScheduleList:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
无编辑摘要 |
||
(未显示同一用户的5个中间版本) | |||
第48行: | 第48行: | ||
local function format_date_line(frame, date, time, week, title, css_class) | local function format_date_line(frame, date, time, week, title, css_class) | ||
local formatted_date = format_date(date) | local formatted_date = format_date(date) | ||
-- 如果标题为空,设置默认值为“无” | |||
if not title or title == "" then | |||
title = "无" | |||
end | |||
local schedule_output | local schedule_output | ||
if title == "无" then | |||
if | |||
css_class = (css_class and css_class .. " " or "") .. "offline" -- 标题为空时,添加“offline”类 | css_class = (css_class and css_class .. " " or "") .. "offline" -- 标题为空时,添加“offline”类 | ||
schedule_output = frame:expandTemplate{ | schedule_output = frame:expandTemplate{ | ||
title = "ScheduleList/date", | title = "ScheduleList/date", | ||
args = { | args = {formatted_date, "", week, title} -- 时间为空,标题为“无” | ||
} | } | ||
else | else | ||
第62行: | 第66行: | ||
schedule_output = frame:expandTemplate{ | schedule_output = frame:expandTemplate{ | ||
title = "ScheduleList/date", | title = "ScheduleList/date", | ||
args = { | args = {formatted_date, time .. " (UTC+8)", week, title} -- 时间和标题正常显示 | ||
} | } | ||
end | end | ||
第109行: | 第113行: | ||
-- 包装在 <ul> 中,作为返回结果 | -- 包装在 <ul> 中,作为返回结果 | ||
return '<ul class=" | return '<ul class="schedule-list">' .. table.concat(result, "\n") .. '</ul>' | ||
end | end | ||
return p | return p |