Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Module documentation[view][edit][history][purge]
This documentation is transcluded from Module:Status/doc. Changes can be proposed in the talk page.
Function list
L 84 — p.get
L 92 — p.getText
L 98 — p.getClass
L 104 — p.getColour

Supported values:

removed: "Removed"
unknown: "Unknown"
in_development: "In-development"
under_testing: "Undergoing testing"
not_in_service: "Not in Service"
out_of_service: "Out of Service"
steam_only: "Steam services only"
diesel_only: "Diesel services only"
available: "Available"
in_operation: "In Operation"
in_service: "In Service"
in_use: "In Use"
public: "Public"
admin_only: "Admin Only"
closed: "Closed"

local getArgs = require( 'Module:Arguments' ).getArgs

--Return a class linked to CSS to set colour of the status element
--Note: When adding a value here, you need to add it to Property:Status too!
--CSS: Module:InfoboxNeue/styles.css
local p = {
	removed = {
		text = "Removed",
		class = "status-red",
		 colour = "red"
	},
	unknown = {
		text = "Unknown",
		class = "status-grey",
		colour = "grey"
	},
	in_development = {
		text = "In-development",
		class = "status-grey",
		colour = "grey"
	},
	under_testing = {
		text = "Undergoing testing",
		class = "status-grey",
		colour = "grey"
	},
	not_in_service = {
		text = "Not in Service",
		class = "status-orange",
		colour = "yellow"
	},
	out_of_service = {
		text = "Out of Service",
		class = "status-orange",
		colour = "yellow"
	},
	steam_only = {
		text = "Steam services only",
		class = "status-orange",
		colour = "yellow"
	},
	diesel_only = {
		text = "Diesel services only",
		class = "status-orange",
		colour = "yellow"
	},
	available = {
		text = "Available",
		class = "status-green",
		colour = "green"
	},
	in_operation = {
		text = "In Operation",
		class = "status-green",
		colour = "green"
	},
	in_service = {
		text = "In Service",
		class = "status-green",
		colour = "green"
	},
	in_use = {
		text = "In Use",
		class = "status-green",
		colour = "green"
	},
	public = {
		text = "Public",
		class = "status-green",
		colour = "green"
	},
	admin_only = {
		text = "Admin Only",
		class = "status-grey",
		colour = "grey"
	},
	closed = {
		text = "Closed",
		class = "status-red",
		colour = "red"
	}
}

function p.get(key)
	local selection = p[key]
	if not selection then
		selection = p.unknown
	end
	return selection.text, selection.class, selection.colour
end

function p.getText(frame)
	local args = getArgs(frame)
    local text, _, _ = p.get(args.status)
    return text
end

function p.getClass(frame)
	local args = getArgs(frame)
    local _, class, _ = p.get(args.status)
    return class
end

function p.getColour(frame)
	local args = getArgs(frame)
    local _, _, colour = p.get(args.status)
    return colour
end

return p
🍪 Yum Yum Yum! Cookies help us better deliver our services. By using our site, you agree to our use of cookies.