Project

General

Profile

1
<ng-template #selected_filters_pills let-margin="margin">
2
  <!--  <div class="uk-grid uk-grid-small uk-text-small" uk-grid>-->
3
  <span *ngIf="periodFilter.selectedFromAndToValues.length > 0" class="uk-grid-margin">
4
        <a (click)="clearPeriodFilter()" [class]="((loading)?'  uk-disabled':'  ')+' uk-link-text '"> <span
5
            class="selectedFilterLabel" [class.uk-margin-small-left]="margin"
6
            title="Remove {{periodFilter.selectedFromAndToValues}}">
7
          <i uk-icon="close"></i>
8
          <span class="uk-margin-small-left">{{periodFilter.selectedFromAndToValues}}</span>
9
        </span></a>
10
    </span>
11
  <ng-container *ngFor="let filter of filters ">
12
    <ng-container *ngIf="filter.countSelectedValues > 0">
13
      <ng-container *ngFor="let value of filter.values; let i = index;  let end = last; ">
14
        <ng-container *ngIf="value.selected">
15
             <span class="uk-grid-margin">
16
                          <!-- if no grid on the div above, remove it and move class 'selectedFilterLabel' on top span -->
17
              <span class="selectedFilterLabel " [class.uk-margin-small-left]="margin" [title]="'Remove '+value.name"
18
                    (click)="value.selected = false; filter.radioValue=''; filter.countSelectedValues=
19
                    filter.countSelectedValues -1;
20
                    filterChanged({value:filter}) ">
21
                <a [class]="((loading)?'  uk-disabled':'  ')+' uk-link-text '">
22
                  <span class=" clickable" aria-hidden="true">
23
                    <span class="uk-icon">
24
                      <svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
25
                           icon="close" ratio="0.8"><path fill="none" stroke="#000" stroke-width="1.6"
26
                                                          d="M16,16 L4,4"></path><path fill="none"
27
                                                                                       stroke="#000"
28
                                                                                       stroke-width="1.6"
29
                                                                                       d="M16,4 L4,16"></path></svg>
30
                    </span>
31
                  </span>
32
                  <span class="uk-margin-small-left"
33
                        [innerHtml]="(value.name.length > 34)?value.name.substring(0,34)+'...':value.name"></span>
34
                </a>
35
              </span>
36
            </span>
37
        </ng-container>
38
      </ng-container>
39
    </ng-container>
40
  </ng-container>
41
  <!--  </div>-->
42
</ng-template>
43
<div page-content [class.greyOut]="filterToggle" (click)=" (filterToggle)?filterToggle = false:filterToggle">
44
  <div *ngIf="activeTopic && activeTopic.categories.length > 0" header>
45
    <nav class=" ">
46
      <div *ngIf="stakeholder && status === errorCodes.DONE && activeTopic" class="">
47
        <ul
48
            class="customTabs uk-tab  ">
49
          <ng-template ngFor [ngForOf]="activeTopic.categories" let-category let-i="index">
50
            <li *ngIf="isPublicOrIsMember(category.visibility)"
51
                [class.uk-active]="category.alias ===
52
                 activeCategory.alias">
53
              <a (click)="navigateTo(stakeholder.alias,activeTopic.alias, category.alias)">
54
                <span class="title">{{category.name}}</span>
55
              </a>
56
            </li>
57
          </ng-template>
58
        </ul>
59
      </div>
60
    </nav>
61
    <ul *ngIf="activeCategory && countSubCategoriesToShow(activeCategory) > 1"
62
        class="uk-subnav uk-subnav-pill subCategoriesTabs ">
63
      <ng-template ngFor [ngForOf]="activeCategory.subCategories" let-subCategory let-i="index">
64
        <li *ngIf="isPublicOrIsMember(subCategory.visibility)"
65
            [ngClass]="(subCategory.alias === activeSubCategory.alias)?'uk-active':''">
66
          <a (click)="navigateTo(stakeholder.alias,activeTopic.alias,activeCategory.alias, subCategory.alias)"
67
             class="uk-margin-remove-bottom"
68
          ><span>{{subCategory.name}}</span></a>
69
        </li>
70
      </ng-template>
71
    </ul>
