{{page-title (concat "Release" " v" @model.sequence)}}

{{#if (not-eq this.target.currentRouteName "workspace.projects.project.app.release.resource")}}
  <PanelHeader @artifact="release" @sequence={{@model.sequence}}>
    <:actions>
      {{#if this.shouldShowURL}}
        <ExternalLink
          href={{enforce-protocol @model.url}}
          class="button button--primary button--external-link"
          data-test-release-url
        >
          <span>{{lowercase @model.url}}</span>
          <FlightIcon @name="external-link" class="icon" />
        </ExternalLink>
      {{/if}}
    </:actions>
  </PanelHeader>

  <div class="grid grid--overview-timeline">
    <Section @isExpandable={{false}}>
      <:heading>{{t "page.artifact.overview.heading"}}</:heading>
      <:body>
        <StatusReportMetaTable @model={{@model}} @artifactType="Release">
          <tr>
            <th scope="row">{{t "page.artifact.overview.status"}}</th>
            <td>
              <OperationStatusIndicator::Release @operation={{@model}}/>
            </td>
          </tr>
        </StatusReportMetaTable>
      </:body>
    </Section>
    {{#if @model.timeline}}
      <Section @isExpandable={{false}}>
        <:heading>{{t "page.artifact.timeline.heading"}}</:heading>
        <:body>
          <Timeline @model={{@model.timeline}} />
        </:body>
      </Section>
    {{/if}}
  </div>

  {{#if @model.statusReport.resourcesList.length}}
    <Section>
      <:heading>{{t "page.release.resources.heading"}}</:heading>
      <:body>
        <ResourcesTable
          @resources={{@model.statusReport.resourcesList}}
          @route="workspace.projects.project.app.release.resource"
        >
          <:caption>
            {{t "page.release.resources.table-caption" htmlSafe=true}}
          </:caption>
        </ResourcesTable>
      </:body>
    </Section>
  {{/if}}

  <Section>
    <:heading>{{t "page.release.logs.heading"}}</:heading>
    <:body>
      <OperationLogs @jobId={{@model.jobId}} />
    </:body>
  </Section>
{{/if}}

{{outlet}}
