45,631
edits
No edit summary |
No edit summary |
||
(60 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
local m_utils = require("Module:utilities") | local m_utils = require("Module:utilities") | ||
local m_data = require('Module:qhv-adj/data') | local m_data = require('Module:qhv-adj/data') | ||
local PAGENAME = mw.title.getCurrentTitle().text | local PAGENAME = gsub(mw.title.getCurrentTitle().text, "%s", " ") | ||
local NAMESPACE = mw.title.getCurrentTitle().nsText | local NAMESPACE = mw.title.getCurrentTitle().nsText | ||
Line 67: | Line 67: | ||
data.head = parent_args["head"] or nil | data.head = parent_args["head"] or nil | ||
data.no_cat = parent_args["nocat"] or parent_args["det"] or nil | |||
-- Generate the forms | -- Generate the forms | ||
Line 74: | Line 75: | ||
m_data[decl_type](args, data) | m_data[decl_type](args, data) | ||
end | end | ||
-- Make the table | -- Make the table | ||
return make_table(data) | return make_table(data) | ||
Line 121: | Line 122: | ||
end | end | ||
local function | local function make_cases(data, pre) | ||
local cases = {"nominative", "accusative", "genitive", "dative", "locative", "instrumental", "comitative", "vocative"} | local cases = {"nominative", "accusative", "genitive", "dative", "locative", "instrumental", "comitative", "vocative"} | ||
local genders = {"lunar", "solar", "terrestrial", "aquatic"} | local genders = data.decl_type == "I" and {"lunar", "solar", "terrestrial", "aquatic"} or {"lunar", "terrestrial"} | ||
local ret = {} | local ret = {} | ||
for _, case in ipairs(cases) do | for _, case in ipairs(cases) do | ||
local case_short = sub(case, 1, 3) | local case_short = sub(case, 1, 3) | ||
table.insert(ret, "|- \n! ! style=\"background-color: #FFB976;\"|" .. case .. "\n") | table.insert(ret, "|- style=\"background-color: #fdfdfd;\" \n! ! style=\"background-color: #FFB976; width:" .. (data.decl_type == "I" and "11.5%" or "16.68%") .. ";\"|" .. case .. "\n") | ||
for _, gender in ipairs(genders) do | for _, gender in ipairs(genders) do | ||
local g_short = sub(gender, 1, 1) | local g_short = sub(gender, 1, 1) | ||
for _, number in ipairs({"sg", "pl"}) do | for _, number in ipairs({"sg", "pl"}) do | ||
table.insert(ret, "| " .. link(show_form(data.forms[case_short .. "_" .. g_short .. "_" .. number])) .. "\n") | table.insert(ret, "| style=\"width:" .. (data.decl_type == "I" and "10.10%" or "20.83%") .. ";\" | " .. link(show_form(data.forms[(pre and "" or "post_") .. case_short .. "_" .. g_short .. "_" .. number])) .. "\n") | ||
end | end | ||
end | end | ||
Line 162: | Line 141: | ||
local divframe = [=[ | local divframe = [=[ | ||
<div class="mw-collapsible" style="border-collapse: collapse; margin: 0px 0px -1px 0px; padding: 2px; text-align: center; border: 1px solid #aaaaaa; font-size: 95%; overflow: auto; width: auto;"> | <div class="mw-collapsible mw-collapsed" style="border-collapse: collapse; margin: 0px 0px -1px 0px; padding: 2px; text-align: center; border: 1px solid #aaaaaa; font-size: 95%; overflow: auto; width: auto;"> | ||
<div style="min-height: 1.6em; font-weight:bold; font-size: 100%; text-align: left; background-color:#efefef; padding-left: 10px; background-image: -webkit-gradient(linear, left top, left bottom, from(#EFEFEF), to(#DFDFDF), color-stop(0.6, #E3E3E3)); background-image: -moz-linear-gradient(top, #EFEFEF, #E3E3E3 60%, #DFDFDF); background-image: -o-linear-gradient(top, #EFEFEF, #E3E3E3 60%, #DFDFDF);"><span class="nowrap">Declension of ''<span lang="qhv">{{{pagename}}}</span>'' ([[:Category:High Valyrian class-{{{decl_type}}} adjectives|class {{{decl_type}}}]])</span></div> | <div style="min-height: 1.6em; font-weight:bold; font-size: 100%; text-align: left; background-color:#efefef; padding-left: 10px; background-image: -webkit-gradient(linear, left top, left bottom, from(#EFEFEF), to(#DFDFDF), color-stop(0.6, #E3E3E3)); background-image: -moz-linear-gradient(top, #EFEFEF, #E3E3E3 60%, #DFDFDF); background-image: -o-linear-gradient(top, #EFEFEF, #E3E3E3 60%, #DFDFDF);"><span class="nowrap">Declension of ''<span lang="qhv">{{{pagename}}}</span>'' ([[:Category:High Valyrian class-{{{decl_type}}} adjectives|class {{{decl_type}}}]])</span></div> | ||
<div class="mw-collapsible-content" style="font-size: 100%;"> | <div class="mw-collapsible-content" style="font-size: 100%;"> | ||
Line 171: | Line 150: | ||
|- style="background-color: #FFB976; text-align:center;" | |- style="background-color: #FFB976; text-align:center;" | ||
! rowspan="2" style="background-color: #E57942;" | Prepositive | ! rowspan="2" style="background-color: #E57942;" | Prepositive | ||
! colspan="2" | lunar | ! colspan="2" | lunar]=] .. (data.decl_type ~= "I" and " and solar" or "") .. (data.decl_type == "I" and "\n! colspan=\"2\" | solar" or "") .. [=[​ | ||
! colspan="2" | terrestrial]=] .. (data.decl_type ~= "I" and " and aquatic" or "") .. (data.decl_type == "I" and "\n! colspan=\"2\" | aquatic" or "") .. [=[​ | |||
! colspan="2" | terrestrial | |||
|- style="background-color: #FFD79B; font-size: 95%" | |- style="background-color: #FFD79B; font-size: 95%" | ||
! ]=] .. g_tooltip("s", "ol") .. [=[​ | ! ]=] .. g_tooltip("s", "ol") .. [=[​ | ||
! ]=] .. g_tooltip("p", "pa") .. [=[​ | ! ]=] .. g_tooltip("p", "pa") .. [=[​ | ||
! ]=] .. g_tooltip("s", "ol") .. [=[​ | ! ]=] .. g_tooltip("s", "ol") .. [=[​ | ||
! ]=] .. g_tooltip("p", "pa") .. [=[​ | ! ]=] .. g_tooltip("p", "pa") .. (data.decl_type ~= "I" and "" or [=[​ | ||
! ]=] .. g_tooltip("s", "ol") .. [=[​ | ! ]=] .. g_tooltip("s", "ol") .. [=[​ | ||
! ]=] .. g_tooltip("p", "pa") .. [=[​ | ! ]=] .. g_tooltip("p", "pa") .. [=[​ | ||
! ]=] .. g_tooltip("s", "ol") .. [=[​ | ! ]=] .. g_tooltip("s", "ol") .. [=[​ | ||
! ]=] .. g_tooltip("p", "pa") .. [=[​ | ! ]=] .. g_tooltip("p", "pa")) .. [=[​ | ||
|- ]=] .. | |- ]=] .. make_cases(data, true) .. [=[ | ||
|}<ul style="margin-left:0px;"></ul> | |}<ul style="margin-left:0px;"></ul> | ||
]=] | ]=] | ||
Line 192: | Line 169: | ||
|- style="background-color: #FFB976; text-align:center;" | |- style="background-color: #FFB976; text-align:center;" | ||
! rowspan="2" style="background-color: #E57942;" | Postpositive | ! rowspan="2" style="background-color: #E57942;" | Postpositive | ||
! colspan="2" | lunar | ! colspan="2" ]=] .. (data.decl_type ~= "I" and "style=\"min-width: 20.83%;\" | lunar and solar" or "| lunar") .. (data.decl_type == "I" and "\n! colspan=\"2\" | solar" or "") .. [=[​ | ||
! colspan="2" ]=] .. (data.decl_type ~= "I" and "style=\"min-width: 20.83%;\" | terrestrial and aquatic" or "| terrestrial") .. (data.decl_type == "I" and "\n! colspan=\"2\" | aquatic" or "") .. [=[​ | |||
! colspan="2" | terrestrial | |||
|- style="background-color: #FFD79B; font-size: 95%" | |- style="background-color: #FFD79B; font-size: 95%" | ||
! ]=] .. g_tooltip("s", "ol") .. [=[​ | ! ]=] .. g_tooltip("s", "ol") .. [=[​ | ||
! ]=] .. g_tooltip("p", "pa") .. [=[​ | ! ]=] .. g_tooltip("p", "pa") .. [=[​ | ||
! ]=] .. g_tooltip("s", "ol") .. [=[​ | ! ]=] .. g_tooltip("s", "ol") .. [=[​ | ||
! ]=] .. g_tooltip("p", "pa") .. [=[​ | ! ]=] .. g_tooltip("p", "pa") .. (data.decl_type ~= "I" and "" or [=[​ | ||
! ]=] .. g_tooltip("s", "ol") .. [=[​ | ! ]=] .. g_tooltip("s", "ol") .. [=[​ | ||
! ]=] .. g_tooltip("p", "pa") .. [=[​ | ! ]=] .. g_tooltip("p", "pa") .. [=[​ | ||
! ]=] .. g_tooltip("s", "ol") .. [=[​ | ! ]=] .. g_tooltip("s", "ol") .. [=[​ | ||
! ]=] .. g_tooltip("p", "pa") .. [=[​ | ! ]=] .. g_tooltip("p", "pa")) .. [=[​ | ||
|- | |- ]=] .. make_cases(data, false) .. [=[ | ||
|} | |} | ||
]=] | ]=] | ||
local wikicode = divframe .. prepositive .. postpositive .. "</div></div>" | local wikicode = divframe .. prepositive .. postpositive .. "</div></div>" | ||
return (gsub(wikicode, "{{{([a-z0-9_]+)}}}", repl)) .. require("Module:utilities").format_categories(data.categories, lang) | return (gsub(wikicode, "{{{([a-z0-9_]+)}}}", repl)) .. (data.no_cat and "" or require("Module:utilities").format_categories(data.categories, lang)) | ||
end | end | ||
return export | return export |