72
    <div *ngIf="countSelectedFilters() > 0" class="uk-grid uk-grid-small uk-margin-bottom uk-text-small">
73
      <span class="uk-grid-margin">Filters: </span>
74
      <ng-container *ngTemplateOutlet="selected_filters_pills; context: {margin:true}"></ng-container>
75
    </div>
76
  </div>
77
  <div inner>
78
    <div [class.uk-padding]="!isSmallScreen" class="uk-padding-remove-vertical">
79
      <div *ngIf="privateStakeholder" class="message">
80
        <div class="uk-text-center">
81
          <h3><i>
82
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="24px" height="24px">
83
              <path d="M0 0h24v24H0z" fill="none"/>
84
              <path
85
                  d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/>
86
            </svg>
87
          </i>
88
            Private data
89
          </h3>
90
          <div class="uk-text-large "></div>
91
        </div>
92
      </div>
93
      <div *ngIf="!privateStakeholder && stakeholder">
94
        <div *ngIf="(activeSubCategory && (activeSubCategory.charts.length == 0 ||
95
          (activeSubCategory.charts.length == 1 && countIndicatorsToShow(activeSubCategory.charts[0].indicators) == 0)))
96
          &&  ((activeSubCategory &&
97
        activeSubCategory.description &&
98
        activeSubCategory.description.length > 0) ||
99
          (activeCategory && activeCategory.description && activeCategory.description.length > 0) ||
100
          (activeTopic && activeTopic.description && activeTopic.description.length > 0))"
101
             class="uk-text-center">
102
          <div class="uk-height-small uk-margin-large-top uk-margin-xlarge-right  uk-margin-xlarge-left">
103
            {{activeSubCategory && activeSubCategory.description && activeSubCategory.description.length > 0 ? activeSubCategory.description
104
              : (activeCategory && activeCategory.description && activeCategory.description.length > 0 ? activeCategory.description :
105
                  (activeTopic.description && activeTopic.description.length > 0 ? activeTopic.description : ""))}}
106
          </div>
107

    
108
        </div>
109
        <ng-template [ngIf]="!loading && !privateStakeholder &&
110
                    (!activeSubCategory ||
111
                    (
112
                      (activeSubCategory.numbers.length == 0 || (activeSubCategory.numbers.length == 1 && countIndicatorsToShow(activeSubCategory.numbers[0].indicators) == 0))
113
                      &&
114
                      (activeSubCategory.charts.length == 0 || (activeSubCategory.charts.length == 1 && countIndicatorsToShow(activeSubCategory.charts[0].indicators) == 0))
115
                    ) || !activeTopic || !activeCategory || !activeSubCategory)" [ngIfElse]="content">
116
          <div class="message uk-text-center">
117
            <h3>
118
              No indicators available yet. Stay tuned!
119
            </h3>
120
          </div>
121
        </ng-template>
122
        <ng-template #content>
123
          <div *ngFor="let number of activeSubCategory.numbers; let i = index;"
124
               class="uk-grid uk-grid-small uk-margin-bottom uk-margin-top"
125
               uk-height-match="target: .uk-card">
126
            <h5 *ngIf="countIndicatorsToShow(number.indicators)> 0 "
127
                class="uk-width-1-1 uk-margin-bottom">{{number.title}}</h5>
128
            <ng-template ngFor [ngForOf]="number.indicators" let-indicator let-j="index">
129
              <div *ngIf="isPublicOrIsMember(indicator.visibility)"
130
                   [ngClass]="getNumberClassBySize(indicator.width)" class=" uk-margin-bottom">
131
                <div class="uk-card uk-card-default"
132
                     [class.uk-disabled]="indicator.indicatorPaths[0].filtersApplied < countSelectedFilters()"
133
                     [class.semiFiltered]="indicator.indicatorPaths[0].filtersApplied < countSelectedFilters()">
134
                  <div class="uk-card-body uk-text-center">
135
                    <div *ngIf="properties.environment == 'development'">Filtered:
136
                      {{indicator.indicatorPaths[0].filtersApplied}}
137
                      out of
138
                      {{countSelectedFilters()}}</div>
139
                    <div class="uk-text-bold ">{{indicator.name}}</div>
140
                    <h3 class="uk-margin-medium-top uk-text-bold">
