Editing Module:Feedback
From The Petit Planet Wiki
More actions
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 121: | Line 121: | ||
------------------------------------------------------------ | ------------------------------------------------------------ | ||
local function renderAttachments(entry) | local function renderAttachments(parent, entry) | ||
local | local link = trim(entry.link) | ||
local image = trim(entry.image) | |||
if link == '' and image == '' then | |||
return | |||
end | |||
local attachments = | |||
parent:tag('div') | |||
:addClass('feedback-attachments') | :addClass('feedback-attachments') | ||
if link ~= '' then | if link ~= '' then | ||
attachments:tag('a') | |||
:addClass('feedback-link') | |||
:attr('href', link) | |||
:attr('target', '_blank') | |||
:attr('rel', 'noopener noreferrer') | |||
: | :wikitext('View link') | ||
end | end | ||
if image ~= '' then | if image ~= '' then | ||
if link ~= '' then | |||
attachments:wikitext(' ') | |||
end | |||
'' | |||
attachments:tag('a') | |||
:addClass('feedback-image-link') | |||
:attr( | |||
'href', | |||
'./File:' .. image | |||
) | ) | ||
:wikitext('View image') | |||
end | end | ||
end | end | ||
| Line 191: | Line 174: | ||
:addClass('feedback-resolution') | :addClass('feedback-resolution') | ||
resolution:wikitext('Resolved by ') | resolution:wikitext('↳ Resolved by ') | ||
if resolvedBy ~= '' then | if resolvedBy ~= '' then | ||
| Line 365: | Line 348: | ||
-- Attachments | -- Attachments | ||
-------------------------------------------------------- | -------------------------------------------------------- | ||
renderAttachments( | |||
content, | |||
entry | |||
) | ) | ||