| 第132行: |
第132行: |
| | image = 'Settings.svg', | | image = 'Settings.svg', |
| | link = 'https://wiki.ifworlds.org/wiki/特殊:编辑表格/设定页v2/'..title | | link = 'https://wiki.ifworlds.org/wiki/特殊:编辑表格/设定页v2/'..title |
| | + | } |
| | + | return frame:expandTemplate{title = "LinkButtonBox", args = args} |
| | + | end |
| | + | |
| | + | function renderShareButton(frame) |
| | + | local title = PageName.getPageName() |
| | + | local args = { |
| | + | image = 'ShareButton.svg', |
| | + | link = 'https://share-wiki.ifworlds.org/#/share?title='..title |
| | } | | } |
| | return frame:expandTemplate{title = "LinkButtonBox", args = args} | | return frame:expandTemplate{title = "LinkButtonBox", args = args} |
| 第137行: |
第146行: |
| | | | |
| | 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["创作者"]) |
| 第155行: |
第168行: |
| | | | |
| | | | |
| | + | root:wikitext(renderShareButton(frame)) |
| | root:wikitext(renderEditButton(frame)) | | root:wikitext(renderEditButton(frame)) |
| | return root:done() | | return root:done() |