{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}

<tr class="main-row" {{action "requestFile"}}>
  <td>
  {{#link-to "index.historyQuery" job}}
    {{job.title}}
  {{/link-to}}
  </td>
  <td {{bind-attr class=job.uppercaseStatus}}>{{all-uppercase job.status}}</td>
  <td>{{date-binding job "dateSubmittedTimestamp"}}</td>
  <td>{{job.duration}}</td>
  <td>
    <a class="fa fa-expand pull-right"></a>
  </td>
</tr>
{{#if expanded}}
  <tr class="secondary-row">
    <td colspan="5">
      {{code-helper job.file.fileContent}}

      {{#if canStop}}
        <button type="button" {{bind-attr class=":btn :btn-warning :btn-sm :pull-right job.isCancelling:disabled"}} {{action "stopJob"}}>
          {{#if job.isCancelling}}
            {{t "buttons.stoppingJob"}}
            <div class="spinner small inline-spinner"></div>
          {{else}}
            {{t "buttons.stopJob"}}
          {{/if}}
        </button>
      {{/if}}
    </td>
  </tr>
{{/if}}