Modul:Organisation
Ansichten
Aktionen
Namensräume
Varianten
Werkzeuge
Diese Vorlage dient der Erstellung von Infoboxen auf den Organisations-Seiten.
Der Parameter Form entspricht den möglichen Werten der RSI Organisations-Seite. Mögliche Werte sind:
- Unternehmen
- Privates Militärunternehmen
- Religion
- Syndikat
- Organisation
Die Parameter Ausrichtung nehmen jeweils einen der möglichen Ausrichtungswerte der RSI Organisations-Seite an. Mögliche Werte sind:
- Kopfgeldjagd
- Ingenieurwesen
- Erkundung
- Freiberuflich
- Infiltration
- Piraterie
- Rohstoffe
- Aufklärung
- Sicherheit
- Sozial
- Schmuggel
- Handel
- Transport
Der Parameter Verpflichtung nimmt einen der möglichen Verpflichtungswerte der RSI Organisations-Seite an. Mögliche Werte sind:
- Gelegentlich
- Regulär
- Hardcore
Die Parameter Rollenspiel und Exklusiv sind Wahrheitswerte. Sie nehmen nur Eingaben der Form Ja/Nein true/false etc. an. Diese Parameter geben an ob Rollenspiel betrieben wird und/oder ob nur eine exklusive Mitgliedschaft vorgesehen ist.
Der Parameter Sprache enthält die Hauptsprache der Organisation. Beispiel: Deutsch
.
Der Parameter Mitgliederanzahl enthält die gesamte Anzahl an Mitgliedern der Organisation. Beispiel: 10
.
Der Parameter Webseite enthält den Link zur Webseite der Organisation.
Der Parameter Spectrum ID enthält die Organisations-ID von der RSI Organisations-Seite. Beispiel: WIKI
.
Der Parameter Discord enthält einen Einladungslink zu dem entsprechenden Discord-Server. Beispiel: https://discord.gg/Ab12cD
Der Parameter Sonstiges enthält alle sonstigen Informationen zu der Organisation in Stichpunkt-Form.
Wichtig: die Parameter Ausrichtung, Verpflichtung und Form nehmen jeweils die englischen und deutschen Werte an. Somit kommt für die Eingabe beim Parameter Form 'Bounty Hunting' und 'Kopfgeldjagd' immer 'Kopfgeldjagd' heraus.
Wichtig: alle Parameter sollen im Format Format und nicht format geschrieben werden.
Wichtig: diese Vorlage generiert die Infoboxen auf den Organisations-Seiten. Die Parameter dieser Vorlage sollen keinen langen Freitext enthalten. Mögliche Freitexte sollten unterhalb dieser Vorlage im Editor eingefügt werden.
Kopiervorlage[Bearbeiten]
{{Organisation | organisation_type = | orientation_1 = | orientation_2 = | exclusive = | role_play = | member_count = | language = | website = | rsi_handle = | discord = | other = }}
Beispiele[Bearbeiten]
{{Organisation | organisation_type = Corporation | orientation_1 = Social | orientation_2 = Trading | obligation = Regulär | role_play = Ja | exclusive = Ja | language = Deutsch | member_count = 2 | website = | rsi_handle = GENCO }}
local p = {}
local args = require( 'Module:Arguments' )
local yesno = require( 'Module:Yesno' )
local capiunto = require( 'Module:Infobox' )
local common = require( 'Module:Common' )
local data = mw.loadData( 'Module:Organisation/Data' )
local infoBox
local categories = {
'[[Kategorie:Organisation]]',
}
local function getFromData( haystack, needle)
local low = mw.ustring.lower
for key, values in pairs( data[haystack] ) do
if low( needle ) == low( key ) then
return key
else
for k, translation in pairs( values ) do
if low( needle ) == low( translation ) then
return key
end
end
end
end
error( needle .. ' not found in ' .. haystack .. ' Data!', 0 )
end
local function addLogo()
local logo = mw.title.new( 'Organisation ' .. mw.title.getCurrentTitle().subpageText .. '_Logo.png', 6 )
if not logo.exists then
logo = mw.title.new( 'Organisation ' .. mw.title.getCurrentTitle().subpageText .. '_Logo.jpg', 6 )
end
if logo.exists then
infoBox:addImage( '[[' .. logo.prefixedText .. '|center|frameless|x200px|Logo ' .. mw.title.getCurrentTitle().subpageText .. ']]' )
else
table.insert( categories, '[[Kategorie:Organisation mit fehlendem Logo]]' )
end
end
local function addType()
if args.organisation_type then
local type = getFromData( 'types', args.organisation_type )
if type then
infoBox:addRow( 'Form', type )
table.insert( categories, '[[Kategorie:Organisationsform (' .. type .. ')]]' )
end
else
table.insert( categories, '[[Kategorie:Organisation mit fehlender Organisationsform]]' )
end
end
local function addOrientation()
local orientations = {}
if args.orientation_1 == nil and args.orientation_2 == nil then
table.insert( categories, '[[Kategorie:Organisation mit fehlender Ausrichtung]]' )
return nil
end
if args.orientation_1 then
local orientation = getFromData( 'orientations', args.orientation_1 )
if orientation then
table.insert( categories, '[[Kategorie:Organisationsausrichtung (' .. orientation .. ')]]' )
table.insert( orientations, '[[:Kategorie:Organisationsausrichtung (' .. orientation .. ')|' .. orientation .. ']]' )
end
end
if args.orientation_2 then
local orientation = getFromData( 'orientations', args.orientation_2 )
if orientation then
table.insert( categories, '[[Kategorie:Organisationsausrichtung (' .. orientation .. ')]]' )
table.insert( orientations, '[[:Kategorie:Organisationsausrichtung (' .. orientation .. ')|' .. orientation .. ']]' )
end
end
infoBox:addRow( 'Ausrichtung', table.concat( orientations, ', ' ) )
end
local function addMemberCount()
if args.member_count then
infoBox:addRow( 'Mitgliederanzahl', args.member_count )
else
table.insert( categories, '[[Kategorie:Organisation mit fehlender Mitgliederanzahl]]' )
end
end
local function addObligation()
if args.obligation then
local obligation = getFromData( 'obligations', args.obligation )
if obligation then
infoBox:addRow( 'Verpflichtung', obligation )
table.insert( categories, '[[Kategorie:Organisationsverpflichtung (' .. obligation .. ')]]' )
end
else
table.insert( categories, '[[Kategorie:Organisation mit fehlender Verpflichtung]]' )
end
end
local function addRolePlay()
if args.role_play then
local string = 'Nein'
if yesno( args.role_play ) then
string = 'Ja'
table.insert( categories, '[[Kategorie:Organisation (Rollenspiel)]]' )
end
infoBox:addRow( 'Rollenspiel', string )
else
table.insert( categories, '[[Kategorie:Organisation mit fehlender Rollenspielangabe]]' )
end
end
local function addExclusiveMembership()
if args.exclusive then
local string = 'Nein'
if yesno( args.exclusive ) then
string = 'Ja'
table.insert( categories, '[[Kategorie:Organisation (Exklusive Mitgliedschaft)]]' )
end
infoBox:addRow( 'Exklusive Mitgliedschaft', string )
else
table.insert( categories, '[[Kategorie:Organisation mit fehlender Exklusivitätsangabe]]' )
end
end
local function addLanguage()
if args.language then
infoBox:addRow( 'Sprache', args.language )
else
table.insert( categories, '[[Kategorie:Organisation mit fehlender Amtssprache]]' )
end
end
local function addWebsite()
if args.website then
if string.match( args.website, 'http' ) == nil then
error( 'Webseite scheint kein valider Link zu sein', 0 )
return nil
end
infoBox:addRow( 'Webseite', '[' .. args.website .. ' ' .. mw.title.getCurrentTitle().subpageText .. ']' )
mw.smw.set({
Webseite = args.website,
})
end
end
local function addRSI()
if args.rsi_handle then
if string.match( args.rsi_handle, 'http' ) then
error( 'Im Feld Spectrum ID keinen Link angeben', 0 )
else
infoBox:addRow( 'RSI', '[https://robertsspaceindustries.com/orgs/' .. string.upper( args.rsi_handle ) .. ' ' .. string.upper( args.rsi_handle ) .. ' auf RSI]' )
end
end
end
local function addTeamspeak()
if args.teamspeak then
if string.match( args.teamspeak, 'http' ) then
error( 'Teamspeak Adresse scheint nicht valide zu sein', 0 )
else
infoBox:addRow( 'Teamspeak', '[ts3server://' .. args.teamspeak .. ' ' .. args.teamspeak .. ']' )
end
end
end
local function addDiscord()
if args.discord then
if not string.match( args.discord,'discord.gg' ) then
error( 'Discord Einladungslink scheint nicht valide zu sein', 0 )
else
infoBox:addRow( 'Discord', '[' .. args.discord .. ' ' .. mw.title.getCurrentTitle().subpageText .. ']' )
end
end
end
local function addGuilded()
if args.guilded then
if not string.match( args.guilded,'guilded.gg' ) then
error( 'Guilded Link scheint nicht valide zu sein', 0 )
else
infoBox:addRow( 'Guilded', '[' .. args.guilded .. ' ' .. mw.title.getCurrentTitle().subpageText .. ']' )
end
end
end
local function addOther()
if args.other then
infoBox:addRow( 'Sonstiges', args.other )
end
end
function p.infobox( frame )
args = args.getArgs( frame )
local config = {
title = mw.title.getCurrentTitle().subpageText,
bodyClass = 'wikitable orgtable',
bodyStyle = 'width: auto',
}
if args.slogan ~= nil then
config.top = args.slogan
end
infoBox = capiunto.create( config )
addLogo()
addType()
addOrientation()
addMemberCount()
addObligation()
addRolePlay()
addExclusiveMembership()
addLanguage()
addWebsite()
addRSI()
addTeamspeak()
addDiscord()
addGuilded()
addOther()
infoBox.addRowsFromArgs( args, '!' )
common.setDisplayTitle( frame, mw.title.getCurrentTitle().subpageText )
return tostring( infoBox ) .. table.concat( categories )
end
return p