<div class="source-viewer-header-component">
  <div class="component-name">

    {{#unless removed}}
      {{#if projectName}}
        <div class="component-name-parent">
          {{qualifierIcon 'TRK'}}&nbsp;<a href="{{dashboardUrl project}}">{{projectName}}</a>
        </div>
        {{#if subProjectName}}
          <div class="component-name-parent">
            {{qualifierIcon 'TRK'}}&nbsp;<a href="{{dashboardUrl subProject}}">{{subProjectName}}</a>
          </div>
        {{/if}}
      {{/if}}

      <div class="component-name-path">
        {{qualifierIcon q}}&nbsp;<span>{{collapsedDirFromPath path}}</span><span class="component-name-file">{{fileFromPath path}}</span>

        {{#if canMarkAsFavourite}}
          <a class="js-favorite component-name-favorite {{#if fav}}icon-favorite{{else}}icon-not-favorite{{/if}}"
             title="{{#if fav}}{{t 'click_to_remove_from_favorites'}}{{else}}{{t 'click_to_add_to_favorites'}}{{/if}}">
          </a>
        {{/if}}
      </div>
    {{else}}
      <div class="source-viewer-header-component-project removed">{{removedMessage}}</div>
    {{/unless}}
  </div>
</div>

{{#unless removed}}
  <a class="js-actions source-viewer-header-actions icon-list" title="{{t 'component_viewer.more_actions'}}"></a>

  <div class="source-viewer-header-measures">
    {{#if isUnitTest}}
      <div class="source-viewer-header-measure">
        <span class="source-viewer-header-measure-value">{{measures.tests}}</span>
        <span class="source-viewer-header-measure-label">{{t 'metric.tests.name'}}</span>
      </div>
    {{/if}}

    {{#unless isUnitTest}}
      <div class="source-viewer-header-measure">
        <span class="source-viewer-header-measure-value">{{default measures.lines}}</span>
        <span class="source-viewer-header-measure-label">{{t 'metric.lines.name'}}</span>
      </div>
    {{/unless}}

    {{#notNull measures.sqaleRating}}
      <div class="source-viewer-header-measure">
        <span class="rating rating-{{measures.sqaleRating}}"
              {{#if measures.debtRatio}}title="{{t 'metric.sqale_debt_ratio.name'}}: {{measures.debtRatio}}"{{/if}}>
          {{measures.sqaleRating}}
        </span>
      </div>
    {{/notNull}}

    {{#notNull measures.debt}}
      <div class="source-viewer-header-measure">
        <span class="source-viewer-header-measure-value">{{default measures.debt}}</span>
        <span class="source-viewer-header-measure-label">{{t 'component_viewer.header.debt'}}</span>
      </div>
    {{/notNull}}

    <div class="source-viewer-header-measure">
      <span class="source-viewer-header-measure-value">
        <a class="source-viewer-header-external-link" target="_blank"
           href="{{link '/issues/search#resolved=false|fileUuids=' uuid}}">
          {{default measures.issues 0}}&nbsp;<i class="icon-detach"></i>
        </a>
      </span>
      <span class="source-viewer-header-measure-label">{{t 'metric.violations.name'}}</span>
    </div>

    {{#notNull measures.coverage}}
      <div class="source-viewer-header-measure">
        <span class="source-viewer-header-measure-value">{{default measures.coverage}}</span>
        <span class="source-viewer-header-measure-label">{{t 'metric.coverage.name'}}</span>
      </div>
    {{/notNull}}

    {{#notNull measures.duplicationDensity}}
      <div class="source-viewer-header-measure">
        <span class="source-viewer-header-measure-value">{{default measures.duplicationDensity}}</span>
        <span class="source-viewer-header-measure-label">{{t 'duplications'}}</span>
      </div>
    {{/notNull}}

  </div>
{{/unless}}
