יחידה:תבנית מידע/אישיות: הבדלים בין גרסאות בדף
יצירת דף עם התוכן "local Infobox = require('Module:תבנית מידע').Infobox local LocationAndCountry = require('Module:LocationAndCountry') local PropertyLink = require('Modul..." |
מ 9 גרסאות של הדף wikipedia:he:יחידה:תבנית_מידע/אישיות יובאו |
||
| (19 גרסאות ביניים של 5 משתמשים אינן מוצגות) | |||
| שורה 33: | שורה 33: | ||
end | end | ||
if deathCause and deathCause ~= '' then | if deathCause and deathCause ~= '' then | ||
if deathCause == 'נהרג' or deathCause == 'נהרגה' or deathCause == 'מוות בקרב' or deathCause == 'נהרג בקרב' or deathCause == 'נהרגה בקרב' or deathCause == 'תאונה' then | if deathCause == 'נהרג' or deathCause == 'נהרגה' or deathCause == 'מוות בקרב' or deathCause == 'נהרג בקרב' or deathCause == 'נהרגה בקרב' or deathCause == 'תאונה' or deathCause == 'טביעה' then | ||
return (gender=='נקבה' and 'נהרגה') or 'נהרג' | return (gender=='נקבה' and 'נהרגה') or 'נהרג' | ||
elseif deathCause == 'נרצח' or deathCause == 'נרצחה' or deathCause == 'רצח' or deathCause == 'רעל' then | elseif deathCause == 'נעדר' or deathCause == 'נעדרת' then | ||
return (gender=='נקבה' and 'נעדרת') or 'נעדר' | |||
elseif deathCause == 'נרצח' or deathCause == 'נרצחה' or deathCause == 'רצח' or deathCause == 'רצח המוני' or deathCause == 'רעל' then | |||
return (gender=='נקבה' and 'נרצחה') or 'נרצח' | return (gender=='נקבה' and 'נרצחה') or 'נרצח' | ||
elseif deathCause == 'התאבד' or deathCause == 'התאבדה' or deathCause == 'התאבדות' then | elseif deathCause == 'התאבד' or deathCause == 'התאבדה' or deathCause == 'התאבדות' then | ||
| שורה 106: | שורה 105: | ||
local frame = mw.getCurrentFrame() | local frame = mw.getCurrentFrame() | ||
infoObj.args.image = frame:expandTemplate{ title = 'אין תמונה', args = { gender, ['יישור'] = ' | infoObj.args.image = frame:expandTemplate{ title = 'אין תמונה', args = { gender, ['יישור'] = 'מרכז' } } | ||
end | end | ||
| שורה 174: | שורה 173: | ||
local wikidataGender = nil | local wikidataGender = nil | ||
if not infoObj.isNonPerson then | if not infoObj.isNonPerson then | ||
wikidataGender = PropertyLink. | wikidataGender = PropertyLink.getItem( 'P21', infoObj.args.entityId ) | ||
if wikidataGender == nil then | if wikidataGender == nil then | ||
table.insert(infoObj.wikidataCats, '[[קטגוריה:אישים חסרי מגדר בוויקינתונים]]') | table.insert(infoObj.wikidataCats, '[[קטגוריה:אישים חסרי מגדר בוויקינתונים]]') | ||
else | |||
if (wikidataGender == "Q6581097") then -- male | |||
wikidataGender = 'זכר' | |||
elseif (wikidataGender == "Q2449503") then -- transgender male | |||
wikidataGender = 'זכר' | |||
elseif (wikidataGender == "Q15145778") then -- cisgender male | |||
wikidataGender = 'זכר' | |||
elseif (wikidataGender == "Q6581072") then -- female | |||
wikidataGender = 'נקבה' | |||
elseif (wikidataGender == "Q1052281") then -- transgender female | |||
wikidataGender = 'נקבה' | |||
elseif (wikidataGender == "Q15145779") then -- cisgender female | |||
wikidataGender = 'נקבה' | |||
elseif wikidataGender == 'Q1097630' -- intersex | |||
or wikidataGender == 'Q48270' -- non binary | |||
then wikidataGender = '' -- עד שתחליטו | |||
end | |||
end | end | ||
end | end | ||
-- fill birth/death dates from wikidata is | -- fill birth/death dates from wikidata if missing and the person is not a human biblical figure | ||
usingBirthWikidata = fillWikidataParam(templateArgs, 'תאריך לידה', 'P569', infoObj) | if PropertyLink.getItem( 'P31', infoObj.args.entityId )~="Q20643955" then | ||
usingBirthWikidata = fillWikidataParam(templateArgs, 'תאריך לידה', 'P569', infoObj) | |||
usingDeathWikidata = fillWikidataParam(templateArgs, 'תאריך פטירה', 'P570', infoObj) | |||
end | |||
local birthDate = getSpeculativeDate(templateArgs['תאריך לידה'], templateArgs['תאריך לידה עברי']) | local birthDate = getSpeculativeDate(templateArgs['תאריך לידה'], templateArgs['תאריך לידה עברי']) | ||
| שורה 189: | שורה 207: | ||
local age = nil | local age = nil | ||
if deathDate==nil then | if deathDate==nil then | ||
age = ageModule.ageCalc(birthDate, nil, true, false, true) or '' | age = ageModule.ageCalc(birthDate, nil, true, false, true, nil, wikidataGender) or '' | ||
end | end | ||
local birthDetails, usingBirthWikidataEvent = getEventDetails(templateArgs['תאריך לידה'], templateArgs['תאריך לידה עברי'], templateArgs['מקום לידה'], 'P569', 'P19', age, usingBirthWikidata, infoObj) | local birthDetails, usingBirthWikidataEvent = getEventDetails(templateArgs['תאריך לידה'], templateArgs['תאריך לידה עברי'], templateArgs['מקום לידה'], 'P569', 'P19', age, usingBirthWikidata, infoObj) | ||
table.insert(infoObj.templateStructure, 1, { | table.insert(infoObj.templateStructure, 1, { | ||
label= | label=birthLabel, | ||
data=birthDetails | data=birthDetails | ||
}) | }) | ||
| שורה 199: | שורה 217: | ||
elseif templateArgs['מקום לידה']~= '-' then | elseif templateArgs['מקום לידה']~= '-' then | ||
fillWikidataParam(templateArgs, 'מקום לידה', 'P19', infoObj) | fillWikidataParam(templateArgs, 'מקום לידה', 'P19', infoObj) | ||
table.insert(infoObj.templateStructure, 1, { | if templateArgs['מקום לידה']~= nil and templateArgs['מקום לידה']~= '' then -- only if we fill the parameter eventually - add to template | ||
table.insert(infoObj.templateStructure, 1, { | |||
label=birthLabel, | |||
data= templateArgs['מקום לידה'] | |||
}) | |||
end | |||
end | end | ||
deathLabel = getDeathLabel(templateArgs['סיבת המוות'], infoObj.args.entityId, wikidataGender) | deathLabel = getDeathLabel(templateArgs['סיבת המוות'], infoObj.args.entityId, wikidataGender) | ||
if deathDate~=nil then | if deathDate~=nil then | ||
| שורה 216: | שורה 236: | ||
elseif templateArgs['מקום פטירה']~= '-' then | elseif templateArgs['מקום פטירה']~= '-' then | ||
fillWikidataParam(templateArgs, 'מקום פטירה', 'P20', infoObj) | fillWikidataParam(templateArgs, 'מקום פטירה', 'P20', infoObj) | ||
table.insert(infoObj.templateStructure, 2, { | if templateArgs['מקום פטירה']~= nil and templateArgs['מקום פטירה']~= '' then -- only if we fill the parameter eventually - add to template | ||
table.insert(infoObj.templateStructure, 2, { | |||
label=deathLabel, | |||
data= templateArgs['מקום פטירה'] | |||
}) | |||
end | |||
end | end | ||