Fix various minor bugs

* Fix "update" recipes in IC2 classic to use the new "update" command
* Remove the crafting plan model from the item detail page as it isn't
  being used there right now and can be slow for complex items
* Update the `Recipe.compareFor` method to be able to work without an
  item slug as a reference
This commit is contained in:
Andrew Miner
2015-02-19 10:51:52 -08:00
parent 89247246bd
commit 2d330eedcd
5 changed files with 105 additions and 126 deletions
+10 -9
View File
@@ -38,16 +38,17 @@ module.exports = class Recipe extends BaseModel
# Class Methods ################################################################################
@compareFor: (a, b, itemSlug)->
aValue = a.itemSlug.matches itemSlug
bValue = b.itemSlug.matches itemSlug
if aValue isnt bValue
return -1 if aValue
return +1 if bValue
if itemSlug?
aValue = a.itemSlug.matches itemSlug
bValue = b.itemSlug.matches itemSlug
if aValue isnt bValue
return -1 if aValue
return +1 if bValue
aValue = a.getQuantityProducedOf itemSlug
bValue = b.getQuantityProducedOf itemSlug
if aValue isnt bValue
return if aValue > bValue then -1 else +1
aValue = a.getQuantityProducedOf itemSlug
bValue = b.getQuantityProducedOf itemSlug
if aValue isnt bValue
return if aValue > bValue then -1 else +1
aValue = a.getInputCount()
bValue = b.getInputCount()