141
                      <span *ngIf="numberResults.get(i + '-' + j)">{{numberResults.get(i + '-' + j) | number}}</span>
142
                      <span *ngIf="!numberResults.get(i + '-' + j)">--</span>
143
                    </h3>
144
                    <!--<ng-container *ngTemplateOutlet="description; context: {indicator:indicator}"></ng-container>-->
145
                  </div>
146
                </div>
147
              </div>
148
            </ng-template>
149
          </div>
150
          <div [class.uk-margin-large-top]="activeSubCategory.numbers.length > 0">
151
            <div *ngFor="let chart of activeSubCategory.charts; let i = index;"
152
                 class="uk-grid uk-grid-small uk-margin-bottom uk-flex uk-flex-middle "
153
                 uk-height-match="target: .uk-card">
154
              <h5 *ngIf="chart.title && chart.title.length > 0 && countIndicatorsToShow(chart.indicators) > 0 "
155
                  class="uk-width-1-1 uk-margin-bottom">{{chart.title}}</h5>
156
              <ng-template ngFor [ngForOf]="chart.indicators" let-indicator let-j="index">
157
                <div
158
                    *ngIf="isPublicOrIsMember(indicator.visibility) && chartsActiveType.get(i + '-' + j)"
159
                    [ngClass]="getChartClassBySize(indicator.width)" class="uk-margin-bottom">
160
                  <div class="uk-card uk-card-default"
161
                       [class.uk-disabled]="chartsActiveType.get(i + '-' + j).filtersApplied < countSelectedFilters()"
162
                       [class.semiFiltered]="chartsActiveType.get(i + '-' + j).filtersApplied < countSelectedFilters()">
163
                    <div class="uk-card-body uk-text-center">
164
                      <h4 class="uk-margin-bottom chartTitle uk-flex uk-flex-bottom ">
165
                        <div>{{indicator.name + " "}}</div>
166
                      </h4>
167
                      <div *ngIf="indicator.indicatorPaths.length > 1" class="uk-button-group">
168
                        <button *ngFor="let indicatorPath of indicator.indicatorPaths;"
169
                                class="uk-button"
170
                                (click)="setActiveChart(i, j, indicatorPath.type)"
171
                                [class.uk-button-secondary]="chartsActiveType.get(i + '-' + j).url === indicatorPath.url">
172
                          {{indicatorPath.type}}
173
                        </button>
174
                      </div>
175
                      <div *ngIf="properties.environment == 'development'">
176
                        Filtered: {{chartsActiveType.get(i + '-' + j).filtersApplied}}  out of
177
                        {{countSelectedFilters()}}</div>
178
                      <iframe *ngIf=" !properties.disableFrameLoad && chartsActiveType.get(i + '-' + j).source !==
179
                      'image'"
180
                              [src]="chartsActiveType.get(i + '-' + j).safeResourceUrl"
181
                              [class]="' uk-width-1-1 uk-height-' +
182
                        (indicator.height?indicator.height.toLowerCase():'medium')"></iframe>
183
                      <div *ngIf="properties.disableFrameLoad && chartsActiveType.get(i + '-' + j).source !==
184
                      'image'" class="uk-alert uk-alert-danger uk-text-center">I frames preview is disabled</div>
185
                      <!--                                        {{chartsActiveType.get(i).safeResourceUrl}}-->
186
                      <!--                    <a [href]="chartsActiveType.get(i).safeResourceUrl" target="_blank" > ChartuURL</a>-->
187
                      <img *ngIf="chartsActiveType.get(i + '-' + j).source === 'image'"
188
                           [src]="chartsActiveType.get(i + '-' + j).safeResourceUrl"
189
                           [class]="' uk-width-1-1 uk-height-' +
190
                        (indicator.height?indicator.height.toLowerCase():'medium')">
191
                      <!--<ng-container *ngTemplateOutlet="description; context: {indicator:indicator}"></ng-container>-->
192
                    </div>
193
                  </div>
194
                </div>
195
              </ng-template>
196
            </div>
197
          </div>
198
          <div class="uk-margin-medium-top uk-flex">
199
            <!-- Last Stats Date-->
200
            <div class="uk-width-2-3@m uk-width-1-2">
201
              <img src="assets/common-assets/graph.svg" style="opacity: 0.4">
202
              <span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a
