{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: MPL-2.0
~}}

<td data-test-job-name
  {{keyboard-shortcut
    enumerated=true
    action=(action "gotoJob" @job)
  }}
>
  <LinkTo
    @route="jobs.job.index"
    @model={{this.job.idWithNamespace}}
    class="is-primary"
  >
    {{this.job.name}}

    {{#if this.job.meta.structured.pack}}
      <span data-test-pack-tag class="tag is-pack">
        {{x-icon "box" class= "test"}}
        <span>Pack</span>
      </span>
    {{/if}}

  </LinkTo>
</td>
{{#if (not (eq @context "child"))}}
  {{#if this.system.shouldShowNamespaces}}
    <td data-test-job-namespace>
      {{this.job.namespace.name}}
    </td>
  {{/if}}
{{/if}}
{{#if (eq @context "child")}}
  <td data-test-job-submit-time>
    {{format-month-ts this.job.submitTime}}
  </td>
{{/if}}
<td data-test-job-status>
  <span class="tag {{this.job.statusClass}}">
    {{this.job.status}}
  </span>
</td>
{{#if (not (eq @context "child"))}}
  <td data-test-job-type>
    {{this.job.displayType.type}}
  </td>
  <td data-test-job-node-pool>
    {{#if this.job.nodePool}}{{this.job.nodePool}}{{else}}-{{/if}}
  </td>
  <td data-test-job-priority>
    {{this.job.priority}}
  </td>
{{/if}}
<td data-test-job-task-groups>
  {{#if this.job.taskGroupCount}}
    {{this.job.taskGroupCount}}
  {{else}}
    --
  {{/if}}
</td>
<td data-test-job-allocations>
  <div class="inline-chart">
    {{#if this.job.hasChildren}}
      {{#if (gt this.job.totalChildren 0)}}
        <ChildrenStatusBar @job={{this.job}} @isNarrow={{true}} />
      {{else}}
        <em class="is-faded">
          No Children
        </em>
      {{/if}}
    {{else}}
      <AllocationStatusBar
        @allocationContainer={{this.job}}
        @isNarrow={{true}}
      />
    {{/if}}
  </div>
</td>