第95行: |
第95行: |
| mw.smw.set({['设定类型'] = "公共设定"}) | | mw.smw.set({['设定类型'] = "公共设定"}) |
| out = out .. "[[Category:公共设定]]" | | out = out .. "[[Category:公共设定]]" |
− | else -- 文档页 | + | else -- 共享文档页 |
− | out = out .. (renderLiteInfoBox(frame, "SharedItem.svg", "文档页")) | + | out = out .. (renderLiteInfoBox(frame, "SharedItem.svg", "共享资源页")) |
− | mw.smw.set({['设定类型'] = "文档"}) | + | mw.smw.set({['设定类型'] = "共享资源"}) |
− | out = out .. "[[Category:文档]]" | + | out = out .. "[[Category:共享资源]]" |
| end | | end |
| else -- base must exist | | else -- base must exist |
第137行: |
第137行: |
| | | |
| function p.renderCreator(frame) | | function p.renderCreator(frame) |
| + | local root = mw.html.create("div") |
| local title = PageName.getPageName() | | local title = PageName.getPageName() |
| local prop_names = {"维护者", "创作者", "输入设定类型", "设定集核心页", "依赖设定集", "仅允许维护者编辑", "创作阶段", "上级概念", "前置条件", "事后效果"} | | local prop_names = {"维护者", "创作者", "输入设定类型", "设定集核心页", "依赖设定集", "仅允许维护者编辑", "创作阶段", "上级概念", "前置条件", "事后效果"} |
− | local props = SMWUtils.query_page_properties("[["..title.."]]", prop_names)[1]["properties"] | + | local page = SMWUtils.query_page_properties("[["..title.."]]", prop_names)[1] |
− | local root = mw.html.create("div") | + | if page == nil then |
| + | return root:done() |
| + | end |
| + | local props = page["properties"] |
| root:attr("style", "display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, auto)); width: 100%") | | root:attr("style", "display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, auto)); width: 100%") |
| local maintainerTemp = renderMaintainers(frame, props["维护者"], props["创作者"]) | | local maintainerTemp = renderMaintainers(frame, props["维护者"], props["创作者"]) |