aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/hbs/source-viewer/source-viewer-header.hbs
blob: e3ce5eed3d420991bfd74689b06569a22947975d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<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}}

    {{#notNull measures.issues}}
      <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}}">
            {{measures.issues}}&nbsp;<i class="icon-detach"></i>
          </a>
        </span>
        <span class="source-viewer-header-measure-label">{{t 'metric.violations.name'}}</span>
      </div>
    {{/notNull}}

    {{#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}}