1,131
edits
No edit summary |
mNo edit summary |
||
| (16 intermediate revisions by the same user not shown) | |||
| Line 43: | Line 43: | ||
:tag('th'):wikitext('Seller'):done() | :tag('th'):wikitext('Seller'):done() | ||
:tag('th'):wikitext('Location'):done() | :tag('th'):wikitext('Location'):done() | ||
:tag('th'):wikitext(' | :tag('th'):wikitext('Buyable for'):attr('data-sort-type', 'number'):done() | ||
:tag('th'):wikitext(' | :tag('th'):wikitext('Sellable for'):attr('data-sort-type', 'number'):done() | ||
:tag('th'):wikitext('Members?'):done() | :tag('th'):wikitext('Members?'):done() | ||
:done() | :done() | ||
| Line 52: | Line 52: | ||
:tag('td'):wikitext(shop.seller):done() | :tag('td'):wikitext(shop.seller):done() | ||
:tag('td'):wikitext(location):done() | :tag('td'):wikitext(location):done() | ||
:tag('td') | |||
:attr({['data-sort-value']=shop.buySortValue}) | |||
:wikitext(shop.buyvalue) | |||
:done() | |||
:tag('td') | :tag('td') | ||
:attr({['data-sort-value']=shop.sellSortValue}) | :attr({['data-sort-value']=shop.sellSortValue}) | ||
:wikitext(shop.sellvalue) | :wikitext(shop.sellvalue) | ||
:done() | :done() | ||
:tag('td') | :tag('td') | ||
| Line 187: | Line 187: | ||
local sellvalue = item['Store sell price'] or '' | local sellvalue = item['Store sell price'] or '' | ||
local sellSortValue = 0 | local sellSortValue = 0 | ||
mw.log("sellvalue", sellvalue) | |||
mw.log("sell is 1e10", tonumber(sellvalue) == 1e10) | |||
if not(sellvalue == 1e10) then | if not(sellvalue =='N/A') and not(tonumber(sellvalue) == 1e10) then | ||
sellvalue = tonumber(sellvalue) | sellvalue = tonumber(sellvalue) | ||
| Line 209: | Line 212: | ||
sellvalue = 'N/A' | sellvalue = 'N/A' | ||
end | end | ||
mw.log("sellvalue 2", sellvalue) | |||
local buyvalue = item['Store buy price'] or '' | local buyvalue = item['Store buy price'] or '' | ||
local buySortValue = 0 | local buySortValue = 0 | ||
if not(buyvalue == 'N/A') then | |||
mw.log("buyvalue", buyvalue) | |||
mw.log("buy is 1e10", tonumber(buyvalue) == 1e10) | |||
if not(buyvalue == 'N/A') and not(tonumber(buyvalue) == 1e10) then | |||
buyvalue = tonumber(buyvalue) | buyvalue = tonumber(buyvalue) | ||
mw.log("buyvalue 2", buyvalue) | |||
if buyvalue then | if buyvalue then | ||
buySortValue = buyvalue | buySortValue = buyvalue | ||
| Line 226: | Line 240: | ||
-- buyvalue = currencyImg .. buyvalue | -- buyvalue = currencyImg .. buyvalue | ||
-- end | -- end | ||
else | |||
buyvalue = editbtn -- If buyvalue can't be converted to a number it will default to the edit button | |||
end | |||
else | |||
buySortValue = buyvalue | |||
buyvalue = 'N/A' | |||
end | |||
-- members only? | -- members only? | ||