Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:WikiProjectBanner/AssessmentRow
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
------------------------------------------------------------------------------- -- AssessmentRow class -- -- This module contains the AssessmentRow class used in -- -- Module:WikiProjectBanner. It is used to generate the quality row and the -- -- importance row, and can be used to generate other kinds of assessment -- -- rows if they are needed. -- ------------------------------------------------------------------------------- local Row = require('Module:WikiProjectBanner/Row') local mShared = require('Module:WikiProjectBanner/shared') local AssessmentRow = setmetatable({}, Row) AssessmentRow.__index = AssessmentRow function AssessmentRow.new(args, bannerData, cfg, rowCfg, gradeObj) local obj = Row.new(args, bannerData, cfg, rowCfg) setmetatable(obj, AssessmentRow) obj.grade = gradeObj obj.assessmentType = obj.grade.assessmentType local gradeData = obj.grade:exportData() local assessmentCfg = obj.cfg.assessment[obj.assessmentType] -- Icon do -- Icon style local style = { ['text-align'] = 'center', ['white-space'] = 'nowrap', ['font-weight'] = 'bold', ['background'] = gradeData.color } -- Icon class local class = assessmentCfg.classes if class then class = mShared.substituteParams( class, mw.ustring.lower(gradeData.short) ) end -- Icon image local image if gradeData.image then image = string.format('[[File:%s|16px]] ', gradeData.image) if gradeData.hideImage then image = string.format( '<span style="display:none;">%s</span>', image ) end else image = '' end -- Icon category link local link if gradeData.assessmentCategory then link = string.format( '[[:%s:%s|%s]]', mw.site.namespaces[14].name, gradeData.assessmentCategory, gradeData.short ) else link = gradeData.short end obj:setIcon(image .. link, {class = class, style = style}) end -- Text do local msg = gradeData.blurb or assessmentCfg.blurb or error(string.format( "no blurb found for assessment type '%s'", obj.assessmentType )) obj:setText(mShared.substituteParams( msg, gradeData.full, obj.bannerData.assessmentLink, obj.bannerData.pageType )) end return obj end return AssessmentRow
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:WikiProjectBanner/AssessmentRow/doc
(
edit
)