FANDOM


The Governor-General is the official head of government and head of state of all the Commonwealth States in Germany, which include Bavaria, Austria, Venezia, Saxony, Swabia, Brandenburg, and Pomerania. The current office can be traced to that of the President, a predecessor established in the eighteenth century following civil war, and disestablished following a revolution. The nineteenth century form of the Chancellery was established in the late 1790s, and continued to be an office primarily centered around the legislature. Once the monarchy was abolished and the Chancellery went with it, the modern executive office of the Governor-General was established.

BackgroundEdit

The office of President was established in 1775 after a long period of war and instability in the Kingdom of Bavaria. A combination of the Spanish War, Austrian Revolt, and the invasion of Frederick von Croÿ-Habsburg brought the country to its knees, and brought out a fear and anger Bavarians have never seen before. Increasing amounts of Austrian-Bavarian tension, brewing since the 1650s, also caused turmoil in the country. These tensions created an admittedly incompetent Deutsche Diet, itself a new, untested institution, and caused many people to lose faith in the fractured legislature. It is only in 1768 that the modern Deutsche Diet came into play and the notion of a parliamentary leader was entertained. The Crown-Union of Germany was founded in 1769 and essentially federalized Bavaria and all of its realms, removing Bavarian suzerainty and making a national legislature even more important than ever before.

Now swolen with Austrian, Bavarian, Italian, Saxon, Brandenburger, and Pomeranian politicians, the Diet was in need of a leader-type figure. No one wanted a reprise of the abandonment and desolation that plagued the Diet in 1759, so various parliamentarians grouped together and agreed that a single figure leading and supporting the parliament is required to keep it running, and thus, keep Bavaria a healthy, impervious nation of prosperity and peace.

Working over the course of four years, from 1771 to 1775, the Deutsche Diet developed the position of the Präsident and installed measures regulating the office in an effort to avoid a tyranny. Similarly, the parliamentarians hoped to craft an influential, stable position that would give coherence and power to the Diet.

The first elections were held on March 20, and the Leipzig-native Gregory Hartingen was elected as the first President of the Deutsche Diet.

Despite its enthusiastic creation, the office of the President was ultimately abolished in 1790 after violent uprisings tore Bavaria apart. The first and only President, Gregory Hartingen, was kidnapped by extremists and later killed. From 1790 to 1796, the office was vacant, with de jure parliamentary leadership being exercised by Queen Mary I. However, after legislative and executive reforms, the office was re-established as the Chancellery (led by a Chancellor) in 1796.

The Chancellery then led a relatively peaceful, democratic period in Bavaria's history. The country itself was federalized and largely democratized since the office's first creation in the mid-eighteenth century. From approximately 1800 to 1879, the Chancellor oversaw legislative peace, a break from the war-torn years of yore. The country was indeed in peace, but wage inequality and industrialization created cracks in the otherwise prosperous consensus. By the 1860s, popular opinion was hugely against things such as manufacturing, automation, industrialization, wage abuse, and worker treatment. As it became clear neither the Chancellor nor the Diet could do anything about these demographic and social ills, both were dissolved by King Franz-Victor in 1876.

Once the ensuing Revolution died down towards the late 1880s and 1890s, the office of the Chancellor once more presided over a peaceable time in Bavaria. After the abolition of the monarchy in 1879, the office of the Chancellor shifted from legislative leader to executive commander, filling the gap left by an absent King.

The most recent manifestation of the office of Chancellor is that of Governor-General, who is executive commander of all Commonwealth States, of which corresponds to all Bavarian territory prior to German Unification.

List of PräsidentsEdit

  • Gregory Hartingen (1775 - 1790)
    • ​Born in 1726, Leipzig, Bavaria
    • Monarch: Mary I
  • Office Vacant (1790 - 1796)
    • Monarch: Mary I

List of Chancellors (1796 - 1879)Edit

