Module:qhv-adj: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with "local sub = mw.ustring.sub local gsub = mw.ustring.gsub local find = mw.ustring.find local gmatch = mw.ustring.gmatch local u = mw.ustring.char local m_utils = require("Modul...")
 
No edit summary
Line 132: Line 132:
end
end


local function make_cases(data)
local function make_cases(data, post)
local cases = {"nominative", "accusative", "genitive", "dative", "locative", "instrumental", "comitative", "vocative"}
local cases = {"nominative", "accusative", "genitive", "dative", "locative", "instrumental", "comitative", "vocative"}
local ret = {}
local ret = {}
Line 148: Line 148:
return table.concat(ret)
return table.concat(ret)
end
end
local no_plural = pass.forms.nom_pl == nil


local wikicode = [=[
local wikicode = [=[
{| class="]=] .. (no_plural and "" or "mw-collapsible")  .. [=[" style="background: #edfff6; border: 1px solid #d0d0d0; text-align: left;" cellspacing="1" cellpadding="2"
<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 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>
|+ style="font-weight: bold; ]=] .. (no_plural and "" or "min-width: 27em".. [=[" colspan="]=] .. (no_plural and "3" or "6") .. [=[" | <span class="nowrap">Declension of ''<span lang="qhv">{{{pagename}}}</span>'' ]=] .. (no_plural and "<br>" or "")  .. [=[(<small>{{{decl_type}}}</small>)</span>
<div class="mw-collapsible-content" style="font-size: 100%;">
|-
{| border="1px solid #000000" style="border-collapse: collapse; width:100%; text-align:center; background-color:#fdfdfd; cellspacing="1" cellpadding="2"
! style="min-width: 8em; background-color: #acf4cf" |  
|- style="background-color: #FFB976; text-align:center;"
! style="min-width: 8em; background-color: #acf4cf" | Singular]=] .. (no_plural and "\n" or [=[
! rowspan="2" style="background-color: #E57942;" | Prepositive
 
! colspan="2" | lunar
! style="min-width: 8em; background-color: #acf4cf" | Plural
! colspan="2" | solar
! style="min-width: 8em; background-color: #acf4cf" | Paucal
! colspan="2" | terrestrial
! style="min-width: 8em; background-color: #acf4cf" | Collective
! colspan="2" | aquatic
]=]) .. make_cases(pass) .. [=[
|- style="background-color: #FFD79B; font-size: 95%"
|}]=]
! {{#invoke:getn|show_list|s|ol}}
! {{#invoke:getn|show_list|p|pa}}
! {{#invoke:getn|show_list|s|ol}}
! {{#invoke:getn|show_list|p|pa}}
! {{#invoke:getn|show_list|s|ol}}
! {{#invoke:getn|show_list|p|pa}}
! {{#invoke:getn|show_list|s|ol}}
! {{#invoke:getn|show_list|p|pa}}
|- ]=] .. make_cases(data, false) .. [=[
|}<ul style="margin-left:0px;"></ul>
{| border="1px solid white" style="border-collapse: collapse; background:#ffffff; width:100%; text-align:center;" cellspacing="1" cellpadding="2"
|- style="background-color: #FFB976; text-align:center;"
! rowspan="2" style="background-color: #E57942;" | Prepositive
! colspan="2" | lunar
! colspan="2" | solar
! colspan="2" | terrestrial
! colspan="2" | aquatic
|- style="background-color: #FFD79B; font-size: 95%"
! {{#invoke:getn|show_list|s|ol}}
! {{#invoke:getn|show_list|p|pa}}
! {{#invoke:getn|show_list|s|ol}}
! {{#invoke:getn|show_list|p|pa}}
! {{#invoke:getn|show_list|s|ol}}
! {{#invoke:getn|show_list|p|pa}}
! {{#invoke:getn|show_list|s|ol}}
! {{#invoke:getn|show_list|p|pa}}
|- style="background-color:#fdfdfd;" ]=] .. make_cases(data, true) .. [=[
|}</div></div>]=]


return (gsub(wikicode, "{{{([a-z0-9_]+)}}}", repl)) .. require("Module:utilities").format_categories(pass.categories, lang)
return (gsub(wikicode, "{{{([a-z0-9_]+)}}}", repl)) .. require("Module:utilities").format_categories(pass.categories, lang)

Navigation menu