Modul:Datei: Unterschied zwischen den Versionen

+ BeschreibungsMaxWortlänge
K (Entfernte den Schutz von „Modul:Datei“)
(+ BeschreibungsMaxWortlänge)
Zeile 1: Zeile 1:
local p = {}
local p = {}
local c = require("Module:Common")
 
local com = require("Module:Common")
local str = require("Module:String")


function p.daten(frame, args)
function p.daten(frame, args)
Zeile 11: Zeile 13:
'<th colspan="4">' .. title .. '</th>'
'<th colspan="4">' .. title .. '</th>'
if not c.isEmpty(args.Genre) then
if not com.isEmpty(args.Genre) then
t = t .. '<tr>'..
t = t .. '<tr>'..
'<td>[[Attribut:Genre|Genre]]</td>' ..
'<td>[[Attribut:Genre|Genre]]</td>' ..
Zeile 23: Zeile 25:
a = 'Attribut'..i
a = 'Attribut'..i
w = 'Wert'..i
w = 'Wert'..i
if not c.isEmpty(args[a]) then
if not com.isEmpty(args[a]) then
if not c.isEmpty(args[w]) then
if not com.isEmpty(args[w]) then
t=t..'<tr>'..
t=t..'<tr>'..
'<td>[[Attribut:'..args[a]..'|'..args[a]..']]</td>'..
'<td>[[Attribut:'..args[a]..'|'..args[a]..']]</td>'..
Zeile 42: Zeile 44:
end
end
if not c.isEmpty(args.Urheber) then
if not com.isEmpty(args.Urheber) then
t = t .. '<tr>'..
t = t .. '<tr>'..
'<td>[[Attribut:Urheber|Urheber]]</td>' ..
'<td>[[Attribut:Urheber|Urheber]]</td>' ..
Zeile 51: Zeile 53:
end
end
if not c.isEmpty(args.Quellangaben) then
if not com.isEmpty(args.Quellangaben) then
t = t .. '<tr>'..
t = t .. '<tr>'..
    '<td>[[Attribut:Quellangaben|Quellangaben]]</td>'..
    '<td>[[Attribut:Quellangaben|Quellangaben]]</td>'..