Key: (M) = Marian Liberal; (R) = Rudolphine Conservative

  • Klaude Innsberg (M)(1796 - 1807)
    • Monarch: Mary I
  • Marcel Neierman (M)(1807 - 1814)
    • Monarch: Mary I (until 1812)
    • Monarch: Franz-Hector
  • Eric Dietrich (M)(1814 - 1816)
    • Monarch: Franz-Hector
  • Magnus von Eggenberg (M)(1816 - 1822)
    • Monarch: Franz-Hector
  • Eric Dietrich (M)(1822 - 1829)
    • Monarch: Franz-Hector (until 1826)
    • Monarch: Franz-Rudolph
  • Karl Dreher (M)(1829)
    • Monarch: Franz-Rudolph
  • Franz-Maria Jungerforst (R)(1829 - 1839)
    • Monarch: Franz-Rudolph
  • Friedrich Baderman (R)(1839 - 1844)
    • Monarch: Franz-Rudolph
  • Frederick van Leuster  (M)(1844 - 1849)
    • Monarch: Franz-Rudolph
  • Markus von Habsburg-Wittelsbach (R)(1849 - 1856)
    • Monarch: Franz-Rudolph (until 1854)
    • Monarch: Franz-Victor
  • Ricard Hanhoff  (M)(1856 - 1862)
    • Monarch: Franz-Victor
  • Alexander Janz (R)(1862 - 1870)
    • Monarch: Franz-Victor
  • Arthur Morgenstern  (M)(1870 - 1871)
    • Monarch: Franz-Victor
  • Ricard Hanhoff (R)(1871 - 1873)
    • Monarch: Franz-Victor
  • Arthur Morgenstern (M)(1873 - 1874)
    • Monarch: Franz-Victor
  • Karl Teichtner (R)(1874 - 1876)
    • Monarch: Franz-Victor
  • Office Vacant (1876 - 1879)
    • Monarch: Franz-Victor

List of Chancellors (1879 - 1896)Edit

  • Gilbert Schuster (M)(1879 - 1885)
    • Vice-Chancellor: Markus Helenkamp  (M)(1879 - 1885)
  • Markus Helenkamp (M)(1885 - 1894)
    • Vice-Chancellor: None (1885 - 1890)
    • Vice-Chancellor: Felipe DiRegenati  (M)(1890 - 1894)
  • Felipe DiRegenati (M)(1894 - 1896)
    • Vice-Chancellor: None (1894 - 1895)
    • Vice Chancellor: Mikael Amherst-Verner  (M)(1895 - 1896)

List of Governor-Generals (1896 - 1955)Edit

Key: (M) = Marian Liberals; (C) = Conservative; (D) = Democratic-Federalist

  • Felipe DiRegenati (M)(1896 - 1901)
    • Vice-Governor: Mikael Amherst-Verner (M)(1896 - 1901)
  • Heinrik Paks (M)(1901 - 1902)
    • Vice-Governor: None
  • Rudolph Fresk (M)(1902 - 1904)
    • Vice-Governor: Franz-Albert Kristoffersen (M)(1902 - 1904)
  • Johann Mikelssen (C)(1904 - 1907)
    • Vice-Governor: Herman Ulmann (C)(1904 - 1907)
  • Herman Ulmann (C)(1907 - 1908)
    • Vice-Governor: None
  • Viktor von Hasse (M)(1908 - 1915)
    • Vice-Governor: Claiton Aufergast (M)(1908 - 1915)
  • Adrian Kurkeings (M)(1915 - 1927)
    • Vice-Governor: Josef Mane (M)(1915 - 1919)
    • Vice-Governor: Georg Wihelmburg (D)(1919 - 1927)
  • Josef Mane (M)(1927 - 1931)
    • Vice-Governor: Leonardo Benedetti (1927 - 1931)
  • Franz-Albert von Patriks (C)(1931 - 1935)
    • Vice-Governor: Geoffroi Kilmer (C)(1931 - 1935)
  • Claiton Dietricher (D)(1935 - 1943)
    • Vice-Governor: Jakome Pinscher (M)(1935 - 1938)
    • Vice-Governor: Melanie Leverenz (D)(1938 - 1943)
  • Melanie Leverenz (D)(1943 - 1954)
    • Vice-Governor: Oswald Klein (D)(1943 - 1954)

List of Governors (1954 - )Edit

  • Melanie Leverenz (D)(1954 - 1955)
    • Vice-Governor: Oswald Klein (D)(1954 - 1955)
--

-- This module will implement Template loop detected: Template:Navbox --

local p = {}

local HtmlBuilder = require('Module:HtmlBuilder') local navbar = require('Module:Navbar')._navbar local getArgs -- lazily initialized

local args local tableRowAdded = false local border local listnums = {}

local function trim(s)

   return (mw.ustring.gsub(s, "^%s*(.-)%s*$", "%1"))

end

local function addNewline(s)

   if s:match('^[*:;#]') or s:match('^{|') then
       return '\n' .. s ..'\n'
   else
       return s
   end

