Separate "have" from "need" sections on craft page
This commit is contained in:
@@ -109,12 +109,13 @@ module.exports = class CraftPageController extends PageController
|
|||||||
@workingSectionController = @addChild CraftsmanWorkingController, '.view__craftsman_working',
|
@workingSectionController = @addChild CraftsmanWorkingController, '.view__craftsman_working',
|
||||||
model: @model.craftsman
|
model: @model.craftsman
|
||||||
|
|
||||||
|
@$haveSection = @$('.have.section')
|
||||||
@$instructionsSection = @$('.instructions.section')
|
@$instructionsSection = @$('.instructions.section')
|
||||||
@$makeSection = @$('.make.section')
|
@$makeSection = @$('.make.section')
|
||||||
@$toolsSection = @$('.tools.section')
|
@$needSection = @$('.need.section')
|
||||||
@$ingredientsSection = @$('.ingredients.section')
|
|
||||||
@$stepsSection = @$('.steps.section')
|
|
||||||
@$stepsContainer = @$('.steps.section .panel')
|
@$stepsContainer = @$('.steps.section .panel')
|
||||||
|
@$stepsSection = @$('.steps.section')
|
||||||
|
@$toolsSection = @$('.tools.section')
|
||||||
@$workingSection = @$('.view__craftsman_working')
|
@$workingSection = @$('.view__craftsman_working')
|
||||||
|
|
||||||
super
|
super
|
||||||
@@ -150,15 +151,15 @@ module.exports = class CraftPageController extends PageController
|
|||||||
|
|
||||||
if @model.craftsman.want.isEmpty
|
if @model.craftsman.want.isEmpty
|
||||||
toShow.push el for el in [@$instructionsSection]
|
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
|
else if @model.craftsman.stage is Craftsman::STAGE.INVALID
|
||||||
toShow.push el for el in [@$workingSection]
|
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
|
else if not @model.craftsman.complete
|
||||||
toShow.push el for el in [@$workingSection]
|
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
|
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]
|
toHide.push el for el in [@$instructionsSection, @$workingSection]
|
||||||
|
|
||||||
@show $el for $el in toShow
|
@show $el for $el in toShow
|
||||||
|
|||||||
@@ -16,18 +16,18 @@
|
|||||||
.panel
|
.panel
|
||||||
.view__inventory.large.editable
|
.view__inventory.large.editable
|
||||||
|
|
||||||
|
.have.section
|
||||||
|
h2 Already in Inventory
|
||||||
|
.panel
|
||||||
|
.view__inventory.large
|
||||||
|
|
||||||
.view__craftsman_working.section
|
.view__craftsman_working.section
|
||||||
|
|
||||||
.ingredients.section.hideable.hidden
|
.need.section.hideable.hidden
|
||||||
h2 Ingredients
|
h2 Need to Gather
|
||||||
.panel
|
.panel
|
||||||
.have
|
h3 Need to Gather
|
||||||
h3 Already In Inventory
|
.view__inventory.large
|
||||||
.view__inventory.large
|
|
||||||
|
|
||||||
.need
|
|
||||||
h3 Need to Gather
|
|
||||||
.view__inventory.large
|
|
||||||
|
|
||||||
.steps.section.hideable.hidden
|
.steps.section.hideable.hidden
|
||||||
h2 Steps
|
h2 Steps
|
||||||
|
|||||||
Reference in New Issue
Block a user