Zeile 18: |
Zeile 18: |
| local ntitle = mw.title.getCurrentTitle().text | | local ntitle = mw.title.getCurrentTitle().text |
| local queryResult = mw.smw.ask('[[Ausrüstungskategorie::'..ntitle..'|?=#|limit=1999') | | local queryResult = mw.smw.ask('[[Ausrüstungskategorie::'..ntitle..'|?=#|limit=1999') |
− | returnString = '<table class="wikitable sortable oben" ><tr><th>Ausrüstung</th><th>Gehört Zu..</th><th>Preis (Lunare)</th><th>Quellen</th></tr>' | + | returnString = '<table class="wikitable sortable oben" ><tr><th>Ausrüstung</th><th>Preis (Lunare)</th><th>Quellen</th></tr>' |
| | | |
| local i = 1 | | local i = 1 |
Zeile 31: |
Zeile 31: |
| end | | end |
| returnString = returnString .. '<td>' | | returnString = returnString .. '<td>' |
− | -- Bild | + | --Preis |
− | if basistypArtikelinfo[1]['Profilbild'] ~= nil | + | if basistypArtikelinfo[1]['Preis'] ~= nil |
| then | | then |
− | -- Vorlage:Vorschaubild.Kreis ggf. als eigene Funktion auslagern wenn öfter notwendig
| + | returnString = returnString .. '<tr>' -- neue tabellen reihe |
− | returnString = returnString .. '<div style="width: 64px; height: 64px; border-radius: 64px; -webkit-border-radius: 640px; -moz-border-radius: 64px; overflow:hidden; float:right; background:lightgray; ">' | + | returnString = returnString ..'<td>[[' .. queryResult[i][1] .. ']] (' .. basistypArtikelinfo[1]['Preis'] ..')</td>' |
− | returnString = returnString ..'[[Datei:'..basistypArtikelinfo[1]['Profilbild'] .. '|90x90px|verweis='.. queryResult[i][1] ..']]</div>' | |
| end | | end |
− | --GehoertZu | + | returnString = returnString .. '<td>' |
− | if basistypArtikelinfo[1]['GehörtZu'] ~= nil
| + | |
− | then
| |
− | --Wenn table loop über die GehörtZu angaben
| |
− | if (type(basistypArtikelinfo[1]['GehörtZu']) == "table")
| |
− | then
| |
− | n = 1
| |
− | while n <= table.getn(basistypArtikelinfo[1]['GehörtZu'])
| |
− | do
| |
− | returnString = returnString .. basistypArtikelinfo[1]['GehörtZu'][n]
| |
− | if n < table.getn(basistypArtikelinfo[1]['GehörtZu'])
| |
− | then
| |
− | returnString = returnString ..", "
| |
− | end
| |
− | n = n + 1
| |
− | end
| |
− | else -- nur ein GehoertZu und damit keine tabelle sondern ein string
| |
− | returnString = returnString .. basistypArtikelinfo[1]['GehörtZu']
| |
− | end
| |
− | end
| |
− | returnString = returnString .. '</td>' | |
| i = i +1 | | i = i +1 |
| end | | end |