45,333
edits
No edit summary |
No edit summary |
||
Line 69: | Line 69: | ||
data.proper = parent_args["proper"] and true or false | data.proper = parent_args["proper"] and true or false | ||
data.nocat = parent_args["nocat"] and true or false | data.nocat = parent_args["nocat"] and true or false | ||
data.nopl = parent_args["nopl"] and true or false | |||
-- Generate the forms | -- Generate the forms | ||
Line 112: | Line 113: | ||
return data.forms.nom_sg[1] | return data.forms.nom_sg[1] | ||
elseif param == "pagename" and NAMESPACE == "Template" then | elseif param == "pagename" and NAMESPACE == "Template" then | ||
return " | return "mazer" | ||
elseif param == "pagename" then | elseif param == "pagename" then | ||
return PAGENAME | return PAGENAME | ||
Line 121: | Line 122: | ||
local function make_cases(data) | local function make_cases(data) | ||
local cases = {" | local cases = {"direct", "dative", "locative"} | ||
local ret = {} | local ret = {} | ||
for _, case in ipairs(cases) do | for _, case in ipairs(cases) do | ||
local case_short = sub(case, 1, | local case_short = sub(case, 1, 2) | ||
table.insert(ret, "|- \n! style=\"background-color: #dcffed;\ |" .. case .. "\n") | table.insert(ret, "|- \n! style=\"background-color: #dcffed;\ |" .. case .. "\n") | ||
table.insert(ret, "| style=\"background-color: #edfff6;\" | " .. link(show_form(data.forms[case_short .. " | table.insert(ret, "| style=\"background-color: #edfff6;\" | " .. link(show_form(data.forms[case_short .. "_s"])) .. "\n") | ||
table.insert(ret, "| style=\"background-color: #edfff6;\" | " .. link(show_form(data.forms[case_short .. "_p"])) .. "\n") | |||
end | end | ||
return table.concat(ret) | return table.concat(ret) | ||
end | end | ||
local no_plural = data.forms.nom_pl == nil | local no_plural = data.nopl or data.forms.nom_pl == nil | ||
local wikicode = [=[ | local wikicode = [=[ | ||
Line 143: | Line 140: | ||
{| class="]=] .. (no_plural and "" or "mw-collapsible") .. [=[" style="background: #edfff6; border: 1px solid #d0d0d0; text-align: left;" cellspacing="1" cellpadding="2" | {| class="]=] .. (no_plural and "" or "mw-collapsible") .. [=[" style="background: #edfff6; border: 1px solid #d0d0d0; text-align: left;" cellspacing="1" cellpadding="2" | ||
|- | |- | ||
|+ style="font-weight: bold; ]=] .. (no_plural and "" or "min-width: 27em") .. [=[" colspan="]=] .. (no_plural and " | |+ style="font-weight: bold; ]=] .. (no_plural and "" or "min-width: 27em") .. [=[" colspan="]=] .. (no_plural and "1" or "2") .. [=[" | <span class="nowrap">Declension of ''<span lang="cel-gal">{{{pagename}}}</span>'' ]=] .. (no_plural and "<br>" or "") .. [=[(<small>{{{decl_type}}}</small>)</span> | ||
|- | |- | ||
! style="min-width: 8em; background-color: #acf4cf" | | ! style="min-width: 8em; background-color: #acf4cf" | | ||
Line 149: | Line 146: | ||
! style="min-width: 8em; background-color: #acf4cf" | Plural | ! style="min-width: 8em; background-color: #acf4cf" | Plural | ||
]=]) .. make_cases(data) .. [=[ | ]=]) .. make_cases(data) .. [=[ | ||
|}]=] | |}]=] |