Module:T-CountryHub: Difference between revisions

// via Wikitext Extension for VSCode
// via Wikitext Extension for VSCode
Tag: Reverted
Line 294: Line 294:
         end
         end
          
          
        -- Generate flag image for background
         local flagImageWikitext = ""
         local flagImageWikitext = ""
         if args.has_country and args.has_country ~= "" then
         if args.has_country and args.has_country ~= "" then
Line 306: Line 307:
         end
         end


         -- Assemble the HTML for the infobox table
         -- Build data for standard table rendering (like other cards)
         local infoBoxWrapper = html.create('div')
         local infoData = {
             :addClass('country-hub-infobox-wrapper')
            {result = 'ccTLD', value = ccTLDText},
            {result = 'ICANN region', value = regionText},
            {result = 'ISOC chapter', value = ISOCText},
             {result = 'Youth IGF', value = youthText}
        }
          
          
         local infoBox = infoBoxWrapper:tag('table')
        -- Render as standard wikitable with flag background
            :addClass('country-hub-infobox icannwiki-automatic-text')
         local tableHtml = renderTable(infoData, {'Country Info'})
          
          
         -- Header row
         -- Wrap with flag background
         infoBox:tag('tr')
         return string.format(
             :tag('th')
             '<div class="country-hub-infobox-wrapper">%s%s</div>',
                :attr('colspan', '2')
             tableHtml,
                :addClass('country-hub-infobox-header icannwiki-automatic-text')
             flagImageWikitext
                :wikitext(string.format('%s', displayCountry))
         )
                :done()
             :done()
       
        -- ccTLD row
        infoBox:tag('tr')
            :tag('th'):wikitext('ccTLD'):done()
            :tag('td'):wikitext(ccTLDText):done()
            :done()
       
        -- ICANN region row
        infoBox:tag('tr')
            :tag('th'):wikitext('ICANN region'):done()
             :tag('td'):wikitext(regionText):done()
            :done()
       
        -- REVIEW: Check for ccNSO membership or affiliation in the country / https://ccnso.icann.org/en/about/members.htm
 
        -- ISOC chapter row
        infoBox:tag('tr')
            :tag('th'):wikitext('ISOC chapter'):done()
            :tag('td'):wikitext(ISOCText):done()
            :done()
       
        -- Youth IGF row
        infoBox:tag('tr')
            :tag('th'):wikitext('Youth IGF'):done()
            :tag('td'):wikitext(youthText):done()
            :done()
       
        infoBoxWrapper:wikitext(flagImageWikitext)
          
        return tostring(infoBoxWrapper)
     end
     end
}
}