end

local function addTableRow(tbl)

   -- If any other rows have already been added, then we add a 2px gutter row.
   if tableRowAdded then
       tbl
           .tag('tr')
               .css('height', '2px')
               .tag('td')
               	.attr('colspan',2)
   end

   tableRowAdded = true

   return tbl.tag('tr')

end

local function renderNavBar(titleCell)

   -- Depending on the presence of the navbar and/or show/hide link, we may need to add a spacer div on the left
   -- or right to keep the title centered.
   local spacerSide = nil

   if args.navbar == 'off' then
       -- No navbar, and client wants no spacer, i.e. wants the title to be shifted to the left. If there's
       -- also no show/hide link, then we need a spacer on the right to achieve the left shift.
       if args.state == 'plain' then spacerSide = 'right' end
   elseif args.navbar == 'plain' or (not args.name and mw.getCurrentFrame():getParent():getTitle() == 'Template:Navbox' and (border == 'subgroup' or border == 'child' or border == 'none')) then
       -- No navbar. Need a spacer on the left to balance out the width of the show/hide link.
       if args.state ~= 'plain' then spacerSide = 'left' end
   else
       -- Will render navbar (or error message). If there's no show/hide link, need a spacer on the right
       -- to balance out the width of the navbar.
       if args.state == 'plain' then spacerSide = 'right' end

       titleCell.wikitext(navbar{ 
           args.name, 
           mini = 1, 
           fontstyle = (args.basestyle or ) .. ';' .. (args.titlestyle or ) ..  ';background:none transparent;border:none;'
       })
   end

   -- Render the spacer div.
   if spacerSide then
       titleCell
           .tag('span')
               .css('float', spacerSide)
               .css('width', '6em')
               .wikitext(' ')
   end

end

-- -- Title row -- local function renderTitleRow(tbl)

   if not args.title then return end

   local titleRow = addTableRow(tbl)

   if args.titlegroup then
       titleRow
           .tag('th')
               .attr('scope', 'row')
               .addClass('navbox-group')
               .addClass(args.titlegroupclass)
               .cssText(args.basestyle)
               .cssText(args.groupstyle)
               .cssText(args.titlegroupstyle)
               .wikitext(args.titlegroup)
   end

   local titleCell = titleRow.tag('th').attr('scope', 'col')

   if args.titlegroup then
       titleCell
           .css('border-left', '2px solid #fdfdfd')
           .css('width', '100%')
   end

   local titleColspan = 2
   if args.imageleft then titleColspan = titleColspan + 1 end
   if args.image then titleColspan = titleColspan + 1 end
   if args.titlegroup then titleColspan = titleColspan - 1 end

   titleCell
       .cssText(args.basestyle)
       .cssText(args.titlestyle)
       .addClass('navbox-title')
       .attr('colspan', titleColspan)

   renderNavBar(titleCell)

   titleCell
        .tag('div')
            .addClass(args.titleclass)
            .css('font-size', '110%')
            .wikitext(addNewline(args.title))

end

-- -- Above/Below rows --

local function getAboveBelowColspan()

   local ret = 2
   if args.imageleft then ret = ret + 1 end
   if args.image then ret = ret + 1 end
   return ret

end

local function renderAboveRow(tbl)

   if not args.above then return end

   addTableRow(tbl)
       .tag('td')
           .addClass('navbox-abovebelow')
           .addClass(args.aboveclass)
           .cssText(args.basestyle)
           .cssText(args.abovestyle)
           .attr('colspan', getAboveBelowColspan())
           .tag('div')
               .wikitext(addNewline(args.above))

end

local function renderBelowRow(tbl)

   if not args.below then return end

   addTableRow(tbl)
       .tag('td')
           .addClass('navbox-abovebelow')
           .addClass(args.belowclass)
           .cssText(args.basestyle)
           .cssText(args.belowstyle)
           .attr('colspan', getAboveBelowColspan())
           .tag('div')
               .wikitext(addNewline(args.below))

end