Zeile 58: Zeile 60:
end
end
if not c.isEmpty(args.Ort) then
if not com.isEmpty(args.Ort) then
t = t .. '<tr>'..
t = t .. '<tr>'..
'<td>[[Attribut:Ort|Ort]]</td>'..
'<td>[[Attribut:Ort|Ort]]</td>'..
Zeile 65: Zeile 67:
'<td><b>ausblenden:</b></td>'
'<td><b>ausblenden:</b></td>'
z = '<td>[[ZeigeNichtInOrt::Nein]]</td>'
z = '<td>[[ZeigeNichtInOrt::Nein]]</td>'
if not c.isEmpty(args.ZeigeNichtInOrt) then
if not com.isEmpty(args.ZeigeNichtInOrt) then
z = '<td>[[ZeigeNichtInOrt::'..args.ZeigeNichtInOrt..']]</td>'
z = '<td>[[ZeigeNichtInOrt::'..args.ZeigeNichtInOrt..']]</td>'
end
end
Zeile 71: Zeile 73:
end
end
if not c.isEmpty(args['Straße']) then
if not com.isEmpty(args['Straße']) then
t = t .. '<tr>' ..
t = t .. '<tr>' ..
'<td>[[Attribut:Straße|Straße]]</td>' ..
'<td>[[Attribut:Straße|Straße]]</td>' ..
Zeile 79: Zeile 81:
'<td><b>ausblenden:</b></td>'
'<td><b>ausblenden:</b></td>'
z = '<td>[[ZeigeNichtInStraße::Nein]]</td>'
z = '<td>[[ZeigeNichtInStraße::Nein]]</td>'
if not c.isEmpty(args['ZeigeNichtInStraße']) then
if not com.isEmpty(args['ZeigeNichtInStraße']) then
z = '<td>[[ZeigeNichtInStraße::'..args['ZeigeNichtInStraße']..']]</td>'
z = '<td>[[ZeigeNichtInStraße::'..args['ZeigeNichtInStraße']..']]</td>'
end
end
Zeile 85: Zeile 87:
end
end
if not c.isEmpty(extension) then
if not com.isEmpty(extension) then
t=t..'<tr>'..
t=t..'<tr>'..
'<td>[[Attribut:Dateiart|Dateiart]]</td>'..
'<td>[[Attribut:Dateiart|Dateiart]]</td>'..
Zeile 94: Zeile 96:
end  
end  
if not c.isEmpty(args.Erstellungsdatum) then
if not com.isEmpty(args.Erstellungsdatum) then
t = t .. '<tr>' ..
t = t .. '<tr>' ..
'<td>[[Attribut:Erstellungsdatum|Erstellungsdatum]]</td>' ..
'<td>[[Attribut:Erstellungsdatum|Erstellungsdatum]]</td>' ..
Zeile 105: Zeile 107:
end
end
if not c.isEmpty(args['ÜberDatum']) then
if not com.isEmpty(args['ÜberDatum']) then
t=t..'<tr>'..
t=t..'<tr>'..
'<td>[[Attribut:ÜberDatum|Über Datum]]</td>'..
'<td>[[Attribut:ÜberDatum|Über Datum]]</td>'..
Zeile 116: Zeile 118:
end
end
if not c.isEmpty(args.Seitennummer) then
if not com.isEmpty(args.Seitennummer) then
t=t..'<tr>'..
t=t..'<tr>'..
'<td>[[Attribut:Seitennummer|Seitennummer]]</td>'..
'<td>[[Attribut:Seitennummer|Seitennummer]]</td>'..
Zeile 124: Zeile 126:
end
end
if not c.isEmpty(args.Signatur) then
if not com.isEmpty(args.Signatur) then
t=t..'<tr>'..
t=t..'<tr>'..
'<td>[[Attribut:Signatur|Signatur]]</td>'..
'<td>[[Attribut:Signatur|Signatur]]</td>'..
Zeile 131: Zeile 133:
end
end
if not c.isEmpty(args['Länge']) then
if not com.isEmpty(args['Länge']) then
t=t..'<tr>'..
t=t..'<tr>'..
'<td>[[Attribut:Länge|Länge]]</td>'..
'<td>[[Attribut:Länge|Länge]]</td>'..
Zeile 138: Zeile 140:
end
end


if not c.isEmpty(args.Lizenz) then
if not com.isEmpty(args.Lizenz) then
t=t..'<tr>'..
t=t..'<tr>'..
'<td>[[Attribut:Lizenz|Lizenz]]</td>'..
'<td>[[Attribut:Lizenz|Lizenz]]</td>'..
Zeile 145: Zeile 147:
end
end
if not c.isEmpty(args.UploadCommons) then
if not com.isEmpty(args.UploadCommons) then
t=t..'<tr>'..
t=t..'<tr>'..
'<td>[[Attribut:UploadCommons|Upload zu Commons]]</td>'..
'<td>[[Attribut:UploadCommons|Upload zu Commons]]</td>'..
Zeile 152: Zeile 154:
end
end


if not c.isEmpty(args.Beschreibung) then
if not com.isEmpty(args.Beschreibung) then
t=t..'<tr>'..
t=t..'<tr>'..
'<td>[[Attribut:Beschreibung|Beschreibung]]</td>'..
'<td>[[Attribut:Beschreibung|Beschreibung]]</td>'..
'<td colspan="3">[[Beschreibung::' ..args.Beschreibung .. ']]</td>'..
'<td colspan="3">[[Beschreibung::' ..args.Beschreibung .. ']]</td>'..
'</tr>'
'</tr>'
mw.smw.set{["Beschreibungslänge"]=string.len(args.Beschreibung)}
mw.smw.set{["Beschreibungslänge"] = string.len(args.Beschreibung)}
mw.smw.set{["BeschreibungsMaxWortlänge"] = str.maxWordLen(args.Beschreibung)}
end
end