Module:Feedback: Difference between revisions
From The Petit Planet Wiki
More actions
ReisuDesign (talk | contribs) No edit summary |
ReisuDesign (talk | contribs) No edit summary |
||
| (6 intermediate revisions by the same user not shown) | |||
| Line 122: | Line 122: | ||
local function renderAttachments(entry) | local function renderAttachments(entry) | ||
local wrapper = | |||
mw.html.create('div') | |||
:addClass('feedback-attachments') | |||
local link = trim(entry.link) | |||
if link ~= '' then | |||
local linkWrapper = | |||
wrapper:tag('span') | |||
:addClass('feedback-attachment-link') | |||
linkWrapper:tag('span') | |||
:addClass('feedback-attachment-icon') | |||
linkWrapper:wikitext( | |||
'[' .. link .. ' ' .. mw.text.nowiki(link) .. ']' | |||
) | |||
end | |||
local image = trim(entry.image) | |||
if image ~= '' then | |||
image = mw.ustring.gsub( | |||
image, | |||
'^File:', | |||
'' | |||
) | |||
local title = | |||
mw.title.new('File:' .. image) | |||
if title then | |||
local imageWrapper = | |||
wrapper:tag('span') | |||
:addClass('feedback-attachment-image') | |||
imageWrapper:tag('span') | |||
:addClass('feedback-attachment-icon') | |||
imageWrapper:wikitext( | |||
'[' .. | |||
title:fullUrl() .. | |||
' ' .. | |||
mw.text.nowiki(image) .. | |||
']' | |||
) | |||
end | |||
end | |||
return wrapper | |||
end | end | ||
| Line 166: | Line 191: | ||
:addClass('feedback-resolution') | :addClass('feedback-resolution') | ||
resolution:wikitext(' | resolution:wikitext('Resolved by ') | ||
if resolvedBy ~= '' then | if resolvedBy ~= '' then | ||
| Line 340: | Line 365: | ||
-- Attachments | -- Attachments | ||
-------------------------------------------------------- | -------------------------------------------------------- | ||
renderAttachments( | content:node( | ||
renderAttachments(entry) | |||
) | ) | ||