Module:ScheduleList:修订间差异

跳转到导航 跳转到搜索
无编辑摘要
无编辑摘要
 
(未显示同一用户的1个中间版本)
第49行: 第49行:
     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 not title or title == "无" then
     if title == "无" then
         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 = {formatted_date, "", week, ""}
             args = {formatted_date, "", week, title} -- 时间为空,标题为“无”
         }
         }
     else
     else
第62行: 第66行:
         schedule_output = frame:expandTemplate{
         schedule_output = frame:expandTemplate{
             title = "ScheduleList/date",
             title = "ScheduleList/date",
             args = {formatted_date, time .. " (UTC+8)", week, title}
             args = {formatted_date, time .. " (UTC+8)", week, title} -- 时间和标题正常显示
         }
         }
     end
     end
第109行: 第113行:


     -- 包装在 <ul> 中,作为返回结果
     -- 包装在 <ul> 中,作为返回结果
     return '<ul class="date-title-list">' .. table.concat(result, "\n") .. '</ul>'
     return '<ul class="schedule-list">' .. table.concat(result, "\n") .. '</ul>'
end
end


return p
return p