Jump to content
Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
If you make an edit, a temporary account will be created for you.

Module:Feedback: Difference between revisions

From The Petit Planet Wiki
ReisuDesign (talk | contribs)
No edit summary
ReisuDesign (talk | contribs)
No edit summary
 
(5 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')
local wrapper =
        :addClass('feedback-attachments')
mw.html.create('div')
:addClass('feedback-attachments')


    if entry.link and trim(entry.link) ~= '' then
local link = trim(entry.link)
        local link = mw.html.create('a')
            :addClass('feedback-link')
            :attr('href', trim(entry.link))
            :attr('target', '_blank')
            :attr('rel', 'noopener noreferrer')
            :wikitext(trim(entry.link))


        wrapper:node(link)
if link ~= '' then
    end
local linkWrapper =
wrapper:tag('span')
:addClass('feedback-attachment-link')
linkWrapper:tag('span')
:addClass('feedback-attachment-icon')
linkWrapper:wikitext(
'[' .. link .. ' ' .. mw.text.nowiki(link) .. ']'
)
end


    if entry.image and trim(entry.image) ~= '' then
local image = trim(entry.image)
        local imageName = trim(entry.image)


        -- Remove File: prefix if one was stored
if image ~= '' then
        imageName = mw.ustring.gsub(imageName, '^File:', '')
image = mw.ustring.gsub(
image,
'^File:',
''
)


        local imageLink = mw.html.create('a')
local title =
            :addClass('feedback-image-link')
mw.title.new('File:' .. image)
            :attr('href', mw.title.new('File:' .. imageName):fullUrl())
            :attr('target', '_blank')
            :attr('rel', 'noopener noreferrer')
            :wikitext(imageName)


        wrapper:node(imageLink)
if title then
    end
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
return wrapper
end
end


Line 172: Line 191:
:addClass('feedback-resolution')
:addClass('feedback-resolution')


resolution:wikitext('↳ Resolved by ')
resolution:wikitext('Resolved by ')


if resolvedBy ~= '' then
if resolvedBy ~= '' then
Line 346: Line 365:
-- Attachments
-- Attachments
--------------------------------------------------------
--------------------------------------------------------
 
renderAttachments(
content:node(
content,
    renderAttachments(entry)
entry
)
)