-- -- List rows -- local function renderListRow(tbl, listnum)

   local row = addTableRow(tbl)

   if listnum == 1 and args.imageleft then
       row
           .tag('td')
               .addClass('navbox-image')
               .addClass(args.imageclass)
               .css('width', '0%')
               .css('padding', '0px 2px 0px 0px')
               .cssText(args.imageleftstyle)
               .attr('rowspan', 2 * #listnums - 1)
               .tag('div')
                   .wikitext(addNewline(args.imageleft))
   end

   if args['group' .. listnum] then
       local groupCell = row.tag('th')

       groupCell
              .attr('scope', 'row')
              .addClass('navbox-group')
              .addClass(args.groupclass)
              .cssText(args.basestyle)

       if args.groupwidth then
           groupCell.css('width', args.groupwidth)
       end

       groupCell
           .cssText(args.groupstyle)
           .cssText(args['group' .. listnum .. 'style'])
           .wikitext(args['group' .. listnum])
   end

   local listCell = row.tag('td')

   if args['group' .. listnum] then
       listCell
           .css('text-align', 'left')
           .css('border-left-width', '2px')
           .css('border-left-style', 'solid')
   else
       listCell.attr('colspan', 2)
   end

   if not args.groupwidth then 
       listCell.css('width', '100%')
   end

   local isOdd = (listnum % 2) == 1
   local rowstyle = args.evenstyle
   if isOdd then rowstyle = args.oddstyle end

   local evenOdd
   if args.evenodd == 'swap' then
       if isOdd then evenOdd = 'even' else evenOdd = 'odd' end
   else
       if isOdd then evenOdd = args.evenodd or 'odd' else evenOdd = args.evenodd or 'even' end
   end

   listCell
       .css('padding', '0px')
       .cssText(args.liststyle)
       .cssText(rowstyle)
       .cssText(args['list' .. listnum .. 'style'])
       .addClass('navbox-list')
       .addClass('navbox-' .. evenOdd)
       .addClass(args.listclass)
       .tag('div')
           .css('padding', (listnum == 1 and args.list1padding) or args.listpadding or '0em 0.25em')
           .wikitext(addNewline(args['list' .. listnum]))

   if listnum == 1 and args.image then
       row
           .tag('td')
               .addClass('navbox-image')
               .addClass(args.imageclass)
               .css('width', '0%')
               .css('padding', '0px 0px 0px 2px')
               .cssText(args.imagestyle)
               .attr('rowspan', 2 * #listnums - 1)
               .tag('div')
                   .wikitext(addNewline(args.image))
   end

end


-- -- Tracking categories --

local function needsHorizontalLists()

   if border == 'child' or border == 'subgroup'  or args.tracking == 'no' then return false end

   local listClasses = {'plainlist', 'hlist', 'hlist hnum', 'hlist hwrap', 'hlist vcard', 'vcard hlist', 'hlist vevent'}
   for i, cls in ipairs(listClasses) do
       if args.listclass == cls or args.bodyclass == cls then
           return false
       end
   end

   return true

end

local function hasBackgroundColors()

   return mw.ustring.match(args.titlestyle or ,'background') or mw.ustring.match(args.groupstyle or ,'background') or mw.ustring.match(args.basestyle or ,'background')

end

local function getTrackingCategories()

   local cats = {}
   if needsHorizontalLists() then table.insert(cats, 'Navigational boxes without horizontal lists') end
   if hasBackgroundColors() then table.insert(cats, 'Navboxes using background colours') end
   return cats

end

local function renderTrackingCategories(builder)

   local title = mw.title.getCurrentTitle()
   if title.namespace ~= 10 then return end -- not in template space
   local subpage = title.subpageText
   if subpage == 'doc' or subpage == 'sandbox' or subpage == 'testcases' then return end

   for i, cat in ipairs(getTrackingCategories()) do
       builder.wikitext() 
   end

end

-- -- Main navbox tables -- local function renderMainTable()

   local tbl = HtmlBuilder.create('table')
       .attr('cellspacing', 0)
       .addClass('nowraplinks')
       .addClass(args.bodyclass)

   if args.title and (args.state ~= 'plain' and args.state ~= 'off') then
       tbl
           .addClass('collapsible')
           .addClass(args.state or 'autocollapse')
   end

   tbl.css('border-spacing', 0)
   if border == 'subgroup' or border == 'child' or border == 'none' then
       tbl
           .addClass('navbox-subgroup')
           .cssText(args.bodystyle)
           .cssText(args.style)
   else -- regular navobx - bodystyle and style will be applied to the wrapper table
       tbl
           .addClass('navbox-inner')
           .css('background', 'transparent')
           .css('color', 'inherit')
   end
   tbl.cssText(args.innerstyle)

   renderTitleRow(tbl)
   renderAboveRow(tbl)
   for i, listnum in ipairs(listnums) do
       renderListRow(tbl, listnum) 
   end
   renderBelowRow(tbl)

   return tbl

end

function p._navbox(navboxArgs)

   args = navboxArgs

   for k, v in pairs(args) do
       local listnum = ( .. k):match('^list(%d+)$')
       if listnum then table.insert(listnums, tonumber(listnum)) end
   end
   table.sort(listnums)

   border = trim(args.border or args[1] or )

   -- render the main body of the navbox
   local tbl = renderMainTable()

   -- render the appropriate wrapper around the navbox, depending on the border param
   local res = HtmlBuilder.create()
   if border == 'none' then
       res.node(tbl)
   elseif border == 'subgroup' or border == 'child' then
       -- We assume that this navbox is being rendered in a list cell of a parent navbox, and is
       -- therefore inside a div with padding:0em 0.25em. We start with a </div> to avoid the
-- padding being applied, and at the end add a
to balance out the parent's
       res
           .tag('/div', {unclosed = true})
               .done()
           .node(tbl)
           .tag('div', {unclosed = true})
   else
       res
           .tag('table')
               .attr('cellspacing', 0)
               .addClass('navbox')
               .css('border-spacing', 0)
               .cssText(args.bodystyle)
               .cssText(args.style)
               .tag('tr')
                   .tag('td')
                       .css('padding', '2px')
                       .node(tbl)
   end

   renderTrackingCategories(res)

   return tostring(res)

end

function p.navbox(frame)

   if not getArgs then
   	getArgs = require('Module:Arguments').getArgs
   end
   args = getArgs(frame)

   -- Read the arguments in the order they'll be output in, to make references number in the right order.
   local _
   _ = args.title
   _ = args.above
   for i = 1, 20 do
       _ = args["group" .. tostring(i)]
       _ = args["list" .. tostring(i)]
   end    
   _ = args.below

   return p._navbox(args)

end

return p

-- -- This module will implement Template loop detected: Template:Navbox --

local p = {}

local HtmlBuilder = require('Module:HtmlBuilder') local navbar = require('Module:Navbar')._navbar local getArgs -- lazily initialized

local args local tableRowAdded = false local border local listnums = {}

local function trim(s)

   return (mw.ustring.gsub(s, "^%s*(.-)%s*$", "%1"))

end

local function addNewline(s)

   if s:match('^[*:;#]') or s:match('^{|') then
       return '\n' .. s ..'\n'
   else
       return s
   end

end

local function addTableRow(tbl)

   -- If any other rows have already been added, then we add a 2px gutter row.
   if tableRowAdded then
       tbl
           .tag('tr')
               .css('height', '2px')
               .tag('td')
               	.attr('colspan',2)
   end

   tableRowAdded = true

   return tbl.tag('tr')

end

local function renderNavBar(titleCell)

   -- Depending on the presence of the navbar and/or show/hide link, we may need to add a spacer div on the left
   -- or right to keep the title centered.
   local spacerSide = nil

   if args.navbar == 'off' then
       -- No navbar, and client wants no spacer, i.e. wants the title to be shifted to the left. If there's
       -- also no show/hide link, then we need a spacer on the right to achieve the left shift.
       if args.state == 'plain' then spacerSide = 'right' end
   elseif args.navbar == 'plain' or (not args.name and mw.getCurrentFrame():getParent():getTitle() == 'Template:Navbox' and (border == 'subgroup' or border == 'child' or border == 'none')) then
       -- No navbar. Need a spacer on the left to balance out the width of the show/hide link.
       if args.state ~= 'plain' then spacerSide = 'left' end
   else
       -- Will render navbar (or error message). If there's no show/hide link, need a spacer on the right
       -- to balance out the width of the navbar.
       if args.state == 'plain' then spacerSide = 'right' end

       titleCell.wikitext(navbar{ 
           args.name, 
           mini = 1, 
           fontstyle = (args.basestyle or ) .. ';' .. (args.titlestyle or ) ..  ';background:none transparent;border:none;'
       })
   end

   -- Render the spacer div.
   if spacerSide then
       titleCell
           .tag('span')
               .css('float', spacerSide)
               .css('width', '6em')
               .wikitext(' ')
   end

end

-- -- Title row -- local function renderTitleRow(tbl)

   if not args.title then return end

   local titleRow = addTableRow(tbl)

   if args.titlegroup then
       titleRow
           .tag('th')
               .attr('scope', 'row')
               .addClass('navbox-group')
               .addClass(args.titlegroupclass)
               .cssText(args.basestyle)
               .cssText(args.groupstyle)
               .cssText(args.titlegroupstyle)
               .wikitext(args.titlegroup)
   end

   local titleCell = titleRow.tag('th').attr('scope', 'col')

   if args.titlegroup then
       titleCell
           .css('border-left', '2px solid #fdfdfd')
           .css('width', '100%')
   end

   local titleColspan = 2
   if args.imageleft then titleColspan = titleColspan + 1 end
   if args.image then titleColspan = titleColspan + 1 end
   if args.titlegroup then titleColspan = titleColspan - 1 end

   titleCell
       .cssText(args.basestyle)
       .cssText(args.titlestyle)
       .addClass('navbox-title')
       .attr('colspan', titleColspan)

   renderNavBar(titleCell)

   titleCell
        .tag('div')
            .addClass(args.titleclass)
            .css('font-size', '110%')
            .wikitext(addNewline(args.title))

end

-- -- Above/Below rows --

local function getAboveBelowColspan()

   local ret = 2
   if args.imageleft then ret = ret + 1 end
   if args.image then ret = ret + 1 end
   return ret

end

local function renderAboveRow(tbl)

   if not args.above then return end

   addTableRow(tbl)
       .tag('td')
           .addClass('navbox-abovebelow')
           .addClass(args.aboveclass)
           .cssText(args.basestyle)
           .cssText(args.abovestyle)
           .attr('colspan', getAboveBelowColspan())
           .tag('div')
               .wikitext(addNewline(args.above))

end

local function renderBelowRow(tbl)

   if not args.below then return end

   addTableRow(tbl)
       .tag('td')
           .addClass('navbox-abovebelow')
           .addClass(args.belowclass)
           .cssText(args.basestyle)
           .cssText(args.belowstyle)
           .attr('colspan', getAboveBelowColspan())
           .tag('div')
               .wikitext(addNewline(args.below))

end

-- -- List rows -- local function renderListRow(tbl, listnum)

   local row = addTableRow(tbl)

   if listnum == 1 and args.imageleft then
       row
           .tag('td')
               .addClass('navbox-image')
               .addClass(args.imageclass)
               .css('width', '0%')
               .css('padding', '0px 2px 0px 0px')
               .cssText(args.imageleftstyle)
               .attr('rowspan', 2 * #listnums - 1)
               .tag('div')
                   .wikitext(addNewline(args.imageleft))
   end

   if args['group' .. listnum] then
       local groupCell = row.tag('th')

       groupCell
              .attr('scope', 'row')
              .addClass('navbox-group')
              .addClass(args.groupclass)
              .cssText(args.basestyle)

       if args.groupwidth then
           groupCell.css('width', args.groupwidth)
       end

       groupCell
           .cssText(args.groupstyle)
           .cssText(args['group' .. listnum .. 'style'])
           .wikitext(args['group' .. listnum])
   end

   local listCell = row.tag('td')

   if args['group' .. listnum] then
       listCell
           .css('text-align', 'left')
           .css('border-left-width', '2px')
           .css('border-left-style', 'solid')
   else
       listCell.attr('colspan', 2)
   end

   if not args.groupwidth then 
       listCell.css('width', '100%')
   end

   local isOdd = (listnum % 2) == 1
   local rowstyle = args.evenstyle
   if isOdd then rowstyle = args.oddstyle end

   local evenOdd
   if args.evenodd == 'swap' then
       if isOdd then evenOdd = 'even' else evenOdd = 'odd' end
   else
       if isOdd then evenOdd = args.evenodd or 'odd' else evenOdd = args.evenodd or 'even' end
   end

   listCell
       .css('padding', '0px')
       .cssText(args.liststyle)
       .cssText(rowstyle)
       .cssText(args['list' .. listnum .. 'style'])
       .addClass('navbox-list')
       .addClass('navbox-' .. evenOdd)
       .addClass(args.listclass)
       .tag('div')
           .css('padding', (listnum == 1 and args.list1padding) or args.listpadding or '0em 0.25em')
           .wikitext(addNewline(args['list' .. listnum]))

   if listnum == 1 and args.image then
       row
           .tag('td')
               .addClass('navbox-image')
               .addClass(args.imageclass)
               .css('width', '0%')
               .css('padding', '0px 0px 0px 2px')
               .cssText(args.imagestyle)
               .attr('rowspan', 2 * #listnums - 1)
               .tag('div')
                   .wikitext(addNewline(args.image))
   end

end


-- -- Tracking categories --

local function needsHorizontalLists()

   if border == 'child' or border == 'subgroup'  or args.tracking == 'no' then return false end

   local listClasses = {'plainlist', 'hlist', 'hlist hnum', 'hlist hwrap', 'hlist vcard', 'vcard hlist', 'hlist vevent'}
   for i, cls in ipairs(listClasses) do
       if args.listclass == cls or args.bodyclass == cls then
           return false
       end
   end

   return true

end

local function hasBackgroundColors()

   return mw.ustring.match(args.titlestyle or ,'background') or mw.ustring.match(args.groupstyle or ,'background') or mw.ustring.match(args.basestyle or ,'background')

end

local function getTrackingCategories()

   local cats = {}
   if needsHorizontalLists() then table.insert(cats, 'Navigational boxes without horizontal lists') end
   if hasBackgroundColors() then table.insert(cats, 'Navboxes using background colours') end
   return cats

end

local function renderTrackingCategories(builder)

   local title = mw.title.getCurrentTitle()
   if title.namespace ~= 10 then return end -- not in template space
   local subpage = title.subpageText
   if subpage == 'doc' or subpage == 'sandbox' or subpage == 'testcases' then return end

   for i, cat in ipairs(getTrackingCategories()) do
       builder.wikitext() 
   end

end

-- -- Main navbox tables -- local function renderMainTable()

   local tbl = HtmlBuilder.create('table')
       .attr('cellspacing', 0)
       .addClass('nowraplinks')
       .addClass(args.bodyclass)

   if args.title and (args.state ~= 'plain' and args.state ~= 'off') then
       tbl
           .addClass('collapsible')
           .addClass(args.state or 'autocollapse')
   end

   tbl.css('border-spacing', 0)
   if border == 'subgroup' or border == 'child' or border == 'none' then
       tbl
           .addClass('navbox-subgroup')
           .cssText(args.bodystyle)
           .cssText(args.style)
   else -- regular navobx - bodystyle and style will be applied to the wrapper table
       tbl
           .addClass('navbox-inner')
           .css('background', 'transparent')
           .css('color', 'inherit')
   end
   tbl.cssText(args.innerstyle)

   renderTitleRow(tbl)
   renderAboveRow(tbl)
   for i, listnum in ipairs(listnums) do
       renderListRow(tbl, listnum) 
   end
   renderBelowRow(tbl)

   return tbl

end

function p._navbox(navboxArgs)

   args = navboxArgs

   for k, v in pairs(args) do
       local listnum = ( .. k):match('^list(%d+)$')
       if listnum then table.insert(listnums, tonumber(listnum)) end
   end
   table.sort(listnums)

   border = trim(args.border or args[1] or )

   -- render the main body of the navbox
   local tbl = renderMainTable()

   -- render the appropriate wrapper around the navbox, depending on the border param
   local res = HtmlBuilder.create()
   if border == 'none' then
       res.node(tbl)
   elseif border == 'subgroup' or border == 'child' then
       -- We assume that this navbox is being rendered in a list cell of a parent navbox, and is
       -- therefore inside a div with padding:0em 0.25em. We start with a </div> to avoid the
-- padding being applied, and at the end add a
to balance out the parent's
       res
           .tag('/div', {unclosed = true})
               .done()
           .node(tbl)
           .tag('div', {unclosed = true})
   else
       res
           .tag('table')
               .attr('cellspacing', 0)
               .addClass('navbox')
               .css('border-spacing', 0)
               .cssText(args.bodystyle)
               .cssText(args.style)
               .tag('tr')
                   .tag('td')
                       .css('padding', '2px')
                       .node(tbl)
   end

   renderTrackingCategories(res)

   return tostring(res)

end

function p.navbox(frame)

   if not getArgs then
   	getArgs = require('Module:Arguments').getArgs
   end
   args = getArgs(frame)

   -- Read the arguments in the order they'll be output in, to make references number in the right order.
   local _
   _ = args.title
   _ = args.above
   for i = 1, 20 do
       _ = args["group" .. tostring(i)]
       _ = args["list" .. tostring(i)]
   end    
   _ = args.below

   return p._navbox(args)

end

return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.