Module:Sandbox/Wangxuan8331800/SB1

Revision as of 21:25, 20 February 2016 by imported>Johnuniq (comment out some syntax errors to remove from Category:Scribunto modules with errors)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Sandbox/Wangxuan8331800/SB1/doc

local p = {}

function p.ass (frame)
	class_list={
		"fa",
		"fl",
		"a",
		"ga",
		--[[
		if (frame.args['bplus'] == "yes" or "y" or "1") then
			"bplus",
		end
		]]
		"b",
		"c",
		"start",
		"stub",
		"list",
	} 
	
	importance_list={
		"top",
		"high",
		"mid",
		"low",
		--[[
		if frame.args['bottom'] == "yes" or "y" or "1" then
			"bottom",
		end
		if frame.args['no'] == "yes" or "y" or "1" then
			"no",
		end
		if frame.args['na']  == "yes" or "y" or "1" then
			"na",
		end
		]]
	}
			
	local classicon ={	
		fa='Featured article star.svg',
		fl='Featured article star.svg',
		a='Symbol a class.svg',
		ga='Symbol support vote.svg',
		b='Symbol b class.svg',
		c='Symbol c class.svg',
		start='Start-icon.svg',
		stub='Symbol stub class.svg',
		list='Symbol list class.svg',
		bplus='Symbol bplus class.svg',
		no='Crystal button cancel.svg',
		cat='Folder Hexagonal Icon.svg',
		disambig='Symbol dab class.svg',
		redirect='Symbol redirect vote.svg',
		template='Symbol template class.svg',
		na='Symbol neutral vote.svg',
		image='Video-x-generic.svg',
		portal='Portal.svg',
		project='Symbol information vote.svg',
	}

	local class_color = {
		fa           = '#6699ff',
		fl           = '#6699ff',
		fm           = '#6699ff',
		a            = '#66ffff',
		al            = '#66ffff',
		ga           = '#66ff66',
		b            = '#b2ff66',
		bl            = '#b2ff66',
		c            = '#ffff66',
		cl            = '#ffff66',
		start        = '#ffaa66',
		stub         = '#ff6666',
		list         = '#aa88ff',
		na           = '#f5f5f5',
		categorycat = '#ffdb58',
		current      = '#d462ff',
		 disambigdab = '#00fa9a',
		fileimage   = '#ddccff',
		audio        = '#ddccff',
		future       = '#8a95c9',
		merge        = '#add8e6',
		needed       = '#dcdcdc',
		portal       = '#cc8899',
		project      = '#c0c090',
		 redirect     = '#c0c0c0',
		template     = '#fbceb1',
		bplus     = '#66ff66',
		sl           = '#ff6666',
		user         = '#999900',
		deferred     = '#999999',
		book         = '#98FF98',
		unassessed   = 'transparent',
	}
	
	for i, v in ipairs(class_list) do
		for j, w in ipairs(importance_list) do
			--[=[
			local class_number[i] .. '_' .. importance_number[j] = tonumber(frame.args[class_number[i] .. '_' .. importance_number[j]])
			]=]
		end
	end
	
	function input_row (i, j)
		row_title = '<th class="assess-' .. num_class[i] .. '" style="background: ' .. class_color[num_class[i]] .. '; text-align: center;">[[File:' .. classicon[num_class[i]] .. '|16px|alt=' .. class_name ..']]' .. class_category[num_class[i]] .. '</th>'
		row_top = arg
	end 

end