Module:Feedback: Difference between revisions
From The Petit Planet Wiki
More actions
ReisuDesign (talk | contribs) No edit summary |
ReisuDesign (talk | contribs) No edit summary |
||
| (9 intermediate revisions by the same user not shown) | |||
| Line 121: | Line 121: | ||
------------------------------------------------------------ | ------------------------------------------------------------ | ||
local function renderAttachments( | local function renderAttachments(entry) | ||
local wrapper = | |||
mw.html.create('div') | |||
:addClass('feedback-attachments') | |||
local link = trim(entry.link) | local link = trim(entry.link) | ||
if 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 | end | ||
local | local image = trim(entry.image) | ||
if | 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 | end | ||
return wrapper | |||
end | end | ||
| Line 174: | Line 191: | ||
:addClass('feedback-resolution') | :addClass('feedback-resolution') | ||
resolution:wikitext(' | resolution:wikitext('Resolved by ') | ||
if resolvedBy ~= '' then | if resolvedBy ~= '' then | ||
| Line 348: | Line 365: | ||
-- Attachments | -- Attachments | ||
-------------------------------------------------------- | -------------------------------------------------------- | ||
renderAttachments( | content:node( | ||
renderAttachments(entry) | |||
) | ) | ||