|
|
| Zeile 16: |
Zeile 16: |
| t = t .. "<dd>[[Spezial:Durchsuchen/" .. fbdata.fullpagename .. "|Semantisches Browsen]]</dd>" | | t = t .. "<dd>[[Spezial:Durchsuchen/" .. fbdata.fullpagename .. "|Semantisches Browsen]]</dd>" |
| t = t .. "</dl>" | | t = t .. "</dl>" |
| -- mw.log("t = " .. t)
| |
| return t
| |
| end
| |
|
| |
| function p.common_(fbdata)
| |
| -- mw.log("common_(fbdata)")
| |
| -- mw.logObject(fbdata)
| |
| -- Konsolenzeile zum Debuggen:
| |
| -- =p.common_{formular="Gebäude/Work",klasse={"Gebäude","Kirche"},kategorie={"Gebäude","Kirchen"},strasse_hnr={suspekt=true},positionscheck=true,pargs={Bild="Angie Oeckl.JPG",Ehemals="Ja",DenkmalstatusBesteht="Ja",Stadtteil="Ronhof; Nordstadt ",location="bla"},pagename="Test/Test;Test"}
| |
| local t = ""
| |
| -- Klasse
| |
| if fbdata.klasse ~= nil then
| |
| t = t .. "{{#set:KlassenName=" .. fbdata.klasse[1] .. "}}"
| |
| end
| |
| -- Formular
| |
| if fbdata.formular ~= nil then
| |
| t = t .. "{{#default_form:" .. fbdata.formular .. "}}"
| |
| end
| |
| -- Kategorien
| |
| local ehemals_text = ""
| |
| if com.isTrue(fbdata.pargs["Ehemals"]) then
| |
| ehemals_text = " (ehemals)"
| |
| end
| |
| if fbdata.kategorie ~= nil then
| |
| for _, k in ipairs(fbdata.kategorie) do
| |
| t = t .. "[[Kategorie:" .. k .. ehemals_text .. "]]"
| |
| end
| |
| end
| |
| if com.isTrue(fbdata.pargs["DenkmalstatusBesteht"]) then
| |
| t = t .. "[[Kategorie:Denkmalliste]]"
| |
| end
| |
| local stadtteil = str.splitAndStrip(fbdata.pargs["Stadtteil"] or "", ";")
| |
| for _, s in ipairs(stadtteil) do
| |
| s = str.strip(tostring(s or ""))
| |
| t = t .. "[[Kategorie:" .. s .. "]]"
| |
| end
| |
| -- Wartungs-Kategorien
| |
| if (fbdata.pargs["Bild"] or "") == "" then
| |
| if fbdata.kategorie ~= nil then
| |
| t = t .. "[[Kategorie:" .. fbdata.kategorie[1] .. " ohne Bild]]"
| |
| else
| |
| t = t .. "[[Kategorie:Ohne Bild]]"
| |
| end
| |
| elseif not wik.pageexists("Bild:" .. fbdata.pargs["Bild"]) then
| |
| t = t .. "[[Kategorie:Bild nicht gefunden]]"
| |
| end
| |
| if string.find(fbdata.pagename, ";") ~= nil then
| |
| t = t .. "[[Kategorie:Hat Semikolon]]"
| |
| end
| |
| if string.find(fbdata.pagename, "/") ~= nil then
| |
| t = t .. "[[Kategorie:Hat Slash]]"
| |
| end
| |
| if fbdata.strasse_hnr ~= nil then
| |
| if fbdata.strasse_hnr.suspekt then
| |
| t = t .. "[[Kategorie:Gebäude mit verdächtiger Straße-Hausnummer-Kombination]]"
| |
| end
| |
| end
| |
| if fbdata.positionscheck and fbdata.kategorie ~= nil and
| |
| not ((fbdata.pargs["lat"] or "") ~= "" or (fbdata.pargs["lon"] or "") ~= "" or
| |
| (fbdata.pargs["location"] or "") ~= "" or wik.pageexists("GeoJson:" .. (fbdata.pargs["geojson"] or fbdata.pagename))) then
| |
| t = t .. "[[Kategorie:" .. fbdata.kategorie[1] .. ehemals_text .. " ohne Position]]"
| |
| end
| |
| -- mw.log("t = " .. t) | | -- mw.log("t = " .. t) |
| return t | | return t |