Модуль:Message box: различия между версиями
м 1 версия импортирована |
WerySkok (обсуждение | вклад) м 1 версия импортирована |
||
| (не показана 1 промежуточная версия этого же участника) | |||
| Строка 169: | Строка 169: | ||
-- Add attributes, classes and styles. | -- Add attributes, classes and styles. | ||
self.id = args.id | self.id = args.id | ||
if yesno(args.plainlinks) ~= false then | if yesno(args.plainlinks) ~= false then | ||
self:addClass('plainlinks') | self:addClass('plainlinks') | ||
end | |||
if args.mini then | |||
self:addClass('ambox-mini') | |||
end | end | ||
for _, class in ipairs(cfg.classes or {}) do | for _, class in ipairs(cfg.classes or {}) do | ||
| Строка 225: | Строка 224: | ||
self.issue = args.smalltext | self.issue = args.smalltext | ||
else | else | ||
if args.sect | local sect | ||
if args.sect == '' then | |||
sect = '<span style="font-weight:bold">Эта ' .. (cfg.sectionDefault or 'статья') .. '</span>' | |||
elseif type(args.sect) == 'string' then | |||
sect = '<span style="font-weight:bold">' .. args.sect .. '</span>' | |||
end | end | ||
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, sect) | |||
table.insert(issues, issue) | |||
table.insert(issues, text) | |||
self.issue = table.concat(issues, ' ') | |||
end | end | ||
| Строка 458: | Строка 453: | ||
if self.isSubstituted then | if self.isSubstituted then | ||
self:addCat('all', 'Википедия:Страницы с ошибочно подставленными шаблонами') | self:addCat('all', 'Википедия:Страницы с ошибочно подставленными шаблонами') | ||
end | end | ||
end | end | ||
| Строка 562: | Строка 554: | ||
textsmallCellDiv:tag('span') | textsmallCellDiv:tag('span') | ||
:addClass('hide-when-compact') | :addClass('hide-when-compact') | ||
:wikitext(self.talk and (' ' .. self.talk) or nil) | |||
:wikitext(self.fix and (' ' .. self.fix) or nil) | :wikitext(self.fix and (' ' .. self.fix) or nil) | ||
end | end | ||
textsmallCellDiv:wikitext(self.date and (' ' .. self.date) or nil) | |||
if self.info and not self.isSmall then | if self.info and not self.isSmall then | ||
textsmallCellDiv | textsmallCellDiv | ||