Модуль:Конец анкеты: различия между версиями
Перейти к навигации
Перейти к поиску
StasR (обсуждение | вклад) Нет описания правки |
StasR (обсуждение | вклад) Нет описания правки |
||
Строка 216: | Строка 216: | ||
end | end | ||
if Bio.vip then | if Bio.vip then | ||
table.insert( out, '<p class="nkvd-vip">' ) | table.insert( out, '<p class="nkvd-vip">[[Категория:Депутаты и проч.]]' ) | ||
table.insert( out, tools.phrase(Bio.vip.text .. | table.insert( out, tools.phrase(Bio.vip.text .. | ||
tools.commonParams( Bio.vip.addendum, Bio.vip.reference, Bio.vip.source ) ) ) | tools.commonParams( Bio.vip.addendum, Bio.vip.reference, Bio.vip.source ) ) ) |
Версия от 23:36, 19 января 2017
Для документации этого модуля может быть создана страница Модуль:Конец анкеты/doc
local pp = {}
local global = mw.ext.luaglobal
local tools = require( 'Модуль:Tools' )
global.strict( true )
local coD = mw.loadData( 'Модуль:Анкета/Причины смерти' )
pp[''] = function ( frame )
local out = { '__NOTOC__' }
-- local categories = {}
local tmp
local outChap = {}
local Bio = global.get( 'gBio' ) or {}
local g_0_a, g_sya_as
local photo = global.get( 'g-Фото' )
if photo and photo[1] ~= '-' then
table.insert( out, '[[' .. photo[1] .. '|thumb|x150px]][[Категория:Страницы персоналий с фотоматериалами]]' )
end
tmp = tools.cq( 'unknowns', '_pageName, pattern', {
where = '"' .. mw.title.getCurrentTitle().text .. '" LIKE pattern',
} )
if #tmp ~= 0 then
table.insert( out, '<p class="nkvd-dis-links">Документы, в которых, возможно, упоминается '
.. mw.title.getCurrentTitle().text .. ': ' )
outChap = {}
for _, page in ipairs( tmp ) do
table.insert( outChap, '[[' .. mw.title.new( page._pageName ).fullText .. '|' .. mw.title.new( page._pageName ).text .. ']]' )
end
table.insert( out, table.concat( outChap, ', ') .. '.</p>' )
outChap = {}
end
table.insert( out, '<p class="nkvd-bio">' )
local gender, fioForJournals = require('Модуль:Конец анкеты/ФИО') ( out )
if not gender then
return fioForJournals
end
if gender ~= 2 then
g_0_a = ''
g_sya_as = 'ся'
else
g_0_a = 'а'
g_sya_as = 'ась'
table.insert( out, '[[Категория:Женщины]]' )
end
local gEthn = global.get( 'gEthn' )
if gEthn then
table.insert( out, 'Национальность — ' .. gEthn[1]
.. tools.commonParams( unpack( gEthn, 2, 4 ) ) .. '. ' )
end
local gRod = global.get( 'gBirth' )
local birthDate, birthPlace, family, birthAddendum, reference, source
if gRod then
birthDate, birthPlace, family, birthAddendum, reference, source
= unpack( gRod )
outChap = {}
if birthDate ~= '' or family ~= '' then
outChap[1] = 'Родил' .. g_sya_as
if #birthDate == 10 then
outChap[2] = string.sub( birthDate, 9, 10 ) .. '.'
.. string.sub( birthDate, 6, 7 ) .. '.'
.. string.sub( birthDate, 1, 4 )
elseif #birthDate == 7 then
outChap[2] = 'в ' .. string.sub( birthDate, 6, 7 ) .. '.'
.. string.sub( birthDate, 1, 4 )
elseif #birthDate == 4 then
outChap[2] = 'в ' .. string.sub( birthDate, 1, 4 ) .. ' году'
end
if family ~= '' then
table.insert( outChap, 'в семье ' .. tools.noPhrase( family ) )
end
end
table.insert( out, table.concat( outChap, ' ' ) )
if birthPlace ~= '' then
if #outChap ~= 0 then
outChap = '; место '
else
outChap = 'Место '
end
outChap = outChap .. tools.noPhrase( 'рождения — ' .. birthPlace )
table.insert( out, outChap )
end
table.insert( out, tools.commonParams( birthAddendum, reference, source ) .. '. ' )
else
table.insert( out, 'Информации о дате и месте рождения нет. ' )
end
local gDeath = global.get( 'gDeath' )
local deathDate, deathPlace, deathCause, deathAddendum
if gDeath then
deathDate, deathPlace, deathCause, deathAddendum, reference, source
= unpack( gDeath )
outChap = {}
if deathDate ~= '' then
if #deathDate == 10 then
outChap[1] = string.sub( deathDate, 9, 10 ) .. '.'
.. string.sub( deathDate, 6, 7 ) .. '.'
.. string.sub( deathDate, 1, 4 )
elseif #deathDate == 7 then
outChap[1] = 'в ' .. string.sub( deathDate, 6, 7 ) .. '.'
.. string.sub( deathDate, 1, 4 )
elseif #deathDate == 4 then
outChap[1] = 'в ' .. string.sub( deathDate, 1, 4 ) .. ' году'
end
end
if deathPlace ~= '' then
table.insert( outChap, deathPlace )
end
if deathCause ~= '' then
table.insert( outChap, 'причина смерти — ' .. coD.causeOD[deathCause] )
end
table.insert( out, 'Смерть: ' .. table.concat( outChap, ', ' ) )
table.insert( out, tools.commonParams( deathAddendum, reference, source ) .. '. ' )
else
table.insert( out, 'Информации о смерти нет. ' )
end
table.insert( out, '</p>' )
if Bio.who then
table.insert( out, '<p class="nkvd-bio">')
table.insert( out, tools.phrase ( Bio.who.text
.. tools.commonParams( Bio.who.addendum, Bio.who.reference, Bio.who.source ) )
.. ' ' )
table.insert( out, '</p>')
end
local KPSS, VLKSM, Bund
tmp, KPSS, VLKSM, Bund = require( 'Модуль:Конец анкеты/Партии' ) ()
table.insert( out, tmp )
local gGBage = global.get( 'g-Чекстаж' )
if gGBage then
table.insert( out, '<p class="nkvd-nkvd">' )
outChap = {}
if ( gGBage[1] or '' ) ~= '' then
table.insert( outChap, 'В органах ВЧК−ОГПУ−НКВД с ' .. tools.reparseDate( gGBage[1] )
.. tools.commonParams( gGBage[2], gGBage[3], gGBage[4] ) .. '.')
end
table.insert( out, table.concat( outChap, ' ' ) .. '</p>' )
end
if Bio.repr or Bio.reab then
table.insert( out, '<p class="nkvd-repr">' )
outChap = { '[[Категория:Репрессированные]]Подвергал'.. g_sya_as .. ' репрессиям' }
local double
for _, r in ipairs( { Bio.repr, Bio.repr2 } ) do
if r.arrest ~= '' then
if double then
tmp = 'Повторно арестован' .. g_0_a .. ' '
double = false
else
tmp = 'Арестован' .. g_0_a .. ' '
end
table.insert( outChap, tmp .. tools.reparseDate( r.arrest ) )
end
-- date, court, decision
-- Осужден date (court). Приговор: decision
-- Осужден date. Приговор: decision
-- Приговор (court): decision
-- Орган, вынесший решение: court
if r.date ~= '' then
if double then
tmp = 'Повторно осужден' .. g_0_a .. ' '
double = false
else
tmp = 'Осужден' .. g_0_a .. ' '
end
table.insert( outChap, tmp .. tools.reparseDate( r.date ) )
end
if ( r.court or '' ) ~= '' then
if double then
table.insert( outChap, 'Осужден' .. g_0_a .. ' повторно' )
double = false
end
table.insert( outChap, 'Орган, вынесший решение — ' .. r.court )
end
if ( r.indictment or '' ) ~= '' then
if double then
table.insert( outChap, 'Осужден' .. g_0_a .. ' повторно' )
double = false
end
table.insert( outChap, 'Обвинение — ' .. r.indictment )
end
if ( r.decision or '' ) ~= '' then
if double then
table.insert( outChap, 'Осужден' .. g_0_a .. ' повторно.' )
double = false
end
table.insert( outChap, 'Решение: ' .. r.decision )
end
table.insert( out, table.concat( outChap, '. ' ) ..
tools.commonParams( r.addendum, r.reference, r.source ) .. '. ' )
outChap = {}
double = true
end
local reab = Bio.reab
if reab then
if reab.state == 1 then
outChap = 'Реабилитирован' .. g_0_a
elseif reab.state == -1 then
outChap = 'В реабилитации отказано'
else
outChap = 'Не реабилитирован' .. g_0_a
end
if reab.date ~= '' then
outChap = outChap .. ' ' .. tools.reparseDate( reab.date )
end
table.insert( out, outChap ..
tools.commonParams( reab.addendum, reab.reference, reab.source ) .. '. ' )
end
table.insert( out, '</p>' )
end
if Bio.vip then
table.insert( out, '<p class="nkvd-vip">[[Категория:Депутаты и проч.]]' )
table.insert( out, tools.phrase(Bio.vip.text ..
tools.commonParams( Bio.vip.addendum, Bio.vip.reference, Bio.vip.source ) ) )
table.insert( out, '</p>' )
end
if Bio.info then
table.insert( out, '<p class="nkvd-info">Дополнительную информацию см. ' )
table.insert( out, table.concat( Bio.info, ', ') )
table.insert( out, '.</p>' )
end
fioForJournals = 'person="' .. table.concat( fioForJournals, '" OR person="' )
.. '"'
table.insert( out, require('Module:Отображение упоминаний').display(fioForJournals) )
table.insert( out, '<h2>Прохождение службы</h2>' )
table.insert( out, require('Module:Отображение назначений').display(fioForJournals) )
table.insert( out, '<h2>Звания</h2>' )
table.insert( out, require('Module:Отображение званий').display(fioForJournals) )
table.insert( out, '<h2>Награды</h2>' )
table.insert( out, require('Module:Отображение наград').display(fioForJournals) )
if photo and #photo > 1 then
outChap = { '<h2>Фотоматериалы</h2>[[Категория:Страницы персоналий с фотоматериалами]]<gallery mode="tracitional">' }
for _, v in ipairs( photo ) do
if v ~= '-' then
table.insert( outChap, v )
end
end
table.insert( outChap, '</gallery>' )
table.insert( out, frame:preprocess( table.concat( outChap, '\n' ) ) )
end
gEthn = gEthn or {}
table.insert( out, frame:expandTemplate{ title = 'Таблица персон', args = {
gender = gender,
ethn = gEthn[1],
ethn_addendum = gEthn[2],
b_date = birthDate,
b_place = birthPlace,
b_addendum = birthAddendum,
d_date = deathDate,
d_place = deathPlace,
d_cause = deathCause,
d_addendum = deathAddendum,
difference = Bio.difference,
kp_state = KPSS[1],
kp_cand = KPSS[2],
kp_in = KPSS[3],
kp_out = KPSS[4],
kp_addendum = KPSS[5],
ksm_state = VLKSM[1],
ksm_in = VLKSM[2],
ksm_out = VLKSM[3],
ksm_addendum = VLKSM[4],
bund = Bund[1],
-- bund_addendum = gBund[2],
addendum = '',
} } )
return table.concat( out ) -- mw.dumpObject( out ) --
end
return pp