Модуль:Message box: различия между версиями
м 1 версия импортирована: Импорт Инфобокса из Русскоязычной википедии. |
м 1 версия импортирована |
||
| Строка 169: | Строка 169: | ||
-- Add attributes, classes and styles. | -- Add attributes, classes and styles. | ||
self.id = args.id | self.id = args.id | ||
self.name = args.name | |||
if self.name then | |||
self:addClass('mbox-' .. string.gsub(self.name,' ','_')) | |||
end | |||
if yesno(args.plainlinks) ~= false then | if yesno(args.plainlinks) ~= false then | ||
self:addClass('plainlinks') | self:addClass('plainlinks') | ||
end | end | ||
for _, class in ipairs(cfg.classes or {}) do | for _, class in ipairs(cfg.classes or {}) do | ||
| Строка 224: | Строка 225: | ||
self.issue = args.smalltext | self.issue = args.smalltext | ||
else | else | ||
if args.sect and args.sect ~= '' or nil then | |||
local issue_sect = args.issue_sect | |||
issue_sect = type(issue_sect) == 'string' and issue_sect ~= '' and issue_sect or nil | |||
local text_sect = args.text_sect | |||
text_sect = type(text_sect) == 'string' and text_sect ~= '' and text_sect or nil | |||
local issues = {} | |||
table.insert(issues, issue_sect) | |||
table.insert(issues, text_sect) | |||
self.issue = table.concat(issues, ' ') | |||
else | |||
local issue = args.issue | |||
issue = type(issue) == 'string' and issue ~= '' and issue or nil | |||
local text = args.text | |||
text = type(text) == 'string' and text or nil | |||
local issues = {} | |||
table.insert(issues, issue) | |||
table.insert(issues, text) | |||
self.issue = table.concat(issues, ' ') | |||
end | end | ||
end | end | ||
| Строка 453: | Строка 458: | ||
if self.isSubstituted then | if self.isSubstituted then | ||
self:addCat('all', 'Википедия:Страницы с ошибочно подставленными шаблонами') | self:addCat('all', 'Википедия:Страницы с ошибочно подставленными шаблонами') | ||
end | |||
if self.isSmall then | |||
self:addCat(0, 'Википедия:Страницы с малыми шаблонами-сообщениями') | |||
end | end | ||
end | end | ||
| Строка 554: | Строка 562: | ||
textsmallCellDiv:tag('span') | textsmallCellDiv:tag('span') | ||
:addClass('hide-when-compact') | :addClass('hide-when-compact') | ||
:wikitext(self.fix and (' ' .. self.fix) or nil) | |||
:wikitext(self.talk and (' ' .. self.talk) or nil) | :wikitext(self.talk and (' ' .. self.talk) or nil) | ||
end | end | ||
textsmallCellDiv:wikitext(self.date and (' ' .. self.date) or nil) | if self.textsmall or self.fix or self.talk then | ||
textsmallCellDiv:wikitext(self.date and (' ' .. self.date) or nil) | |||
else | |||
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil) | |||
end | |||
if self.info and not self.isSmall then | if self.info and not self.isSmall then | ||
textsmallCellDiv | textsmallCellDiv | ||