VOOZH about

URL: https://minecraft.wiki/w/Module:Feedback

⇱ Module:Feedback – Minecraft Wiki


Module:Feedback

From Minecraft Wiki
Jump to navigation Jump to search
Documentation[create] [purge]
This module has no documentation. If you know how to use this module, please create it.
-- Taken from https://oldschool.runescape.wiki/w/Module:Feedback, version 14834384 saved by BigDiesel2m. Full list of authors available on https://oldschool.runescape.wiki/w/Module:Feedback?action=history. CC BY-NC-SA 3.0 - https://creativecommons.org/licenses/by-nc-sa/3.0/.
localpt=require('Module:Paramtest')
localyn=require('Module:Yesno')
localp={}
p.yn=yn
functionp.main(frame)
returnp._main(frame:getParent().args)
end
functionp._main(args)
localisResolved=false
ifpt.has_content(args.resolved)then
isResolved=yn(args.resolved)
end
localcomment=pt.default_to(args.feedback,"''No comment provided''")
localid=pt.default_to(args.id,'')
localfbdate=nil
ifpt.has_content(args.date)then
fbdate=args.date
if#fbdate>10then
fbdate=string.sub(fbdate,0,-4)
end
end
locallang=mw.getContentLanguage()
localsignature=tonumber(args.date)>1782490518100and''orpt.default_to(args.sign,'--[[User:FeedbackBot|FeedbackBot]] '..lang:formatDate('H:i, j xg Y (e)','@'..fbdate))
comment=comment:gsub('%s*%-%-%[%[User:FeedbackBot|FeedbackBot%]%] %(%[%[User talk:FeedbackBot|talk%]%]%) %d%d:%d%d, %d%d? [A-Z][a-z]+ %d%d%d%d %(UTC%)$','')
localoutDiv=mw.html.create('div')
outDiv:addClass('tile gloop-feedback-wrapper')
:attr('id','gloop-feedback-scrollto-'..id)
:attr('data-id',id)
:css({
['margin-bottom']='0.75em'
})
localtoggleDiv=outDiv:tag('div')
toggleDiv:css({
['float']='right',
['padding']='0.25em 0.5em',
['border-radius']='5px',
['font-size']='0.85em',
['font-weight']='800',
['margin']='0 0 10px 10px'
})
ifisResolvedthen
toggleDiv:addClass('tc-yes gloop-feedback-resolve-toggle')
:tag('span'):wikitext('Resolved[[Category:Pages with resolved feedback]]')
else
toggleDiv:addClass('tc-no gloop-feedback-resolve-toggle')
:tag('span'):wikitext('Unresolved[[Category:Pages with unresolved feedback]]')
end
outDiv:newline():newline()
outDiv:tag('div')
:addClass('gloop-feedback-comment')
:wikitext(mw.getCurrentFrame():extensionTag('poem',comment)..' '..signature)
ifmw.title.getCurrentTitle().isTalkPagethen
bucket('feedback').put({
resolved=isResolved,
comment=comment,
id=id,
timestamp=fbdate
})
end
returntostring(outDiv)
end
functionp.list(frame)
returnp._list(frame:getParent().args)
end
functionp._list(args)
localb=bucket('feedback')
.select('page_name','id','comment','resolved','timestamp')
.orderBy('timestamp','DESC')
.limit(2500)
ifpt.has_content(args.page)then
b.where('page_name',args.page)
end
ifpt.has_content(args.show)then
ifstring.lower(args.show)=='resolved'then
b.where('resolved',true)
end
else
b.where('resolved',false)
end
localdata=b.run()
ifdata[1]==nilthen
returntostring('No feedback to display.')
end
locallang=mw.getContentLanguage()
localoutT=mw.html.create('table')
localheader=outT:addClass('wikitable sortable sticky-header align-center-2')
:tag('tr')
:tag('th')
:wikitext('Page')
:css({['width']='300px'})
:done()
:tag('th')
:wikitext('Date')
:css({['width']='115px'})
:done()
:tag('th')
:wikitext('Feedback')
:done()
ifpt.has_content(args.show)andstring.lower(args.show)=='all'then
header:tag('th'):wikitext('Resolved'):done()
end
fori,vinipairs(data)do
localtr=outT:newline():tag('tr')
localarticlepagename=mw.title.new(v.page_name).subjectPageTitle.prefixedText:gsub("^(.-)/Archive [0-9]+","%1")
localfbdate=v['timestamp']
localfbsort=0
iffbdatethen
fbsort=fbdate
fbdate=lang:formatDate('Y-m-d','@'..(#fbdate>10andstring.sub(fbdate,0,-4)orfbdate))
else
fbdate=''
end
tr:tag('td')
:wikitext('[['..articlepagename..']]'..' ([['..v.page_name..'#gloop-feedback-scrollto-'..v['id']..'|talk]])'):done()
:tag('td')
:attr('data-sort-value',fbsort):wikitext(fbdate):done()
:tag('td')
:wikitext(v['comment']):done()
ifpt.has_content(args.show)andstring.lower(args.show)=='all'then
ifyn(v['resolved'])then
tr:tag('td'):wikitext('[[File:BlockSprite test-block-accept.png|15px|class=pixel-image|link=]]')
else
tr:tag('td'):wikitext('[[File:BlockSprite test-block-fail.png|15px|class=pixel-image|link=]]')
end
end
end
returntostring(outT)
end
functionp.submit(frame)
returnp._submit(frame:getParent().args)
end
functionp._submit(args)
localtime=os.time()
returnstring.format(
'== Feedback (%s) ==\n\n{{Feedback\n|id=%s\n|date=%s\n|resolved=no\n|feedback=%s\n|sign=~~~~\n}}',
mw.getContentLanguage():formatDate('D, m M Y H:i:s e',os.date('!%FT%TZ',time)),
time,
time,
mw.text.encode(mw.text.trim(mw.text.unstripNoWiki(args[1]or'')),'{}'):gsub('|','{{!}}')
)..(mw.isSubsting()and''or'[[Category:Pages with templates requiring substitution]]')
end
returnp
Retrieved from "https://minecraft.wiki/w/Module:Feedback?oldid=3648926"

Navigation menu