d-breadcrumbs as |breadcrumb|
  breadcrumb.item
    = link-to 'project.index': span= t 'models.plural.project'
  breadcrumb.item
    span= t 'models.project'
    span : 
    = link-to 'project.show' model: span= model.name
  breadcrumb.item active=true
   span= t 'project.dunlop.title'
.ui.header
  .ui.right.floated.icon.buttons
    = push-action type='new' action='newWorkflowStep'
    = push-action type='edit' action='editProject' model=model
    = push-action type='sort' action='sortWorkflowSteps'
    = push-action type='contract' action='projectContract' model=model
    /= push-action type='show' action='displayWorkflowActionDefinitions'
    = push-action type='show' action='show_project_info'
  if model.project_scenarios.length
    .project-scenarios-dropdown-container
      / MULTIPLE INTERSECTIONABLE SCENARIOS
      /.ui.small.buttons
        = ui-dropdown class='multiple button' selected=selected_project_scenarios onChange=(action 'select_project_scenario') as |execute mapper|
          .default.text= t 'action.select_model' modelPath='models.project_scenario'
          i.dropdown.icon
          .menu
            .header
              i.grid.layout.icon
              a.pointable{action 'show_project_scenarios_grid' model} Show activation grid
            each (sort-by 'name' model.project_scenarios) as |project_scenario|
              .item data-value='{{map-value mapper project_scenario}}'
                = project_scenario.name
        if has_multiple_selected_project_scenarios
          if (eq selected_project_scenarios_set_operation 'union')
            button.ui.button.logical-icon-button{action (mut selected_project_scenarios_set_operation) 'intersection'}
              img.logical-icon-image.logical-disjunction src="/panda/app/assets/icons/svg/logical-disjunction.svg"
          else
            button.ui.button.logical-icon-button{action (mut selected_project_scenarios_set_operation) 'union'}
              img.logical-icon-image.logical-disjunction src="/panda/app/assets/icons/svg/logical-conjunction.svg"
        if has_one_selected_project_scenario
          button.ui.edit.icon.button{action 'edit_selected_project_scenario'}
            i.edit.icon
      = project/edit-active-project-scenario project=project active_project_scenario=active_project_scenario
  i.sidebar.icon{action 'toggle_sidebar' 'sub-sidebar'}
  .content
    span.resource-descriptor= t 'models.project'
    span.resource-name= model.name
    span.resource-suffix= t 'project.dunlop.title'
.ui.divider
if model.workflow_groups.isSettled
  .ui.pushable.component.context
    ui-sidebar class='menu left very wide vertical' context='.component.context' id='sub-sidebar'
      .header.item Unassigned
      each model.unassigned_workflow_action_definitions as |workflow_action_definition|
        .item data-workflow-action-definition=workflow_action_definition.id
          .ui.right.floated.small.icon.buttons
            = push-action type='random'  action=(action 'positionWorkflowActionDefinitionInProject' workflow_action_definition)
          = workflow_action_definition.title
    .pusher
      .workflow-instance-workflow-groups-container
        each model.sorted_workflow_groups as |workflow_group|
          if (contains workflow_group active_workflow_groups)
            .workflow-instance-workflow-group-container
              = workflow-group-header workflow_group=workflow_group
              /= draggable-dropzone dropped='positionWorkflowActionDefinition' content=workflow_group class='project-workflow_group-dropzone'
              .workflow-instance-workflow-group-body
                /if workflow_group.constraints.length
                  .workflow-group-constraints-count
                    span.count= workflow_group.constraints.length
                    span= t 'models.plural.workflow_group_constraint'
                each workflow_group.sorted_workflow_action_definitions as |workflow_action_definition|
                  /= draggable-item content=workflow_action_definition class='workflow_action_definition-item-container'
                  if (contains workflow_action_definition active_workflow_action_definitions)
                    = workflow-action-definition-item workflow_action_definition=workflow_action_definition
      /.row: .small-12.columns= input value=newWorkflowStepName enter='newWorkflowStep' placeholder='New workflow_group name'
      .row= collapsible-content 'project.diagram_title' modelPath='models.plural.workflow_action_offset'
        = project/workflow-action-offsets-graph project=model batch_size_simulation_range=batch_size_simulation_range batch_size_simulation_value=batch_size_simulation_value chosen_absolute_date=chosen_absolute_date reference_date_day_of_week=reference_date_day_of_week active_workflow_action_definitions=active_workflow_action_definitions active_project_scenario=active_project_scenario
      .row= collapsible-content 'Workflow group relative to migration date lead times diagram'
        = project/workflow-group-offset-diagram project=model batch_size_simulation_range=batch_size_simulation_range batch_size_simulation_value=batch_size_simulation_value chosen_absolute_date=chosen_absolute_date reference_date_day_of_week=reference_date_day_of_week active_workflow_groups=active_workflow_groups active_project_scenario=active_project_scenario
      .row= collapsible-content 'Action execution relative to migration date offsets diagram'
        = project/action-execution-offset-diagram project=model batch_size_simulation_range=batch_size_simulation_range batch_size_simulation_value=batch_size_simulation_value chosen_absolute_date=chosen_absolute_date reference_date_day_of_week=reference_date_day_of_week active_workflow_action_definitions=active_workflow_action_definitions active_project_scenario=active_project_scenario
      .row= collapsible-content 'project.diagram_title' modelPath='models.plural.workflow_action_constraint'
        = project/workflow-action-constraints-graph project=model active_workflow_action_definitions=active_workflow_action_definitions active_project_scenario=active_project_scenario
      /.row= collapsible-content 'project.diagram_title' modelPath='models.plural.workflow_action_offset' collapsed=false
        = project/workflow-action-offsets-graph-old3 project=model batch_size_simulation_range=batch_size_simulation_range batch_size_simulation_value=batch_size_simulation_value chosen_absolute_date=chosen_absolute_date reference_date_day_of_week=reference_date_day_of_week active_workflow_action_definitions=active_workflow_action_definitions
      /.row= collapsible-content 'Old 2 Action execution relative to migration date offsets diagram'
        = project/action-execution-offset-diagram-old2 project=model batch_size_simulation_range=batch_size_simulation_range batch_size_simulation_value=batch_size_simulation_value chosen_absolute_date=chosen_absolute_date reference_date_day_of_week=reference_date_day_of_week
      /.row= collapsible-content 'Old 2 action offset diagram'
        = project/workflow-action-offsets-graph-old2 project=model batch_size_simulation_range=batch_size_simulation_range batch_size_simulation_value=batch_size_simulation_value chosen_absolute_date=chosen_absolute_date reference_date_day_of_week=reference_date_day_of_week
      /.row= collapsible-content 'Old 1 action offset diagram'
        = project/workflow-action-offsets-graph-old1 project=model
      /.row: .small-12.columns= project-workflow-groups-graph project=model
else
  .row: .small-12.columns: span.fa.fa-3x.fa-spinner.fa-spin
