local p = local yesno = require('Module:Yesno')
local shell = function(frame, header, content, collapsed, class) local styles = frame:extensionTag('templatestyles', ,) .. frame:extensionTag('templatestyles', ,) local content_row if content then content_row = mw.html.create('tr') :tag('td') :attr('colspan', '2') :addClass('banner-shell-inner'):addClass('outercollapse') :wikitext(content) :done end local holder = mw.html.create('table') :attr('role', 'presentation') :addClass('tmbox'):addClass('tmbox-notice'):addClass('banner-shell') :addClass(class) -- allow additional class to be specified :addClass(content and 'mw-collapsible' or nil) :addClass(collapsed and 'mw-collapsed' or nil) :node(header) :node(content_row) return styles .. tostring(holder)end
p.banner_holder = function(frame) local args = require('Module:Arguments').getArgs(frame,) local image = '' local image_cell = mw.html.create('td') :addClass('mbox-image') :wikitext(image) local text_cell = mw.html.create('td') :addClass('mbox-text'):addClass('banner-shell-header') :tag('span'):addClass('collapseButton'):addClass('nowrap'):css('float', 'left'):wikitext(string.rep(' ', 10)):done :wikitext(args.text or 'Other talk page banners') local header = mw.html.create('tr'):node(image_cell):node(text_cell) return shell(frame, header, args[1], yesno(args.collapsed))end
local DuplicateBanners = function(text) local capture = '
([%w%s]*)' local banners = for project in text:gmatch(capture) do if banners[project]p.banner_shell = function(frame) local args = require('Module:Arguments').getArgs(frame,) local title = args.demo_page and mw.title.new(args.demo_page) or mw.title.getCurrentTitle local pagetype = require('Module:Pagetype')._main local classmask = require('Module:WikiProject banner').class_mask local class = pagetype
and args[1] then -- check if class parameters are defined by any project banner local articleclass = require('Module:WikiProject banner').readarticleclass(title.talkPageTitle.prefixedText ) if articleclass~= then -- class parameters are defined by one or more project banners class = nil -- no global assessment local raw_args = require('Module:Arguments').getArgs(frame,) end end local class2 = class and class~= and (class .. '-Class') or 'Unassessed' local vital local icon_class = 'council' if yesno(args.vital) then local page = mw.ustring.upper(mw.ustring.sub(title.subjectPageTitle.text, 1, 1)) -- get first letter of article name local codepoint = mw.ustring.codepoint(page, 1, 1) if codepoint<65 or codepoint>90 then --first letter is not between A-Z page = 'others' end local data_page = mw.title.new('Wikipedia:Vital articles/data/' .. page .. '.json') if data_page.exists then local index = title.subjectPageTitle.text index = tostring(tonumber(index))
'4' or level
'NA' or class
)) or (valid.level and level
nil) then show_cat = false end if show_cat then local category = cat:gsub('_CLASS', class2) :gsub('_LEVEL', level or 'unknown') :gsub('_TOPIC', data.topic or 'an unknown topic') addCategory(category) end end vitalCat('_CLASS vital articles',) vitalCat('Wikipedia level-_LEVEL vital articles',) vitalCat('Wikipedia vital articles in _TOPIC',) vitalCat('_CLASS level-_LEVEL vital articles',) vitalCat('Wikipedia level-_LEVEL vital articles in _TOPIC',) vitalCat('_CLASS vital articles in _TOPIC',) else addCategory('Articles not listed in the vital article list') end end end local pagetype_display = pagetype
'page' and 'page' or pagetype
'NA' and (icons[pagetype] or pagetype) or class if class
'NA' then text = text .. 'does not require a rating' else text = text .. 'is rated
' .. class .. '-class' end text = text .. ' on Wikipedia\'s content assessment scale.' if args[1] then text = text .. ''article' and args.class and class
return p