aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+stats/video/video-stats.component.html
blob: e5412f1b818cac308443491b1dbce43e2ad3a7ac (plain) (blame)
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
<div class="margin-content">
  <h1 class="title-page title-page-single" i18n>{{ video.name }}</h1>

  <div class="stats-embed">
    <div class="global-stats">
      <div *ngFor="let card of globalStatsCards" class="card stats-card">
        <div class="label">{{ card.label }}</div>
        <div class="value">{{ card.value }}</div>
        <div *ngIf="card.moreInfo" class="more-info">{{ card.moreInfo }}</div>
      </div>
    </div>

    <my-embed [video]="video"></my-embed>
  </div>

  <div class="stats-with-date">
    <div class="overall-stats">
      <div class="date-filter-wrapper">
        <h2>{{ getViewersStatsTitle() }}</h2>

        <my-select-options [(ngModel)]="currentDateFilter" (ngModelChange)="onDateFilterChange()" [items]="dateFilters"></my-select-options>
      </div>

      <div class="cards">
        <div *ngFor="let card of overallStatCards" class="card stats-card">
          <div class="label">{{ card.label }}</div>
          <div class="value">{{ card.value }}</div>
          <div *ngIf="card.moreInfo" class="more-info">{{ card.moreInfo }}</div>
        </div>
      </div>
    </div>

    <div class="timeserie">
      <div ngbNav #nav="ngbNav" [activeId]="activeGraphId" (activeIdChange)="onChartChange($event)" class="nav-tabs">

        <ng-container *ngFor="let availableChart of availableCharts" [ngbNavItem]="availableChart.id">
          <a ngbNavLink i18n>
            <span>{{ availableChart.label }}</span>
          </a>

          <ng-template ngbNavContent>
            <div class="chart-container" [ngStyle]="{ 'min-height': chartHeight }">
              <p-chart
                *ngIf="chartOptions[availableChart.id]"
                [height]="chartHeight" [width]="chartWidth"
                [type]="chartOptions[availableChart.id].type" [options]="chartOptions[availableChart.id].options" [data]="chartOptions[availableChart.id].data"
                [plugins]="chartPlugins"
              ></p-chart>
            </div>

            <div class="zoom-container">
              <span *ngIf="!hasZoom() && availableChart.zoomEnabled" i18n class="description">You can select a part of the graph to zoom in</span>

              <my-button i18n *ngIf="hasZoom()" (click)="resetZoom()">Reset zoom</my-button>
            </div>
          </ng-template>
        </ng-container>
      </div>

      <div [ngbNavOutlet]="nav"></div>
    </div>
  </div>
</div>