第14行: |
第14行: |
| return frame:expandTemplate{title = "创作者信息/委托发布", args = { | | return frame:expandTemplate{title = "创作者信息/委托发布", args = { |
| ['创作者'] = creator, ['维护者']=maintainer}} | | ['创作者'] = creator, ['维护者']=maintainer}} |
| + | end |
| + | |
| + | function _set_editable_by_user(user) |
| + | local nm = 'User:'..user |
| + | mw.smw.set({ |
| + | ['Editable by user'] = nm |
| + | }) |
| end | | end |
| | | |
| function _other_maintainers(frame, other_maintainers) | | function _other_maintainers(frame, other_maintainers) |
− | local list = mw.text.listToText(other_maintainers, ",", ",") | + | local node = mw.html.create(nil) |
− | return frame:expandTemplate{title = "合作维护者", args = {['合作维护者列表'] = list}} | + | node:wikitext("合作维护者: ") |
| + | for i, m in ipairs(other_maintainers) do |
| + | node:wikitext("[[User:"..m.."|"..m.."]]") |
| + | _set_editable_by_user(m) |
| + | mw.smw.set({ |
| + | ['维护者'] = ("User:"..m) |
| + | }) |
| + | end |
| + | return frame:expandTemplate{title = "LiteInfoBox", args = {image = 'Brainstorm.svg', content = content}} |
| end | | end |
| | | |
| function _maintainer_only(frame, maintainer) | | function _maintainer_only(frame, maintainer) |
| mw.smw.set({ | | mw.smw.set({ |
− | ['Editable by'] = 'whitelist', | + | ['Editable by'] = 'whitelist' |
− | ['Editable by user'] = ('User:'..maintainer)
| |
| }) | | }) |
| return frame:expandTemplate{title = "本页面仅允许维护者编辑", args = {}} | | return frame:expandTemplate{title = "本页面仅允许维护者编辑", args = {}} |
第50行: |
第64行: |
| result = result .. _maintainer_only(frame, maintainer) | | result = result .. _maintainer_only(frame, maintainer) |
| end | | end |
| + | _set_editable_by_user(maintainer) |
| else | | else |
| result = _missing_maintainer(frame) | | result = _missing_maintainer(frame) |