From 038b1661a0ec66144e4f88f04e1fb52a46f3f755 Mon Sep 17 00:00:00 2001 From: Andrew Miner Date: Sat, 14 Nov 2015 10:32:45 -0800 Subject: [PATCH] Separate "have" from "need" sections on craft page --- .../controllers/craft_page_controller.coffee | 15 ++++++++------- src/jade/templates/craft_page.jade | 18 +++++++++--------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/coffee/controllers/craft_page_controller.coffee b/src/coffee/controllers/craft_page_controller.coffee index f68277c67..c0e7a58aa 100644 --- a/src/coffee/controllers/craft_page_controller.coffee +++ b/src/coffee/controllers/craft_page_controller.coffee @@ -109,12 +109,13 @@ module.exports = class CraftPageController extends PageController @workingSectionController = @addChild CraftsmanWorkingController, '.view__craftsman_working', model: @model.craftsman + @$haveSection = @$('.have.section') @$instructionsSection = @$('.instructions.section') @$makeSection = @$('.make.section') - @$toolsSection = @$('.tools.section') - @$ingredientsSection = @$('.ingredients.section') - @$stepsSection = @$('.steps.section') + @$needSection = @$('.need.section') @$stepsContainer = @$('.steps.section .panel') + @$stepsSection = @$('.steps.section') + @$toolsSection = @$('.tools.section') @$workingSection = @$('.view__craftsman_working') super @@ -150,15 +151,15 @@ module.exports = class CraftPageController extends PageController if @model.craftsman.want.isEmpty toShow.push el for el in [@$instructionsSection] - toHide.push el for el in [@$toolsSection, @$ingredientsSection, @$stepsSection, @$workingSection] + toHide.push el for el in [@$toolsSection, @$needSection, @$stepsSection, @$workingSection] else if @model.craftsman.stage is Craftsman::STAGE.INVALID toShow.push el for el in [@$workingSection] - toHide.push el for el in [@$instructionsSection, @$toolsSection, @$ingredientsSection, @$stepsSection] + toHide.push el for el in [@$instructionsSection, @$toolsSection, @$needSection, @$stepsSection] else if not @model.craftsman.complete toShow.push el for el in [@$workingSection] - toHide.push el for el in [@$instructionsSection, @$toolsSection, @$ingredientsSection, @$stepsSection] + toHide.push el for el in [@$instructionsSection, @$toolsSection, @$needSection, @$stepsSection] else - toShow.push el for el in [@$toolsSection, @$ingredientsSection, @$stepsSection] + toShow.push el for el in [@$toolsSection, @$needSection, @$stepsSection] toHide.push el for el in [@$instructionsSection, @$workingSection] @show $el for $el in toShow diff --git a/src/jade/templates/craft_page.jade b/src/jade/templates/craft_page.jade index 3990e5057..7781befa1 100644 --- a/src/jade/templates/craft_page.jade +++ b/src/jade/templates/craft_page.jade @@ -16,18 +16,18 @@ .panel .view__inventory.large.editable + .have.section + h2 Already in Inventory + .panel + .view__inventory.large + .view__craftsman_working.section - .ingredients.section.hideable.hidden - h2 Ingredients + .need.section.hideable.hidden + h2 Need to Gather .panel - .have - h3 Already In Inventory - .view__inventory.large - - .need - h3 Need to Gather - .view__inventory.large + h3 Need to Gather + .view__inventory.large .steps.section.hideable.hidden h2 Steps