置顶公告:【置顶】关于临时开启评论区所有功能的公告(2022.10.22) | 【置顶】关于本站Widget恢复使用的公告
  • 你好~!欢迎来到萌娘百科镜像站!如需查看或编辑,请联系本站管理员注册账号。
  • 本镜像站和其他萌娘百科的镜像站无关,请注意分别。

Module:BugReportStatus

贴贴♀百科,万娘皆可贴的百科全书!转载请标注来源页面的网页链接,并声明引自贴贴百科。内容不可商用。
跳到导航 跳到搜索
Template-info.svg 模块文档  [查看] [编辑] [历史] [刷新]

该模块实现{{BugReport/status}}的功能。

请不要直接调用此模块。

  1. -- Module:BugReportStatus
  2. -- Made with ♥ by User:Leranjun
  3. -- This module implements {{tl|BugReport/status}}.
  4. -- Please refrain from invoking this module directly.
  5. -- To add a new status, insert into the table in [[Module:BugReportStatus/status]].
  6. local p = {}
  7. local getArgs = require("Module:Arguments").getArgs
  8. local STATUS = mw.loadData("Module:BugReportStatus/status")
  9. function p.main(frame)
  10. return frame:expandTemplate {title = "状态", args = p._main(getArgs(frame))}
  11. end
  12. function p._main(args)
  13. local p1, p2 = (args[1] or "pending"), args[2]
  14. local pStatus = STATUS[mw.ustring.lower(p1)]
  15. if (pStatus) then
  16. p1 = pStatus[1]
  17. p2 = pStatus[2]
  18. end
  19. local title = mw.title.getCurrentTitle()
  20. local ignore = title.namespace == 10 and title.rootText == "BugReport"
  21. return {
  22. [1] = p1,
  23. [2] = p2,
  24. color = args.color,
  25. prefix = args.prefix,
  26. category = (p1 or ignore) and "" or "尚未处理的BUG提报页面"
  27. }
  28. end
  29. return p