Module:Store locations list: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 49: Line 49:
             :tag('th'):wikitext('Members?'):done()
             :tag('th'):wikitext('Members?'):done()
         :done()
         :done()
local function addShopRow(shop, location)
restbl:tag('tr')
:tag('td'):wikitext(shop.seller):done()
:tag('td'):wikitext(location):done()
:tag('td')
:attr({['data-sort-value']=shop.sellSortValue})
:wikitext(shop.sellvalue)
:done()
:tag('td')
:attr({['data-sort-value']=shop.buySortValue})
:wikitext(shop.buyvalue)
:done()
:tag('td'):wikitext(shop.members):done()
:done()
end


     -- Create the rows for the output table
     -- Create the rows for the output table
Line 55: Line 71:
    
    
     for i, location in ipairs(shop.location) do
     for i, location in ipairs(shop.location) do
        restbl:tag('tr')
        addShopRow(shop, location)
            :tag('td'):wikitext(shop.seller):done()
end
            :tag('td'):wikitext(location):done()
            :tag('td')
if #shop.location == 0 then
                :attr({['data-sort-value']=shop.sellSortValue})
addShopRow(shop, 'N/A')
                :wikitext(shop.sellvalue)
            :done()
            :tag('td')
                :attr({['data-sort-value']=shop.buySortValue})
                :wikitext(shop.buyvalue)
            :done()
            :tag('td'):wikitext(shop.members):done()
        :done()
end
end
     end
     end

Navigation menu