203
                  href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span>
204
              <span *ngIf="statsUpdateDate" class="uk-text-baseline uk-text-muted">
205
                . Last update of statistics in OpenAIRE: {{statsUpdateDate | date: 'MMM dd, yyyy'}}
206
              </span>
207
            </div>
208
            <!--Feedback-->
209
            <div class="uk-width-expand uk-text-right">
210
              <span class="uk-text-muted">Send us your <a [href]="mailText" target="_self"
211
                                                          (click)="mailMe()">feedback</a>.</span>
212
            </div>
213
          </div>
214
        </ng-template>
215
      </div>
216
    </div>
217
  </div>
218
</div>
219
<!--(click)="filterToggle= !filterToggle"
220
     [style.display]="(filterToggle?'none':'inherit')"-->
221
<div *ngIf="stakeholder && !privateStakeholder" href="#style_switcher" uk-toggle="" id="filters_switcher_toggle">
222
  <i class="  uk-text-muted">
223
    <svg style="margin-top: 8px;" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24"
224
         viewBox="0 0 20 20"
225
         fill="white" width="24px" height="16px">
226
      <g>
227
        <path d="M0,0h24 M24,24H0" fill="none"/>
228
        <path
229
            d="M4.25,5.61C6.57,8.59,10,13,10,13v5c0,1.1,0.9,2,2,2h0c1.1,0,2-0.9,2-2v-5c0,0,3.43-4.41,5.75-7.39 C20.26,4.95,19.79,4,18.95,4H5.04C4.21,4,3.74,4.95,4.25,5.61z"/>
230
        <path d="M0,0h24v24H0V0z" fill="none"/>
231
      </g>
232
    </svg>
233
  </i>
234
</div>
235
<div *ngIf="stakeholder && !privateStakeholder" id="style_switcher" class=" uk-offcanvas filters_switcher"
236
     uk-offcanvas="flip:true" mode="slide" overlay="" style="z-index:982;">
237

    
238
  <div class="uk-offcanvas-bar offcanvas-white">
239
    <div class="uk-float-right">
240
      <button class="uk-offcanvas-close uk-close uk-icon" type="button" uk-close=""></button>
241

    
242
    </div>
243
    <div class="uk-padding">
244
      <div class="uk-grid uk-flex uk-flex-middle">
245
        <h5>Filters</h5>
246
        <a *ngIf="countSelectedFilters() > 1"
247
           class="  portal-link uk-width-1-2" (click)="clearAll()"> Clear All </a>
248
      </div>
249
      <div class="uk-grid uk-grid-small uk-text-small" uk-grid>
250
        <ng-container *ngTemplateOutlet="selected_filters_pills; context: {margin:false}"></ng-container>
251
      </div>
252
      <div class="uk-margin-small-top"><i class="uk-text-muted uk-text-small"> If your filter selection cannot be
253
        applied to a chart, that chart will appear grayed-out.</i></div>
254
      <ul class="uk-list uk-list-divider  uk-margin-medium">
255
        <li>
256
          <range-filter [filter]="periodFilter" yearMin="2000" yearMax="2020" [mandatoryRange]="true"
257
                        (onFilterChange)="filter()"></range-filter>
258
        </li>
259
        <ng-container *ngFor="let filter of filters ">
260
          <li *ngIf="filter.values.length >0">
261
            <search-filter [filter]="filter" [showResultCount]=false
262
                           (onFilterChange)="filterChanged($event)"></search-filter>
263
          </li>
264
        </ng-container>
265
      </ul>
266

    
267
    </div>
268
  </div>
269
</div>
270

    
271
<ng-template #description let-indicator="indicator">
272
<span class="descriptionIcon"
273
      *ngIf="(indicator.description && indicator.description.length > 0)
274
                       || (indicator.additionalDescription && indicator.additionalDescription.length > 0)"
275
      uk-icon="info"
276
      [attr.uk-tooltip]="'title:<div class=\'uk-padding-small\'>'+
277
  (indicator.description&& indicator.description.length > 0?indicator.description:'') +'<br>'+
278
(indicator.additionalDescription && indicator.additionalDescription.length?indicator.additionalDescription:'')
279
  +'</div>'">
280
  </span>
281
</ng-template>
(3-3/5)