Module:SiteList: Difference between revisions

Jump to navigation Jump to search
762 bytes removed ,  21 July 2023
no edit summary
No edit summary
Tag: Manual revert
No edit summary
local p = {}
 
local function p.listcreateURL(framesite, id, sceneid)
local argssite_data = frame:getParentmw.loadData('Module:SiteDictionary').args[site]
local siteTypeurl = args[1] or ''site_data.base_url
local site = args['site'] or ''
local id = args['id'] or ''
local sceneid = args['sceneid'] or ''
local alias = args['alias'] or ''
local notes = args['notes'] or 'N/A'
 
if siteInfosceneid then
-- Создаем словарь соответствий для сайтов
url = url .. string.format(site_data.scene_url, sceneid)
local siteData = mw.loadData('Module:SiteDictionary')
elseif id then
local siteInfo = siteData[site]
url = url .. string.format(site_data.id_url, id)
 
local websiteText = "None"
if siteInfo then
websiteText = string.format(
siteInfo.template,
sceneid ~= '' and sceneid or id ~= '' and id or '',
siteInfo.name
)
end
 
return url
-- Выбираем тип и форматируем данные
end
local typeText = ''
local backgroundColor = ''
 
function p.siteList(frame)
if string.lower(siteType) == 'website' then
local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:SiteList'})
typeText = 'Website'
local site = args['.site'] or ''""
backgroundColor = '#E7E7E7'
local id = args['.id'] or ''""
elseif string.lower(siteType) == 'studio' then
local sceneid = args['.sceneid'] or ''""
typeText = 'Studio'
]], backgroundColor, typeText, websiteText,local alias ~= '' and args.alias or mw.title.getCurrentTitle().text, notes)
backgroundColor = '#DADADA'
local aliasnotes = args['alias'].notes or ''"N/A"
else
 
typeText = siteType
local url = createURL(site, id, sceneid)
end
 
local output = '<tr><td>' .. site .. '</td><td><a href="' .. url .. '">' .. site .. '</a></td><td>' .. alias .. '</td><td>' .. notes .. '</td></tr>'
-- Строим результат
local result = string.format([[
|-
| style="text-align:center;vertical-align:middle; background-color:%s;text-align:center;color:black" | '''%s'''
| style="text-align:center;vertical-align:middle;" | %s
| style="text-align:center;vertical-align:middle;" | %s
| style="text-align:center;vertical-align:middle;" | <small>%s</small>
]], backgroundColor, typeText, websiteText, alias ~= '' and alias or mw.title.getCurrentTitle().text, notes)
 
return resultoutput
end
 

Navigation menu