Modul:Banner shell
Mogoče bi radi ustvarili dokumentacijsko stran za ta Scribunto modul Urejevalci lahko preizkušate ta modul v peskovniku (ustvari | mirror) in testnihprimerih (ustvari). Prosimo, da dodate kategorije v /dok podstran. Podstrani te predloge. |
local p = {}
p.main = function(frame)
local yesno = require('Module:Yesno')
local classmask = require('Module:Class mask')
local args = frame:getParent().args
local class = classmask._main{args.class or ''}
local pagetype = require('Module:Pagetype')._main{class=class}
local out = ''
local ofinterest = function(collapsed)
local wikiprojects = '[[Wikipedija:WikiProjekt|WikiProjektov]]'
local text = ' je v delokrogu '
if yesno(collapsed) then
text = text .. 'več ' .. wikiprojects .. '.'
else
text = text .. 'naslednjih ' .. wikiprojects .. ':'
end
return text
end
if yesno(args.blp) or yesno(args.living) then
out = out .. frame:expandTemplate{title = 'BŽO'}
elseif yesno(args.blpo) then
out = out .. frame:expandTemplate{title = 'BŽO drugo'}
end
if yesno(args.activepol) then
out = out .. frame:expandTemplate{title = 'Aktivni politik'}
end
local bhargs = {
templatestyles = 'WikiProject banner shell/styles.css',
collapsed = args.collapsed,
size = '32',
class = 'wpbs',
image = 'WikiProject Council with transparent background.svg',
alt = 'Svet WikiProjektov',
image_link = 'Wikipedija:Svet WikiProjektov'
}
local globalclass = false
if class == '' then -- check if class parameters is defined by any project banner
local articleclass = classmask.readarticleclass{ignore_blank=true, only_subtemplates=true}
if articleclass == '' then -- no class parameters are defined by any project banner, so globally unassessed
globalclass = true
end
else -- global class defined, so display it
globalclass = true
end
if globalclass then
local showclass = require('Module:Class')._class
local header = showclass{class, image='yes'}
header = header .. '<td class="banner-shell-header" style="text-align: left; font-weight: normal;">Ta '
if args.category == 'no' then
header = header .. 'članek '
else
header = header .. pagetype .. ' '
end
if class == '' then
header = header .. 'še ni ocenjen'
else
header = header .. 'je ocenjen kot razreda <span style="font-weight:bold;">' .. class .. '</span>'
end
header = header .. " po [[Wikipedija:Ocenjevanje vsebine|lestvici ocenjevanja vsebine]] v Wikipediji.<br>"
if args[1] and args[1]~='' then
header = header .. 'It' .. ofinterest(args.collapsed)
else
if not args.category or args.category=='' then
if mw.title.getCurrentTitle().isTalkPage then
header = header .. '[[Kategorija:' .. (class=='' and 'Neocenjeni' or (class .. '')) .. ' članki]]'
end
end
end
header = header .. '</td>'
bhargs.header = header
end
if args.header then
bhargs.text = args.header
else
bhargs.text = 'Ta ' .. pagetype .. ofinterest(args.collapsed)
end
bhargs[1] = args[1] or ''
out = out .. frame:expandTemplate{title='Ogrodje za pasice', args=bhargs}
if not args[1] or args[1] == '' then
out = out .. '[[Kategorija:Strani, ki uporabljajo ogrodje za pasice WikiProjektov brez pasic]]' --talkother
end
if args.listas and args.listas ~= '' then
frame:preprocess('{{DEFAULTSORT:' .. args.listas .. '}}')
end
return out
end
return p